@arbium/enterprise-agent-connect-client 0.0.0-stage → 0.1.2-dev.d2aa5ca

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.d.ts ADDED
@@ -0,0 +1,1269 @@
1
+ import { type AppLive } from "./steps.js";
2
+ import type { Agent, CheckOutcome, Connection, Connector, EventSubscriptionInput, EventTriggerInput, Limits, SiteAccess, TeamsTriggerInput } from "./types.js";
3
+ export * from "./steps.js";
4
+ export type * from "./types.js";
5
+ /** A refusal the admin should read (4xx with an `error`): bad input, a failed connection
6
+ * check, a name in use. A 5xx or an answer without an `error` throws a plain Error. */
7
+ export declare class AgentConnectError extends Error {
8
+ readonly status: number;
9
+ constructor(message: string, status: number);
10
+ }
11
+ export type ClientOptions = {
12
+ /** Where the service answers, e.g. http://agent-connect:3000. */
13
+ baseUrl: string;
14
+ /** The admin token (AGENT_CONNECT_ADMIN_TOKEN). */
15
+ token: string;
16
+ /** Connecting Microsoft retries while its approval settles (up to ~20s). Default 45s. */
17
+ timeoutMs?: number;
18
+ /** Default: the global fetch at the time of each call. */
19
+ fetch?: typeof fetch;
20
+ };
21
+ export type AgentConnectClient = ReturnType<typeof createClient>;
22
+ /** The admin API (v1), server to server: the token must never reach a browser. */
23
+ export declare function createClient(options: ClientOptions): {
24
+ checkedSites: (o: string, a: string) => Promise<SiteAccess[] | null>;
25
+ /** The read-only live check of each app of its own that is on, for warnings no stored
26
+ * status holds (e.g. an app can see nothing yet). Null for an app whose check could not
27
+ * run. */
28
+ appChecks(o: string, connectors: Connector[], connections: Connection[]): Promise<Record<string, CheckOutcome | null>>;
29
+ /** Each provider app's live state for its steps (`appState`), read only: its own check
30
+ * and its sites while on, the organization's Claude key where a capability needs one,
31
+ * and its chosen steps' own live checks (none while those steps are not chosen, so no
32
+ * vendor call). An app's page, its provider's page and the Integrations tab all read it
33
+ * here, so they agree. The Claude key and the step checks are read once for all apps. */
34
+ appStates(o: string, connectors: Connector[], connections: Connection[]): Promise<Record<string, AppLive>>;
35
+ organizations: {
36
+ list: () => Promise<{
37
+ id: string;
38
+ name: string | null;
39
+ createdAt: string;
40
+ }[]>;
41
+ get: (id: string) => Promise<{
42
+ id: string;
43
+ name: string | null;
44
+ createdAt: string;
45
+ } | null>;
46
+ /** Makes the organization with this id if missing; `name` replaces the kept one. */
47
+ ensure: (id: string, name?: string) => Promise<{
48
+ id: string;
49
+ name: string | null;
50
+ createdAt: string;
51
+ }>;
52
+ create: (name: string) => Promise<{
53
+ id: string;
54
+ name: string | null;
55
+ createdAt: string;
56
+ }>;
57
+ };
58
+ branding: () => Promise<{
59
+ productName: string;
60
+ logoUrl?: string;
61
+ resourcePrefix: string;
62
+ microsoft: {
63
+ appName: string;
64
+ mailboxGroup: string;
65
+ mailboxGroupAlias: string;
66
+ botRole: string;
67
+ };
68
+ teams: {
69
+ resourceGroup: string;
70
+ developer?: {
71
+ name: string;
72
+ websiteUrl: string;
73
+ privacyUrl: string;
74
+ termsOfUseUrl: string;
75
+ };
76
+ };
77
+ }>;
78
+ connectors: () => Promise<{
79
+ id: string;
80
+ name: string;
81
+ description: string;
82
+ logo: string;
83
+ identity: string;
84
+ signsInAs?: "agentBot";
85
+ provider?: string;
86
+ order?: number;
87
+ connectionKind: "guided";
88
+ accountKey: string;
89
+ scopes?: string[];
90
+ setup: {
91
+ title: string;
92
+ body: string;
93
+ link?: {
94
+ label: string;
95
+ href: string;
96
+ };
97
+ copy?: string[];
98
+ shell?: "bash" | "powershell";
99
+ permissions?: boolean;
100
+ certificate?: boolean;
101
+ click?: string[];
102
+ clickUnavailable?: true;
103
+ siteRole?: "read" | "write";
104
+ agentCheck?: boolean;
105
+ confirm?: string;
106
+ live?: string;
107
+ settings?: {
108
+ id: string;
109
+ label: string;
110
+ help?: string;
111
+ placeholder?: string;
112
+ pattern: string;
113
+ }[];
114
+ option?: {
115
+ field: string;
116
+ value: string;
117
+ };
118
+ }[];
119
+ afterConnect: {
120
+ title: string;
121
+ body: string;
122
+ link?: {
123
+ label: string;
124
+ href: string;
125
+ };
126
+ copy?: string[];
127
+ shell?: "bash" | "powershell";
128
+ permissions?: boolean;
129
+ certificate?: boolean;
130
+ click?: string[];
131
+ clickUnavailable?: true;
132
+ siteRole?: "read" | "write";
133
+ agentCheck?: boolean;
134
+ confirm?: string;
135
+ live?: string;
136
+ settings?: {
137
+ id: string;
138
+ label: string;
139
+ help?: string;
140
+ placeholder?: string;
141
+ pattern: string;
142
+ }[];
143
+ option?: {
144
+ field: string;
145
+ value: string;
146
+ };
147
+ }[];
148
+ fields: {
149
+ id: string;
150
+ label: string;
151
+ help?: string;
152
+ placeholder?: string;
153
+ secret: boolean;
154
+ options?: {
155
+ value: string;
156
+ label: string;
157
+ description: string;
158
+ scopes?: string[];
159
+ }[];
160
+ requires?: {
161
+ field: string;
162
+ value: string;
163
+ };
164
+ }[];
165
+ capabilities: {
166
+ id: string;
167
+ label: string;
168
+ description: string;
169
+ required: boolean;
170
+ destructive: boolean;
171
+ costs?: boolean;
172
+ scopes: string[];
173
+ roles?: string[];
174
+ permissions: string[];
175
+ fill?: {
176
+ [key: string]: string;
177
+ };
178
+ note?: string;
179
+ forbidden?: string;
180
+ claudeKey?: boolean;
181
+ tools: string[];
182
+ }[];
183
+ limits: {
184
+ id: string;
185
+ label: string;
186
+ help: string;
187
+ kind: "list" | "text" | "map";
188
+ required: boolean;
189
+ pattern?: string;
190
+ keys?: string;
191
+ }[];
192
+ siteAccess?: {
193
+ grant: {
194
+ title: string;
195
+ body: string;
196
+ link?: {
197
+ label: string;
198
+ href: string;
199
+ };
200
+ copy?: string[];
201
+ shell?: "bash" | "powershell";
202
+ permissions?: boolean;
203
+ certificate?: boolean;
204
+ click?: string[];
205
+ clickUnavailable?: true;
206
+ siteRole?: "read" | "write";
207
+ agentCheck?: boolean;
208
+ confirm?: string;
209
+ live?: string;
210
+ settings?: {
211
+ id: string;
212
+ label: string;
213
+ help?: string;
214
+ placeholder?: string;
215
+ pattern: string;
216
+ }[];
217
+ option?: {
218
+ field: string;
219
+ value: string;
220
+ };
221
+ }[];
222
+ request: string;
223
+ write: string[];
224
+ };
225
+ agentAccess?: {
226
+ limit: string;
227
+ label: string;
228
+ path: string & (unknown & unknown);
229
+ granted: string;
230
+ notGranted: string;
231
+ notFound: string;
232
+ probes: {
233
+ [key: string]: {
234
+ method: "GET" | "POST" | "PATCH";
235
+ path: string & (unknown & unknown);
236
+ body?: unknown;
237
+ allowed: number[];
238
+ };
239
+ };
240
+ missing?: string;
241
+ };
242
+ verify: {
243
+ method: "GET" | "POST";
244
+ path: string;
245
+ label: string;
246
+ show: string;
247
+ match?: {
248
+ [key: string]: string | number | boolean;
249
+ };
250
+ body?: {
251
+ [key: string]: unknown;
252
+ };
253
+ ifEmpty?: string;
254
+ } | {
255
+ label: string;
256
+ check: string;
257
+ ifEmpty?: string;
258
+ };
259
+ discover?: {
260
+ method: "GET" | "POST";
261
+ path: string;
262
+ label: string;
263
+ show: string;
264
+ match?: {
265
+ [key: string]: string | number | boolean;
266
+ };
267
+ body?: {
268
+ [key: string]: unknown;
269
+ };
270
+ ifEmpty?: string;
271
+ } | {
272
+ label: string;
273
+ check: string;
274
+ ifEmpty?: string;
275
+ };
276
+ revoke: string;
277
+ http?: {
278
+ baseUrl: string;
279
+ auth: {
280
+ type: "header";
281
+ header: string;
282
+ value: string;
283
+ prefix?: string;
284
+ } | {
285
+ type: "bearer";
286
+ token: string;
287
+ } | {
288
+ type: "basic";
289
+ username: string;
290
+ password: string;
291
+ } | {
292
+ type: "oauth2";
293
+ tokenUrl: string;
294
+ clientId: string;
295
+ clientSecret: string;
296
+ scope?: string;
297
+ } | {
298
+ type: "query";
299
+ param: string;
300
+ value: string;
301
+ };
302
+ headers: {
303
+ [key: string]: string;
304
+ };
305
+ tools: {
306
+ name: string;
307
+ description: string;
308
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
309
+ path: string;
310
+ params: {
311
+ [key: string]: {
312
+ type: "string" | "number" | "integer" | "boolean" | "array";
313
+ description: string;
314
+ in: "path" | "query" | "body";
315
+ name?: string;
316
+ required: boolean;
317
+ default?: (string | number | boolean) | (string | number | boolean)[];
318
+ enum?: (string | number | boolean)[];
319
+ items?: "string" | "number" | "integer" | "boolean";
320
+ join?: string;
321
+ limit?: string;
322
+ };
323
+ };
324
+ destructive: boolean;
325
+ answerLimits: {
326
+ field: string;
327
+ limit: string;
328
+ }[];
329
+ result?: {
330
+ items?: string;
331
+ fields?: string[];
332
+ };
333
+ paging?: {
334
+ param: string;
335
+ body: string;
336
+ } | {
337
+ param: string;
338
+ header: string;
339
+ } | {
340
+ param: string;
341
+ link: true;
342
+ };
343
+ }[];
344
+ allowInsecureHttp: boolean;
345
+ };
346
+ soap?: {
347
+ endpoint: string;
348
+ version: "1.1" | "1.2";
349
+ namespaces: {
350
+ [key: string]: string;
351
+ };
352
+ auth?: {
353
+ type: "header";
354
+ header: string;
355
+ value: string;
356
+ prefix?: string;
357
+ } | {
358
+ type: "bearer";
359
+ token: string;
360
+ } | {
361
+ type: "basic";
362
+ username: string;
363
+ password: string;
364
+ };
365
+ wsSecurity?: {
366
+ username: string;
367
+ password: string;
368
+ digest: boolean;
369
+ };
370
+ verify?: {
371
+ tool: string;
372
+ args: {
373
+ [key: string]: string | number | boolean;
374
+ };
375
+ show: string;
376
+ };
377
+ tools: {
378
+ name: string;
379
+ description: string;
380
+ operation: string;
381
+ soapAction?: string;
382
+ body: string;
383
+ params: {
384
+ [key: string]: {
385
+ type: "string" | "number" | "integer" | "boolean";
386
+ description: string;
387
+ required: boolean;
388
+ limit?: string;
389
+ };
390
+ };
391
+ result?: string;
392
+ fields?: string[];
393
+ readOnly: boolean;
394
+ destructive: boolean;
395
+ answerLimits: {
396
+ field: string;
397
+ limit: string;
398
+ }[];
399
+ }[];
400
+ allowInsecureHttp: boolean;
401
+ };
402
+ odata?: {
403
+ serviceRoot: string;
404
+ version: "2" | "4";
405
+ auth: {
406
+ type: "header";
407
+ header: string;
408
+ value: string;
409
+ prefix?: string;
410
+ } | {
411
+ type: "bearer";
412
+ token: string;
413
+ } | {
414
+ type: "basic";
415
+ username: string;
416
+ password: string;
417
+ } | {
418
+ type: "oauth2";
419
+ tokenUrl: string;
420
+ clientId: string;
421
+ clientSecret: string;
422
+ scope?: string;
423
+ } | {
424
+ type: "query";
425
+ param: string;
426
+ value: string;
427
+ };
428
+ headers: {
429
+ [key: string]: string;
430
+ };
431
+ csrf: boolean;
432
+ paging: "skip" | "server";
433
+ tools: {
434
+ name: string;
435
+ description: string;
436
+ kind: "list" | "get" | "create" | "update" | "function" | "action";
437
+ entitySet?: string;
438
+ function?: string;
439
+ key: {
440
+ [key: string]: {
441
+ type: "string" | "integer" | "number" | "decimal" | "boolean" | "guid" | "datetime" | "datetimeoffset";
442
+ description: string;
443
+ property?: string;
444
+ required?: boolean;
445
+ limit?: string;
446
+ };
447
+ };
448
+ filters: {
449
+ [key: string]: {
450
+ type: "string" | "integer" | "number" | "decimal" | "boolean" | "guid" | "datetime" | "datetimeoffset";
451
+ description: string;
452
+ property?: string;
453
+ required?: boolean;
454
+ limit?: string;
455
+ op: "eq" | "ne" | "gt" | "ge" | "lt" | "le" | "contains" | "startswith";
456
+ };
457
+ };
458
+ fields: {
459
+ [key: string]: {
460
+ type: "string" | "integer" | "number" | "decimal" | "boolean" | "guid" | "datetime" | "datetimeoffset";
461
+ description: string;
462
+ property?: string;
463
+ required?: boolean;
464
+ limit?: string;
465
+ };
466
+ };
467
+ params: {
468
+ [key: string]: {
469
+ type: "string" | "integer" | "number" | "decimal" | "boolean" | "guid" | "datetime" | "datetimeoffset";
470
+ description: string;
471
+ property?: string;
472
+ required?: boolean;
473
+ limit?: string;
474
+ };
475
+ };
476
+ select: string[];
477
+ orderBy?: string;
478
+ top: number;
479
+ destructive: boolean;
480
+ answerLimits: {
481
+ field: string;
482
+ limit: string;
483
+ }[];
484
+ }[];
485
+ allowInsecureHttp: boolean;
486
+ };
487
+ sql?: {
488
+ engine: "postgres" | "sqlserver" | "mysql" | "oracle";
489
+ host: string;
490
+ port?: number;
491
+ database: string;
492
+ auth: {
493
+ user: string;
494
+ password: string;
495
+ };
496
+ tls: "verify" | "insecure" | "off";
497
+ timeoutSeconds: number;
498
+ maxRows: number;
499
+ tools: {
500
+ name: string;
501
+ description: string;
502
+ sql: string;
503
+ params: {
504
+ [key: string]: {
505
+ type: "string" | "number" | "integer" | "boolean";
506
+ description: string;
507
+ required: boolean;
508
+ limit?: string;
509
+ };
510
+ };
511
+ write: boolean;
512
+ destructive: boolean;
513
+ answerLimits: {
514
+ column: string;
515
+ limit: string;
516
+ }[];
517
+ }[];
518
+ };
519
+ events?: {
520
+ types: {
521
+ id: string;
522
+ label: string;
523
+ }[];
524
+ fields: {
525
+ [key: string]: string;
526
+ };
527
+ limits: {
528
+ [key: string]: string;
529
+ };
530
+ webhook?: {
531
+ verify: {
532
+ type: "hmac-sha256";
533
+ header: string;
534
+ prefix: string;
535
+ } | {
536
+ type: "token";
537
+ header: string;
538
+ } | {
539
+ type: "none";
540
+ };
541
+ allowInsecure: boolean;
542
+ type: {
543
+ field: string;
544
+ } | {
545
+ header: string;
546
+ };
547
+ deliveryId?: {
548
+ field: string;
549
+ } | {
550
+ header: string;
551
+ };
552
+ timestamp?: {
553
+ at: {
554
+ field: string;
555
+ } | {
556
+ header: string;
557
+ };
558
+ unit: "s" | "ms" | "iso";
559
+ toleranceSeconds: number;
560
+ };
561
+ setup: {
562
+ title: string;
563
+ body: string;
564
+ link?: {
565
+ label: string;
566
+ href: string;
567
+ };
568
+ copy?: string[];
569
+ shell?: "bash" | "powershell";
570
+ permissions?: boolean;
571
+ certificate?: boolean;
572
+ click?: string[];
573
+ clickUnavailable?: true;
574
+ siteRole?: "read" | "write";
575
+ agentCheck?: boolean;
576
+ confirm?: string;
577
+ live?: string;
578
+ settings?: {
579
+ id: string;
580
+ label: string;
581
+ help?: string;
582
+ placeholder?: string;
583
+ pattern: string;
584
+ }[];
585
+ option?: {
586
+ field: string;
587
+ value: string;
588
+ };
589
+ }[];
590
+ register?: {
591
+ method: "GET" | "POST" | "PUT";
592
+ path: string;
593
+ body?: unknown;
594
+ location: string;
595
+ };
596
+ };
597
+ self?: {
598
+ request: {
599
+ method: "GET" | "POST" | "PUT";
600
+ path: string;
601
+ body?: unknown;
602
+ };
603
+ id: string;
604
+ fields: string[];
605
+ };
606
+ poll?: {
607
+ request: {
608
+ method: "GET" | "POST" | "PUT";
609
+ path: string;
610
+ body?: unknown;
611
+ };
612
+ filter?: string;
613
+ items: string;
614
+ wrap?: string;
615
+ cursor: string;
616
+ deliveryId: string[];
617
+ types: {
618
+ type: string;
619
+ same?: [string, string];
620
+ }[];
621
+ };
622
+ };
623
+ }[]>;
624
+ providers: () => Promise<{
625
+ id: string;
626
+ name: string;
627
+ logo: string;
628
+ identity: string;
629
+ sharedIdentity?: string;
630
+ accountKey: string;
631
+ principalKeys: string[];
632
+ certificate: boolean;
633
+ setup: {
634
+ title: string;
635
+ body: string;
636
+ link?: {
637
+ label: string;
638
+ href: string;
639
+ };
640
+ copy?: string[];
641
+ shell?: "bash" | "powershell";
642
+ permissions?: boolean;
643
+ certificate?: boolean;
644
+ click?: string[];
645
+ clickUnavailable?: true;
646
+ siteRole?: "read" | "write";
647
+ agentCheck?: boolean;
648
+ confirm?: string;
649
+ live?: string;
650
+ settings?: {
651
+ id: string;
652
+ label: string;
653
+ help?: string;
654
+ placeholder?: string;
655
+ pattern: string;
656
+ }[];
657
+ option?: {
658
+ field: string;
659
+ value: string;
660
+ };
661
+ }[];
662
+ fields: {
663
+ id: string;
664
+ label: string;
665
+ help?: string;
666
+ placeholder?: string;
667
+ secret: boolean;
668
+ options?: {
669
+ value: string;
670
+ label: string;
671
+ description: string;
672
+ scopes?: string[];
673
+ }[];
674
+ requires?: {
675
+ field: string;
676
+ value: string;
677
+ };
678
+ optional: boolean;
679
+ }[];
680
+ addAgent: {
681
+ title: string;
682
+ body: string;
683
+ link?: {
684
+ label: string;
685
+ href: string;
686
+ };
687
+ copy?: string[];
688
+ shell?: "bash" | "powershell";
689
+ permissions?: boolean;
690
+ certificate?: boolean;
691
+ click?: string[];
692
+ clickUnavailable?: true;
693
+ siteRole?: "read" | "write";
694
+ agentCheck?: boolean;
695
+ confirm?: string;
696
+ live?: string;
697
+ settings?: {
698
+ id: string;
699
+ label: string;
700
+ help?: string;
701
+ placeholder?: string;
702
+ pattern: string;
703
+ }[];
704
+ option?: {
705
+ field: string;
706
+ value: string;
707
+ };
708
+ apps: string[];
709
+ }[];
710
+ revoke: string;
711
+ approval: boolean;
712
+ }[]>;
713
+ providerConnections: (o: string) => Promise<{
714
+ id: string;
715
+ organizationId: string;
716
+ provider: string;
717
+ status: "pending" | "connected" | "needs_reconnect";
718
+ config: {
719
+ [key: string]: string;
720
+ };
721
+ accountLabel: string | null;
722
+ connectedBy: string | null;
723
+ connectedAt: string;
724
+ checkedAt: string;
725
+ certificate: import("./schema.js").components["schemas"]["CertificateInfo"] | null;
726
+ nextCertificate: import("./schema.js").components["schemas"]["CertificateInfo"] | null;
727
+ apps: string[];
728
+ }[]>;
729
+ connectProvider: (o: string, p: string, body: {
730
+ fields: Record<string, string>;
731
+ connectedBy: string;
732
+ }) => Promise<{
733
+ id: string;
734
+ organizationId: string;
735
+ provider: string;
736
+ status: "pending" | "connected" | "needs_reconnect";
737
+ config: {
738
+ [key: string]: string;
739
+ };
740
+ accountLabel: string | null;
741
+ connectedBy: string | null;
742
+ connectedAt: string;
743
+ checkedAt: string;
744
+ certificate: import("./schema.js").components["schemas"]["CertificateInfo"] | null;
745
+ nextCertificate: import("./schema.js").components["schemas"]["CertificateInfo"] | null;
746
+ apps: string[];
747
+ }>;
748
+ checkProvider: (o: string, p: string) => Promise<{
749
+ ok: true;
750
+ } | {
751
+ ok: false;
752
+ error: string;
753
+ }>;
754
+ /** Before connecting, the certificate to upload; after, one to rotate to. */
755
+ newCertificate: (o: string, p: string, by: string) => Promise<{
756
+ id: string;
757
+ organizationId: string;
758
+ provider: string;
759
+ status: "pending" | "connected" | "needs_reconnect";
760
+ config: {
761
+ [key: string]: string;
762
+ };
763
+ accountLabel: string | null;
764
+ connectedBy: string | null;
765
+ connectedAt: string;
766
+ checkedAt: string;
767
+ certificate: import("./schema.js").components["schemas"]["CertificateInfo"] | null;
768
+ nextCertificate: import("./schema.js").components["schemas"]["CertificateInfo"] | null;
769
+ apps: string[];
770
+ }>;
771
+ /** Signs in with the new certificate and, if that works, switches to it. */
772
+ activateCertificate: (o: string, p: string, by: string) => Promise<{
773
+ id: string;
774
+ organizationId: string;
775
+ provider: string;
776
+ status: "pending" | "connected" | "needs_reconnect";
777
+ config: {
778
+ [key: string]: string;
779
+ };
780
+ accountLabel: string | null;
781
+ connectedBy: string | null;
782
+ connectedAt: string;
783
+ checkedAt: string;
784
+ certificate: import("./schema.js").components["schemas"]["CertificateInfo"] | null;
785
+ nextCertificate: import("./schema.js").components["schemas"]["CertificateInfo"] | null;
786
+ apps: string[];
787
+ }>;
788
+ /** Disconnects the provider and every app signing in through it. */
789
+ disconnectProvider: (o: string, p: string, by: string) => Promise<void>;
790
+ /** Values an app's steps ask for, kept on the provider connection. */
791
+ setProviderSettings: (o: string, p: string, values: Record<string, string>, by: string) => Promise<{
792
+ settings: {
793
+ [key: string]: string;
794
+ };
795
+ }>;
796
+ connections: (o: string) => Promise<{
797
+ id: string;
798
+ organizationId: string;
799
+ connectorId: string;
800
+ providerId: string | null;
801
+ capabilities: string[];
802
+ config: {
803
+ [key: string]: string;
804
+ };
805
+ status: "connected" | "needs_reconnect";
806
+ accountLabel: string | null;
807
+ connectedBy: string | null;
808
+ connectedAt: string;
809
+ checkedAt: string;
810
+ }[]>;
811
+ connect: (o: string, a: string, body: {
812
+ capabilities: string[];
813
+ fields: Record<string, string>;
814
+ connectedBy: string;
815
+ }) => Promise<{
816
+ connection: import("./schema.js").components["schemas"]["Connection"];
817
+ checks: import("./schema.js").components["schemas"]["Check"][];
818
+ }>;
819
+ startConsent: (o: string, a: string, body: {
820
+ capabilities: string[];
821
+ redirectUri: string;
822
+ }) => Promise<{
823
+ url: string;
824
+ nonce: string;
825
+ }>;
826
+ /** `redirect`: the approval came back; the admin signs in to that organization next.
827
+ * `provider`: the approval connected the provider; the app still needs its own settings. */
828
+ finishConsent: (o: string, a: string, body: {
829
+ state: string;
830
+ nonce: string;
831
+ params: Record<string, string>;
832
+ connectedBy: string;
833
+ }) => Promise<{
834
+ connection: import("./schema.js").components["schemas"]["Connection"];
835
+ checks: import("./schema.js").components["schemas"]["Check"][];
836
+ } | {
837
+ redirect: string;
838
+ } | {
839
+ provider: import("./schema.js").components["schemas"]["ProviderConnection"];
840
+ }>;
841
+ setCeiling: (o: string, a: string, capabilities: string[], by: string) => Promise<void>;
842
+ /** Recorded: a failure marks the app as needing reconnecting, so it names the admin. */
843
+ check: (o: string, a: string, by: string) => Promise<{
844
+ ok: true;
845
+ checks: import("./schema.js").components["schemas"]["Check"][];
846
+ } | {
847
+ ok: false;
848
+ error: string;
849
+ }>;
850
+ /** The same checks, read only: a failure here does not mark the app. */
851
+ peek: (o: string, a: string) => Promise<{
852
+ ok: true;
853
+ checks: import("./schema.js").components["schemas"]["Check"][];
854
+ } | {
855
+ ok: false;
856
+ error: string;
857
+ }>;
858
+ /** The sites added to an app, the whole list at once. */
859
+ setSites: (o: string, a: string, sites: string[], by: string) => Promise<{
860
+ sites: string[];
861
+ }>;
862
+ /** Whether the app can open each added site, or just `site`. */
863
+ checkSites: (o: string, a: string, site?: string) => Promise<{
864
+ sites: import("./schema.js").components["schemas"]["SiteAccess"][];
865
+ }>;
866
+ /** Whether the app can reach one agent's own address (its mailbox) yet. */
867
+ agentAccess: (o: string, a: string, value: string, by: string) => Promise<{
868
+ value: string;
869
+ status: "granted" | "not_granted" | "not_found" | "failed";
870
+ message: string;
871
+ }>;
872
+ disconnect: (o: string, a: string, by: string) => Promise<void>;
873
+ agents: (o: string) => Promise<{
874
+ id: string;
875
+ organizationId: string;
876
+ name: string;
877
+ status: "active" | "disabled";
878
+ createdBy: string | null;
879
+ createdAt: string;
880
+ lastUsedAt: string | null;
881
+ grants: import("./schema.js").components["schemas"]["Grant"][];
882
+ }[]>;
883
+ createAgent: (o: string, body: {
884
+ name: string;
885
+ createdBy: string;
886
+ }) => Promise<{
887
+ agent: import("./schema.js").components["schemas"]["NewAgent"];
888
+ key: string;
889
+ }>;
890
+ setAgentStatus: (o: string, id: string, status: Agent["status"], by: string) => Promise<void>;
891
+ newKey: (o: string, id: string, by: string) => Promise<{
892
+ key: string;
893
+ }>;
894
+ deleteAgent: (o: string, id: string, by: string) => Promise<void>;
895
+ setGrant: (o: string, id: string, a: string, capabilities: string[], limits: Limits, by: string) => Promise<void>;
896
+ removeGrant: (o: string, id: string, a: string, by: string) => Promise<void>;
897
+ /** Recent requests, newest first, of one key (`agent`), one app, or both. */
898
+ audit: (o: string, filter: {
899
+ agent?: string;
900
+ app?: string;
901
+ }, limit?: number) => Promise<{
902
+ at: string;
903
+ agentId: string | null;
904
+ agentName: string | null;
905
+ connectorId: string;
906
+ tool: string;
907
+ target: string | null;
908
+ decision: "allowed" | "denied" | "failed";
909
+ reason: string | null;
910
+ vendorStatus: number | null;
911
+ }[]>;
912
+ confirmed: (o: string) => Promise<string[]>;
913
+ setConfirmed: (o: string, step: string, on: boolean, by: string) => Promise<void>;
914
+ teamsBots: (o: string) => Promise<{
915
+ id: string;
916
+ organizationId: string;
917
+ agentId: string;
918
+ botAppId: string | null;
919
+ teamsAppId: string;
920
+ tenantId: string;
921
+ displayName: string;
922
+ manifestVersion: number;
923
+ status: "awaiting_setup" | "connected" | "needs_reconnect";
924
+ createdBy: string | null;
925
+ createdAt: string;
926
+ lastRefusedAt: string | null;
927
+ lastRefusedReason: string | null;
928
+ certificate: import("./schema.js").components["schemas"]["CertificateInfo"] | null;
929
+ nextCertificate: import("./schema.js").components["schemas"]["CertificateInfo"] | null;
930
+ madeByService: boolean;
931
+ publishedVersion: string | null;
932
+ packageVersion: string;
933
+ messagingEndpoint: string | null;
934
+ mcpUrl: string | null;
935
+ installedIn: import("./schema.js").components["schemas"]["TeamsPlace"][];
936
+ }[]>;
937
+ createTeamsBot: (o: string, id: string, displayName: string, by: string) => Promise<{
938
+ id: string;
939
+ organizationId: string;
940
+ agentId: string;
941
+ botAppId: string | null;
942
+ teamsAppId: string;
943
+ tenantId: string;
944
+ displayName: string;
945
+ manifestVersion: number;
946
+ status: "awaiting_setup" | "connected" | "needs_reconnect";
947
+ createdBy: string | null;
948
+ createdAt: string;
949
+ lastRefusedAt: string | null;
950
+ lastRefusedReason: string | null;
951
+ certificate: import("./schema.js").components["schemas"]["CertificateInfo"] | null;
952
+ nextCertificate: import("./schema.js").components["schemas"]["CertificateInfo"] | null;
953
+ madeByService: boolean;
954
+ publishedVersion: string | null;
955
+ packageVersion: string;
956
+ }>;
957
+ /** Proves the application ID the setup script printed by signing in as it. */
958
+ connectTeamsBot: (o: string, id: string, botAppId: string, by: string) => Promise<{
959
+ id: string;
960
+ organizationId: string;
961
+ agentId: string;
962
+ botAppId: string | null;
963
+ teamsAppId: string;
964
+ tenantId: string;
965
+ displayName: string;
966
+ manifestVersion: number;
967
+ status: "awaiting_setup" | "connected" | "needs_reconnect";
968
+ createdBy: string | null;
969
+ createdAt: string;
970
+ lastRefusedAt: string | null;
971
+ lastRefusedReason: string | null;
972
+ certificate: import("./schema.js").components["schemas"]["CertificateInfo"] | null;
973
+ nextCertificate: import("./schema.js").components["schemas"]["CertificateInfo"] | null;
974
+ madeByService: boolean;
975
+ publishedVersion: string | null;
976
+ packageVersion: string;
977
+ }>;
978
+ checkTeamsBot: (o: string, id: string) => Promise<{
979
+ ok: true;
980
+ } | {
981
+ ok: false;
982
+ error: string;
983
+ }>;
984
+ teamsTest: (o: string, id: string, conversationId: string, by: string) => Promise<{
985
+ ok: true;
986
+ }>;
987
+ /** Forgets the bot. What Add to Teams made is deleted (`failed`: what could not be);
988
+ * `removal` is the commands for the rest. */
989
+ removeTeamsBot: (o: string, id: string, by: string) => Promise<{
990
+ removal: string;
991
+ failed: string[];
992
+ }>;
993
+ newTeamsCertificate: (o: string, id: string, by: string) => Promise<{
994
+ bot: import("./schema.js").components["schemas"]["TeamsBotRecord"];
995
+ command: string | null;
996
+ certificate: string;
997
+ }>;
998
+ activateTeamsCertificate: (o: string, id: string, by: string) => Promise<{
999
+ id: string;
1000
+ organizationId: string;
1001
+ agentId: string;
1002
+ botAppId: string | null;
1003
+ teamsAppId: string;
1004
+ tenantId: string;
1005
+ displayName: string;
1006
+ manifestVersion: number;
1007
+ status: "awaiting_setup" | "connected" | "needs_reconnect";
1008
+ createdBy: string | null;
1009
+ createdAt: string;
1010
+ lastRefusedAt: string | null;
1011
+ lastRefusedReason: string | null;
1012
+ certificate: import("./schema.js").components["schemas"]["CertificateInfo"] | null;
1013
+ nextCertificate: import("./schema.js").components["schemas"]["CertificateInfo"] | null;
1014
+ madeByService: boolean;
1015
+ publishedVersion: string | null;
1016
+ packageVersion: string;
1017
+ }>;
1018
+ /** The Teams page's set-up-once steps, checked live. */
1019
+ teamsSetupState: (o: string) => Promise<{
1020
+ [key: string]: {
1021
+ state: "done" | "failing" | "todo";
1022
+ message: string;
1023
+ };
1024
+ }>;
1025
+ /** Makes the agent's bot in the tenant, each part only if missing. */
1026
+ addToTeams: (o: string, id: string, displayName: string, by: string) => Promise<{
1027
+ steps: import("./schema.js").components["schemas"]["AddStep"][];
1028
+ bot: import("./schema.js").components["schemas"]["TeamsBotRecord"];
1029
+ }>;
1030
+ startTeamsPublish: (o: string, id: string, redirectUri: string) => Promise<{
1031
+ url: string;
1032
+ nonce: string;
1033
+ }>;
1034
+ finishTeamsPublish: (o: string, body: {
1035
+ state: string;
1036
+ nonce: string;
1037
+ params: Record<string, string>;
1038
+ by: string;
1039
+ }) => Promise<{
1040
+ agentId: string;
1041
+ version: string;
1042
+ changed: boolean;
1043
+ }>;
1044
+ teamsTargets: (o: string, id: string, kind: "team" | "person", q: string) => Promise<{
1045
+ id: string;
1046
+ name: string;
1047
+ detail: string | null;
1048
+ }[]>;
1049
+ installTeamsBot: (o: string, id: string, kind: "team" | "chat" | "person", target: string, by: string) => Promise<{
1050
+ result: "added" | "already";
1051
+ }>;
1052
+ /** A file the service makes (the setup script, certificate or Teams app package), as is. */
1053
+ teamsFile: (o: string, id: string, file: "kit" | "package" | "certificate") => Promise<Response>;
1054
+ teamsTrigger: (o: string, id: string) => Promise<{
1055
+ agentId: string;
1056
+ enabled: boolean;
1057
+ runner: string;
1058
+ settings: {
1059
+ [key: string]: unknown;
1060
+ };
1061
+ hasSigningSecret: boolean;
1062
+ managedAgentId: string | null;
1063
+ environmentId: string | null;
1064
+ vaultIds: string[];
1065
+ budgetCents: number;
1066
+ maxRunsPerHour: number;
1067
+ maxCentsPerDay: number;
1068
+ maxConcurrent: number;
1069
+ replyMode: "mentions" | "all";
1070
+ allowedTeams: string[];
1071
+ allowedPeople: string[];
1072
+ anyoneInOrganization: boolean;
1073
+ updatedBy: string | null;
1074
+ updatedAt: string;
1075
+ } | null>;
1076
+ setTeamsTrigger: (o: string, id: string, body: TeamsTriggerInput) => Promise<{
1077
+ agentId: string;
1078
+ enabled: boolean;
1079
+ runner: string;
1080
+ settings: {
1081
+ [key: string]: unknown;
1082
+ };
1083
+ hasSigningSecret: boolean;
1084
+ managedAgentId: string | null;
1085
+ environmentId: string | null;
1086
+ vaultIds: string[];
1087
+ budgetCents: number;
1088
+ maxRunsPerHour: number;
1089
+ maxCentsPerDay: number;
1090
+ maxConcurrent: number;
1091
+ replyMode: "mentions" | "all";
1092
+ allowedTeams: string[];
1093
+ allowedPeople: string[];
1094
+ anyoneInOrganization: boolean;
1095
+ updatedBy: string | null;
1096
+ updatedAt: string;
1097
+ }>;
1098
+ teamsRuns: (o: string, id: string, limit?: number) => Promise<{
1099
+ id: string;
1100
+ agentId: string;
1101
+ botId: string;
1102
+ conversationId: string;
1103
+ threadId: string;
1104
+ triggerActivityId: string;
1105
+ runner: string;
1106
+ sessionId: string | null;
1107
+ state: "starting" | "running" | "idle" | "ended" | "failed" | "no_reply";
1108
+ error: string | null;
1109
+ note: string | null;
1110
+ requestedBy: string | null;
1111
+ replyCount: number;
1112
+ repliedAt: string | null;
1113
+ costCents: number | null;
1114
+ turns: number;
1115
+ startedAt: string;
1116
+ finishedAt: string | null;
1117
+ replyTokenAt: string;
1118
+ }[]>;
1119
+ eventSubscriptions: (o: string) => Promise<{
1120
+ id: string;
1121
+ connectorId: string;
1122
+ source: "webhook" | "poll";
1123
+ filter: string;
1124
+ intervalSeconds: number;
1125
+ cursor: string | null;
1126
+ polledAt: string | null;
1127
+ lastError: string | null;
1128
+ registered: string | null;
1129
+ url: string | null;
1130
+ createdBy: string;
1131
+ createdAt: string;
1132
+ }[]>;
1133
+ subscribeEvents: (o: string, body: EventSubscriptionInput) => Promise<{
1134
+ subscription: import("./schema.js").components["schemas"]["EventSubscription"];
1135
+ secret: string | null;
1136
+ setup: {
1137
+ title: string;
1138
+ body: string;
1139
+ link?: {
1140
+ label: string;
1141
+ href: string;
1142
+ };
1143
+ copy?: string[];
1144
+ shell?: "bash" | "powershell";
1145
+ permissions?: boolean;
1146
+ certificate?: boolean;
1147
+ click?: string[];
1148
+ clickUnavailable?: true;
1149
+ siteRole?: "read" | "write";
1150
+ agentCheck?: boolean;
1151
+ confirm?: string;
1152
+ live?: string;
1153
+ settings?: {
1154
+ id: string;
1155
+ label: string;
1156
+ help?: string;
1157
+ placeholder?: string;
1158
+ pattern: string;
1159
+ }[];
1160
+ option?: {
1161
+ field: string;
1162
+ value: string;
1163
+ };
1164
+ }[];
1165
+ registration: {
1166
+ ok: boolean;
1167
+ message: string;
1168
+ } | null;
1169
+ }>;
1170
+ rotateEventSecret: (o: string, id: string, by: string) => Promise<{
1171
+ subscription: import("./schema.js").components["schemas"]["EventSubscription"];
1172
+ secret: string;
1173
+ }>;
1174
+ unsubscribeEvents: (o: string, id: string, by: string) => Promise<void>;
1175
+ eventTriggers: (o: string, id: string) => Promise<{
1176
+ id: string;
1177
+ agentId: string;
1178
+ connectorId: string;
1179
+ enabled: boolean;
1180
+ eventTypes: string[];
1181
+ conditions: ({
1182
+ field: string;
1183
+ in: string[];
1184
+ } | {
1185
+ field: string;
1186
+ notIn: string[];
1187
+ })[];
1188
+ prompt: string;
1189
+ runner: string;
1190
+ settings: {
1191
+ [key: string]: unknown;
1192
+ };
1193
+ hasSigningSecret: boolean;
1194
+ managedAgentId: string | null;
1195
+ environmentId: string | null;
1196
+ vaultIds: string[];
1197
+ budgetCents: number;
1198
+ maxRunsPerHour: number;
1199
+ maxCentsPerDay: number;
1200
+ maxConcurrent: number;
1201
+ updatedBy: string | null;
1202
+ updatedAt: string;
1203
+ }[]>;
1204
+ setEventTrigger: (o: string, id: string, a: string, body: EventTriggerInput) => Promise<{
1205
+ id: string;
1206
+ agentId: string;
1207
+ connectorId: string;
1208
+ enabled: boolean;
1209
+ eventTypes: string[];
1210
+ conditions: ({
1211
+ field: string;
1212
+ in: string[];
1213
+ } | {
1214
+ field: string;
1215
+ notIn: string[];
1216
+ })[];
1217
+ prompt: string;
1218
+ runner: string;
1219
+ settings: {
1220
+ [key: string]: unknown;
1221
+ };
1222
+ hasSigningSecret: boolean;
1223
+ managedAgentId: string | null;
1224
+ environmentId: string | null;
1225
+ vaultIds: string[];
1226
+ budgetCents: number;
1227
+ maxRunsPerHour: number;
1228
+ maxCentsPerDay: number;
1229
+ maxConcurrent: number;
1230
+ updatedBy: string | null;
1231
+ updatedAt: string;
1232
+ }>;
1233
+ removeEventTrigger: (o: string, id: string, a: string, by: string) => Promise<void>;
1234
+ eventRuns: (o: string, id: string, limit?: number) => Promise<{
1235
+ id: string;
1236
+ agentId: string;
1237
+ triggerId: string;
1238
+ connectorId: string;
1239
+ eventType: string;
1240
+ deliveryId: string;
1241
+ runner: string;
1242
+ sessionId: string | null;
1243
+ state: "starting" | "running" | "ended" | "failed";
1244
+ error: string | null;
1245
+ costCents: number | null;
1246
+ startedAt: string;
1247
+ finishedAt: string | null;
1248
+ }[]>;
1249
+ claudeKey: (o: string) => Promise<{
1250
+ set: false;
1251
+ } | {
1252
+ set: true;
1253
+ ending: string;
1254
+ by: string | null;
1255
+ at: string;
1256
+ }>;
1257
+ setClaudeKey: (o: string, apiKey: string, by: string) => Promise<{
1258
+ set: true;
1259
+ ending: string;
1260
+ by: string | null;
1261
+ at: string;
1262
+ agents: import("./schema.js").components["schemas"]["ClaudeAgent"][];
1263
+ }>;
1264
+ removeClaudeKey: (o: string, by: string) => Promise<void>;
1265
+ claudeAgents: (o: string) => Promise<{
1266
+ id: string;
1267
+ name: string;
1268
+ }[]>;
1269
+ };