@arbium/enterprise-agent-connect-client 0.0.0-stage → 0.1.1

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,834 @@
1
+ import { type AppLive } from "./steps.js";
2
+ import type { Agent, CheckOutcome, Connection, Connector, 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
+ } | {
284
+ type: "bearer";
285
+ token: string;
286
+ } | {
287
+ type: "basic";
288
+ username: string;
289
+ password: string;
290
+ } | {
291
+ type: "oauth2";
292
+ tokenUrl: string;
293
+ clientId: string;
294
+ clientSecret: string;
295
+ };
296
+ tools: {
297
+ name: string;
298
+ description: string;
299
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
300
+ path: string;
301
+ params: {
302
+ [key: string]: {
303
+ type: "string" | "number" | "integer" | "boolean";
304
+ description: string;
305
+ in: "path" | "query" | "body";
306
+ required: boolean;
307
+ limit?: string;
308
+ };
309
+ };
310
+ destructive: boolean;
311
+ answerLimits: {
312
+ field: string;
313
+ limit: string;
314
+ }[];
315
+ }[];
316
+ allowInsecureHttp: boolean;
317
+ };
318
+ }[]>;
319
+ providers: () => Promise<{
320
+ id: string;
321
+ name: string;
322
+ logo: string;
323
+ identity: string;
324
+ sharedIdentity?: string;
325
+ accountKey: string;
326
+ principalKeys: string[];
327
+ certificate: boolean;
328
+ setup: {
329
+ title: string;
330
+ body: string;
331
+ link?: {
332
+ label: string;
333
+ href: string;
334
+ };
335
+ copy?: string[];
336
+ shell?: "bash" | "powershell";
337
+ permissions?: boolean;
338
+ certificate?: boolean;
339
+ click?: string[];
340
+ clickUnavailable?: true;
341
+ siteRole?: "read" | "write";
342
+ agentCheck?: boolean;
343
+ confirm?: string;
344
+ live?: string;
345
+ settings?: {
346
+ id: string;
347
+ label: string;
348
+ help?: string;
349
+ placeholder?: string;
350
+ pattern: string;
351
+ }[];
352
+ option?: {
353
+ field: string;
354
+ value: string;
355
+ };
356
+ }[];
357
+ fields: {
358
+ id: string;
359
+ label: string;
360
+ help?: string;
361
+ placeholder?: string;
362
+ secret: boolean;
363
+ options?: {
364
+ value: string;
365
+ label: string;
366
+ description: string;
367
+ scopes?: string[];
368
+ }[];
369
+ requires?: {
370
+ field: string;
371
+ value: string;
372
+ };
373
+ optional: boolean;
374
+ }[];
375
+ addAgent: {
376
+ title: string;
377
+ body: string;
378
+ link?: {
379
+ label: string;
380
+ href: string;
381
+ };
382
+ copy?: string[];
383
+ shell?: "bash" | "powershell";
384
+ permissions?: boolean;
385
+ certificate?: boolean;
386
+ click?: string[];
387
+ clickUnavailable?: true;
388
+ siteRole?: "read" | "write";
389
+ agentCheck?: boolean;
390
+ confirm?: string;
391
+ live?: string;
392
+ settings?: {
393
+ id: string;
394
+ label: string;
395
+ help?: string;
396
+ placeholder?: string;
397
+ pattern: string;
398
+ }[];
399
+ option?: {
400
+ field: string;
401
+ value: string;
402
+ };
403
+ apps: string[];
404
+ }[];
405
+ revoke: string;
406
+ approval: boolean;
407
+ }[]>;
408
+ providerConnections: (o: string) => Promise<{
409
+ id: string;
410
+ organizationId: string;
411
+ provider: string;
412
+ status: "pending" | "connected" | "needs_reconnect";
413
+ config: {
414
+ [key: string]: string;
415
+ };
416
+ accountLabel: string | null;
417
+ connectedBy: string | null;
418
+ connectedAt: string;
419
+ checkedAt: string;
420
+ certificate: import("./schema.js").components["schemas"]["CertificateInfo"] | null;
421
+ nextCertificate: import("./schema.js").components["schemas"]["CertificateInfo"] | null;
422
+ apps: string[];
423
+ }[]>;
424
+ connectProvider: (o: string, p: string, body: {
425
+ fields: Record<string, string>;
426
+ connectedBy: string;
427
+ }) => Promise<{
428
+ id: string;
429
+ organizationId: string;
430
+ provider: string;
431
+ status: "pending" | "connected" | "needs_reconnect";
432
+ config: {
433
+ [key: string]: string;
434
+ };
435
+ accountLabel: string | null;
436
+ connectedBy: string | null;
437
+ connectedAt: string;
438
+ checkedAt: string;
439
+ certificate: import("./schema.js").components["schemas"]["CertificateInfo"] | null;
440
+ nextCertificate: import("./schema.js").components["schemas"]["CertificateInfo"] | null;
441
+ apps: string[];
442
+ }>;
443
+ checkProvider: (o: string, p: string) => Promise<{
444
+ ok: true;
445
+ } | {
446
+ ok: false;
447
+ error: string;
448
+ }>;
449
+ /** Before connecting, the certificate to upload; after, one to rotate to. */
450
+ newCertificate: (o: string, p: string, by: string) => Promise<{
451
+ id: string;
452
+ organizationId: string;
453
+ provider: string;
454
+ status: "pending" | "connected" | "needs_reconnect";
455
+ config: {
456
+ [key: string]: string;
457
+ };
458
+ accountLabel: string | null;
459
+ connectedBy: string | null;
460
+ connectedAt: string;
461
+ checkedAt: string;
462
+ certificate: import("./schema.js").components["schemas"]["CertificateInfo"] | null;
463
+ nextCertificate: import("./schema.js").components["schemas"]["CertificateInfo"] | null;
464
+ apps: string[];
465
+ }>;
466
+ /** Signs in with the new certificate and, if that works, switches to it. */
467
+ activateCertificate: (o: string, p: string, by: string) => Promise<{
468
+ id: string;
469
+ organizationId: string;
470
+ provider: string;
471
+ status: "pending" | "connected" | "needs_reconnect";
472
+ config: {
473
+ [key: string]: string;
474
+ };
475
+ accountLabel: string | null;
476
+ connectedBy: string | null;
477
+ connectedAt: string;
478
+ checkedAt: string;
479
+ certificate: import("./schema.js").components["schemas"]["CertificateInfo"] | null;
480
+ nextCertificate: import("./schema.js").components["schemas"]["CertificateInfo"] | null;
481
+ apps: string[];
482
+ }>;
483
+ /** Disconnects the provider and every app signing in through it. */
484
+ disconnectProvider: (o: string, p: string, by: string) => Promise<void>;
485
+ /** Values an app's steps ask for, kept on the provider connection. */
486
+ setProviderSettings: (o: string, p: string, values: Record<string, string>, by: string) => Promise<{
487
+ settings: {
488
+ [key: string]: string;
489
+ };
490
+ }>;
491
+ connections: (o: string) => Promise<{
492
+ id: string;
493
+ organizationId: string;
494
+ connectorId: string;
495
+ providerId: string | null;
496
+ capabilities: string[];
497
+ config: {
498
+ [key: string]: string;
499
+ };
500
+ status: "connected" | "needs_reconnect";
501
+ accountLabel: string | null;
502
+ connectedBy: string | null;
503
+ connectedAt: string;
504
+ checkedAt: string;
505
+ }[]>;
506
+ connect: (o: string, a: string, body: {
507
+ capabilities: string[];
508
+ fields: Record<string, string>;
509
+ connectedBy: string;
510
+ }) => Promise<{
511
+ connection: import("./schema.js").components["schemas"]["Connection"];
512
+ checks: import("./schema.js").components["schemas"]["Check"][];
513
+ }>;
514
+ startConsent: (o: string, a: string, body: {
515
+ capabilities: string[];
516
+ redirectUri: string;
517
+ }) => Promise<{
518
+ url: string;
519
+ nonce: string;
520
+ }>;
521
+ /** `redirect`: the approval came back; the admin signs in to that organization next.
522
+ * `provider`: the approval connected the provider; the app still needs its own settings. */
523
+ finishConsent: (o: string, a: string, body: {
524
+ state: string;
525
+ nonce: string;
526
+ params: Record<string, string>;
527
+ connectedBy: string;
528
+ }) => Promise<{
529
+ connection: import("./schema.js").components["schemas"]["Connection"];
530
+ checks: import("./schema.js").components["schemas"]["Check"][];
531
+ } | {
532
+ redirect: string;
533
+ } | {
534
+ provider: import("./schema.js").components["schemas"]["ProviderConnection"];
535
+ }>;
536
+ setCeiling: (o: string, a: string, capabilities: string[], by: string) => Promise<void>;
537
+ /** Recorded: a failure marks the app as needing reconnecting, so it names the admin. */
538
+ check: (o: string, a: string, by: string) => Promise<{
539
+ ok: true;
540
+ checks: import("./schema.js").components["schemas"]["Check"][];
541
+ } | {
542
+ ok: false;
543
+ error: string;
544
+ }>;
545
+ /** The same checks, read only: a failure here does not mark the app. */
546
+ peek: (o: string, a: string) => Promise<{
547
+ ok: true;
548
+ checks: import("./schema.js").components["schemas"]["Check"][];
549
+ } | {
550
+ ok: false;
551
+ error: string;
552
+ }>;
553
+ /** The sites added to an app, the whole list at once. */
554
+ setSites: (o: string, a: string, sites: string[], by: string) => Promise<{
555
+ sites: string[];
556
+ }>;
557
+ /** Whether the app can open each added site, or just `site`. */
558
+ checkSites: (o: string, a: string, site?: string) => Promise<{
559
+ sites: import("./schema.js").components["schemas"]["SiteAccess"][];
560
+ }>;
561
+ /** Whether the app can reach one agent's own address (its mailbox) yet. */
562
+ agentAccess: (o: string, a: string, value: string, by: string) => Promise<{
563
+ value: string;
564
+ status: "granted" | "not_granted" | "not_found" | "failed";
565
+ message: string;
566
+ }>;
567
+ disconnect: (o: string, a: string, by: string) => Promise<void>;
568
+ agents: (o: string) => Promise<{
569
+ id: string;
570
+ organizationId: string;
571
+ name: string;
572
+ status: "active" | "disabled";
573
+ createdBy: string | null;
574
+ createdAt: string;
575
+ lastUsedAt: string | null;
576
+ grants: import("./schema.js").components["schemas"]["Grant"][];
577
+ }[]>;
578
+ createAgent: (o: string, body: {
579
+ name: string;
580
+ createdBy: string;
581
+ }) => Promise<{
582
+ agent: import("./schema.js").components["schemas"]["NewAgent"];
583
+ key: string;
584
+ }>;
585
+ setAgentStatus: (o: string, id: string, status: Agent["status"], by: string) => Promise<void>;
586
+ newKey: (o: string, id: string, by: string) => Promise<{
587
+ key: string;
588
+ }>;
589
+ deleteAgent: (o: string, id: string, by: string) => Promise<void>;
590
+ setGrant: (o: string, id: string, a: string, capabilities: string[], limits: Limits, by: string) => Promise<void>;
591
+ removeGrant: (o: string, id: string, a: string, by: string) => Promise<void>;
592
+ /** Recent requests, newest first, of one key (`agent`), one app, or both. */
593
+ audit: (o: string, filter: {
594
+ agent?: string;
595
+ app?: string;
596
+ }, limit?: number) => Promise<{
597
+ at: string;
598
+ agentId: string | null;
599
+ agentName: string | null;
600
+ connectorId: string;
601
+ tool: string;
602
+ target: string | null;
603
+ decision: "allowed" | "denied" | "failed";
604
+ reason: string | null;
605
+ vendorStatus: number | null;
606
+ }[]>;
607
+ confirmed: (o: string) => Promise<string[]>;
608
+ setConfirmed: (o: string, step: string, on: boolean, by: string) => Promise<void>;
609
+ teamsBots: (o: string) => Promise<{
610
+ id: string;
611
+ organizationId: string;
612
+ agentId: string;
613
+ botAppId: string | null;
614
+ teamsAppId: string;
615
+ tenantId: string;
616
+ displayName: string;
617
+ manifestVersion: number;
618
+ status: "awaiting_setup" | "connected" | "needs_reconnect";
619
+ createdBy: string | null;
620
+ createdAt: string;
621
+ lastRefusedAt: string | null;
622
+ lastRefusedReason: string | null;
623
+ certificate: import("./schema.js").components["schemas"]["CertificateInfo"] | null;
624
+ nextCertificate: import("./schema.js").components["schemas"]["CertificateInfo"] | null;
625
+ madeByService: boolean;
626
+ publishedVersion: string | null;
627
+ packageVersion: string;
628
+ messagingEndpoint: string | null;
629
+ mcpUrl: string | null;
630
+ installedIn: import("./schema.js").components["schemas"]["TeamsPlace"][];
631
+ }[]>;
632
+ createTeamsBot: (o: string, id: string, displayName: string, by: string) => Promise<{
633
+ id: string;
634
+ organizationId: string;
635
+ agentId: string;
636
+ botAppId: string | null;
637
+ teamsAppId: string;
638
+ tenantId: string;
639
+ displayName: string;
640
+ manifestVersion: number;
641
+ status: "awaiting_setup" | "connected" | "needs_reconnect";
642
+ createdBy: string | null;
643
+ createdAt: string;
644
+ lastRefusedAt: string | null;
645
+ lastRefusedReason: string | null;
646
+ certificate: import("./schema.js").components["schemas"]["CertificateInfo"] | null;
647
+ nextCertificate: import("./schema.js").components["schemas"]["CertificateInfo"] | null;
648
+ madeByService: boolean;
649
+ publishedVersion: string | null;
650
+ packageVersion: string;
651
+ }>;
652
+ /** Proves the application ID the setup script printed by signing in as it. */
653
+ connectTeamsBot: (o: string, id: string, botAppId: string, by: string) => Promise<{
654
+ id: string;
655
+ organizationId: string;
656
+ agentId: string;
657
+ botAppId: string | null;
658
+ teamsAppId: string;
659
+ tenantId: string;
660
+ displayName: string;
661
+ manifestVersion: number;
662
+ status: "awaiting_setup" | "connected" | "needs_reconnect";
663
+ createdBy: string | null;
664
+ createdAt: string;
665
+ lastRefusedAt: string | null;
666
+ lastRefusedReason: string | null;
667
+ certificate: import("./schema.js").components["schemas"]["CertificateInfo"] | null;
668
+ nextCertificate: import("./schema.js").components["schemas"]["CertificateInfo"] | null;
669
+ madeByService: boolean;
670
+ publishedVersion: string | null;
671
+ packageVersion: string;
672
+ }>;
673
+ checkTeamsBot: (o: string, id: string) => Promise<{
674
+ ok: true;
675
+ } | {
676
+ ok: false;
677
+ error: string;
678
+ }>;
679
+ teamsTest: (o: string, id: string, conversationId: string, by: string) => Promise<{
680
+ ok: true;
681
+ }>;
682
+ /** Forgets the bot. What Add to Teams made is deleted (`failed`: what could not be);
683
+ * `removal` is the commands for the rest. */
684
+ removeTeamsBot: (o: string, id: string, by: string) => Promise<{
685
+ removal: string;
686
+ failed: string[];
687
+ }>;
688
+ newTeamsCertificate: (o: string, id: string, by: string) => Promise<{
689
+ bot: import("./schema.js").components["schemas"]["TeamsBotRecord"];
690
+ command: string | null;
691
+ certificate: string;
692
+ }>;
693
+ activateTeamsCertificate: (o: string, id: string, by: string) => Promise<{
694
+ id: string;
695
+ organizationId: string;
696
+ agentId: string;
697
+ botAppId: string | null;
698
+ teamsAppId: string;
699
+ tenantId: string;
700
+ displayName: string;
701
+ manifestVersion: number;
702
+ status: "awaiting_setup" | "connected" | "needs_reconnect";
703
+ createdBy: string | null;
704
+ createdAt: string;
705
+ lastRefusedAt: string | null;
706
+ lastRefusedReason: string | null;
707
+ certificate: import("./schema.js").components["schemas"]["CertificateInfo"] | null;
708
+ nextCertificate: import("./schema.js").components["schemas"]["CertificateInfo"] | null;
709
+ madeByService: boolean;
710
+ publishedVersion: string | null;
711
+ packageVersion: string;
712
+ }>;
713
+ /** The Teams page's set-up-once steps, checked live. */
714
+ teamsSetupState: (o: string) => Promise<{
715
+ [key: string]: {
716
+ state: "done" | "failing" | "todo";
717
+ message: string;
718
+ };
719
+ }>;
720
+ /** Makes the agent's bot in the tenant, each part only if missing. */
721
+ addToTeams: (o: string, id: string, displayName: string, by: string) => Promise<{
722
+ steps: import("./schema.js").components["schemas"]["AddStep"][];
723
+ bot: import("./schema.js").components["schemas"]["TeamsBotRecord"];
724
+ }>;
725
+ startTeamsPublish: (o: string, id: string, redirectUri: string) => Promise<{
726
+ url: string;
727
+ nonce: string;
728
+ }>;
729
+ finishTeamsPublish: (o: string, body: {
730
+ state: string;
731
+ nonce: string;
732
+ params: Record<string, string>;
733
+ by: string;
734
+ }) => Promise<{
735
+ agentId: string;
736
+ version: string;
737
+ changed: boolean;
738
+ }>;
739
+ teamsTargets: (o: string, id: string, kind: "team" | "person", q: string) => Promise<{
740
+ id: string;
741
+ name: string;
742
+ detail: string | null;
743
+ }[]>;
744
+ installTeamsBot: (o: string, id: string, kind: "team" | "chat" | "person", target: string, by: string) => Promise<{
745
+ result: "added" | "already";
746
+ }>;
747
+ /** A file the service makes (the setup script, certificate or Teams app package), as is. */
748
+ teamsFile: (o: string, id: string, file: "kit" | "package" | "certificate") => Promise<Response>;
749
+ teamsTrigger: (o: string, id: string) => Promise<{
750
+ agentId: string;
751
+ enabled: boolean;
752
+ runner: string;
753
+ settings: {
754
+ [key: string]: unknown;
755
+ };
756
+ hasSigningSecret: boolean;
757
+ managedAgentId: string | null;
758
+ environmentId: string | null;
759
+ vaultIds: string[];
760
+ budgetCents: number;
761
+ maxRunsPerHour: number;
762
+ maxCentsPerDay: number;
763
+ maxConcurrent: number;
764
+ replyMode: "mentions" | "all";
765
+ allowedTeams: string[];
766
+ allowedPeople: string[];
767
+ anyoneInOrganization: boolean;
768
+ updatedBy: string | null;
769
+ updatedAt: string;
770
+ } | null>;
771
+ setTeamsTrigger: (o: string, id: string, body: TeamsTriggerInput) => Promise<{
772
+ agentId: string;
773
+ enabled: boolean;
774
+ runner: string;
775
+ settings: {
776
+ [key: string]: unknown;
777
+ };
778
+ hasSigningSecret: boolean;
779
+ managedAgentId: string | null;
780
+ environmentId: string | null;
781
+ vaultIds: string[];
782
+ budgetCents: number;
783
+ maxRunsPerHour: number;
784
+ maxCentsPerDay: number;
785
+ maxConcurrent: number;
786
+ replyMode: "mentions" | "all";
787
+ allowedTeams: string[];
788
+ allowedPeople: string[];
789
+ anyoneInOrganization: boolean;
790
+ updatedBy: string | null;
791
+ updatedAt: string;
792
+ }>;
793
+ teamsRuns: (o: string, id: string, limit?: number) => Promise<{
794
+ id: string;
795
+ agentId: string;
796
+ botId: string;
797
+ conversationId: string;
798
+ threadId: string;
799
+ triggerActivityId: string;
800
+ runner: string;
801
+ sessionId: string | null;
802
+ state: "starting" | "running" | "idle" | "ended" | "failed" | "no_reply";
803
+ error: string | null;
804
+ note: string | null;
805
+ requestedBy: string | null;
806
+ replyCount: number;
807
+ repliedAt: string | null;
808
+ costCents: number | null;
809
+ turns: number;
810
+ startedAt: string;
811
+ finishedAt: string | null;
812
+ replyTokenAt: string;
813
+ }[]>;
814
+ claudeKey: (o: string) => Promise<{
815
+ set: false;
816
+ } | {
817
+ set: true;
818
+ ending: string;
819
+ by: string | null;
820
+ at: string;
821
+ }>;
822
+ setClaudeKey: (o: string, apiKey: string, by: string) => Promise<{
823
+ set: true;
824
+ ending: string;
825
+ by: string | null;
826
+ at: string;
827
+ agents: import("./schema.js").components["schemas"]["ClaudeAgent"][];
828
+ }>;
829
+ removeClaudeKey: (o: string, by: string) => Promise<void>;
830
+ claudeAgents: (o: string) => Promise<{
831
+ id: string;
832
+ name: string;
833
+ }[]>;
834
+ };