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

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