@arbium/enterprise-agent-connect 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/LICENSE +202 -0
- package/README.md +117 -2
- package/dist/connectors/dell-techdirect/connector.json +39 -0
- package/dist/connectors/dell-techdirect/index.js +7 -0
- package/dist/connectors/dell-techdirect/index.js.map +1 -0
- package/dist/connectors/dell-techdirect/tools.js +49 -0
- package/dist/connectors/dell-techdirect/tools.js.map +1 -0
- package/dist/connectors/dell-techdirect/vendor.js +57 -0
- package/dist/connectors/dell-techdirect/vendor.js.map +1 -0
- package/dist/connectors/entra/connector.json +85 -0
- package/dist/connectors/entra/index.js +4 -0
- package/dist/connectors/entra/index.js.map +1 -0
- package/dist/connectors/entra/tools.js +262 -0
- package/dist/connectors/entra/tools.js.map +1 -0
- package/dist/connectors/fedex/connector.json +118 -0
- package/dist/connectors/fedex/index.js +7 -0
- package/dist/connectors/fedex/index.js.map +1 -0
- package/dist/connectors/fedex/tools.js +152 -0
- package/dist/connectors/fedex/tools.js.map +1 -0
- package/dist/connectors/fedex/vendor.js +98 -0
- package/dist/connectors/fedex/vendor.js.map +1 -0
- package/dist/connectors/http/index.js +235 -0
- package/dist/connectors/http/index.js.map +1 -0
- package/dist/connectors/intune/connector.json +106 -0
- package/dist/connectors/intune/index.js +4 -0
- package/dist/connectors/intune/index.js.map +1 -0
- package/dist/connectors/intune/tools.js +416 -0
- package/dist/connectors/intune/tools.js.map +1 -0
- package/dist/connectors/jira/connector.json +129 -0
- package/dist/connectors/jira/index.js +7 -0
- package/dist/connectors/jira/index.js.map +1 -0
- package/dist/connectors/jira/jql.js +67 -0
- package/dist/connectors/jira/jql.js.map +1 -0
- package/dist/connectors/jira/tools.js +464 -0
- package/dist/connectors/jira/tools.js.map +1 -0
- package/dist/connectors/jira/vendor.js +94 -0
- package/dist/connectors/jira/vendor.js.map +1 -0
- package/dist/connectors/microsoft/client.js +434 -0
- package/dist/connectors/microsoft/client.js.map +1 -0
- package/dist/connectors/microsoft/provider.json +118 -0
- package/dist/connectors/outlook-calendar/connector.json +136 -0
- package/dist/connectors/outlook-calendar/index.js +4 -0
- package/dist/connectors/outlook-calendar/index.js.map +1 -0
- package/dist/connectors/outlook-calendar/tools.js +398 -0
- package/dist/connectors/outlook-calendar/tools.js.map +1 -0
- package/dist/connectors/outlook-mail/connector.json +154 -0
- package/dist/connectors/outlook-mail/index.js +4 -0
- package/dist/connectors/outlook-mail/index.js.map +1 -0
- package/dist/connectors/outlook-mail/tools.js +236 -0
- package/dist/connectors/outlook-mail/tools.js.map +1 -0
- package/dist/connectors/salesforce/connector.json +122 -0
- package/dist/connectors/salesforce/index.js +7 -0
- package/dist/connectors/salesforce/index.js.map +1 -0
- package/dist/connectors/salesforce/soql.js +60 -0
- package/dist/connectors/salesforce/soql.js.map +1 -0
- package/dist/connectors/salesforce/tools.js +234 -0
- package/dist/connectors/salesforce/tools.js.map +1 -0
- package/dist/connectors/salesforce/vendor.js +107 -0
- package/dist/connectors/salesforce/vendor.js.map +1 -0
- package/dist/connectors/sharepoint-files/connector.json +194 -0
- package/dist/connectors/sharepoint-files/excel.js +300 -0
- package/dist/connectors/sharepoint-files/excel.js.map +1 -0
- package/dist/connectors/sharepoint-files/index.js +12 -0
- package/dist/connectors/sharepoint-files/index.js.map +1 -0
- package/dist/connectors/sharepoint-files/tools.js +365 -0
- package/dist/connectors/sharepoint-files/tools.js.map +1 -0
- package/dist/connectors/sharepoint-files/vendor.js +167 -0
- package/dist/connectors/sharepoint-files/vendor.js.map +1 -0
- package/dist/connectors/teams/connector.json +298 -0
- package/dist/connectors/teams/index.js +5 -0
- package/dist/connectors/teams/index.js.map +1 -0
- package/dist/connectors/teams/tools.js +391 -0
- package/dist/connectors/teams/tools.js.map +1 -0
- package/dist/packages/connector-kit/src/branding.js +102 -0
- package/dist/packages/connector-kit/src/branding.js.map +1 -0
- package/dist/packages/connector-kit/src/certificate.js +84 -0
- package/dist/packages/connector-kit/src/certificate.js.map +1 -0
- package/dist/packages/connector-kit/src/common.js +107 -0
- package/dist/packages/connector-kit/src/common.js.map +1 -0
- package/dist/packages/connector-kit/src/connector.js +492 -0
- package/dist/packages/connector-kit/src/connector.js.map +1 -0
- package/dist/packages/connector-kit/src/oauth.js +79 -0
- package/dist/packages/connector-kit/src/oauth.js.map +1 -0
- package/dist/packages/connector-kit/src/types.js +20 -0
- package/dist/packages/connector-kit/src/types.js.map +1 -0
- package/dist/packages/server/migrations/0001_tables.sql +268 -0
- package/dist/packages/server/migrations/0002_organizations.sql +72 -0
- package/dist/packages/server/migrations/0003_drop_unused.sql +3 -0
- package/dist/packages/server/migrations/0004_trigger_runners.sql +15 -0
- package/dist/packages/server/migrations/0005_run_runner.sql +3 -0
- package/dist/packages/server/migrations/0006_approvals.sql +36 -0
- package/dist/packages/server/migrations/rollback/to-legacy.sql +87 -0
- package/dist/packages/server/src/api.js +684 -0
- package/dist/packages/server/src/api.js.map +1 -0
- package/dist/packages/server/src/app.js +444 -0
- package/dist/packages/server/src/app.js.map +1 -0
- package/dist/packages/server/src/builtin.js +24 -0
- package/dist/packages/server/src/builtin.js.map +1 -0
- package/dist/packages/server/src/consent.js +36 -0
- package/dist/packages/server/src/consent.js.map +1 -0
- package/dist/packages/server/src/index.js +129 -0
- package/dist/packages/server/src/index.js.map +1 -0
- package/dist/packages/server/src/migrate.js +134 -0
- package/dist/packages/server/src/migrate.js.map +1 -0
- package/dist/packages/server/src/openapi.js +101 -0
- package/dist/packages/server/src/openapi.js.map +1 -0
- package/dist/packages/server/src/secrets.js +76 -0
- package/dist/packages/server/src/secrets.js.map +1 -0
- package/dist/packages/server/src/server.js +69 -0
- package/dist/packages/server/src/server.js.map +1 -0
- package/dist/packages/server/src/service.js +908 -0
- package/dist/packages/server/src/service.js.map +1 -0
- package/dist/packages/server/src/store.js +411 -0
- package/dist/packages/server/src/store.js.map +1 -0
- package/dist/packages/server/src/teams/activity.js +187 -0
- package/dist/packages/server/src/teams/activity.js.map +1 -0
- package/dist/packages/server/src/teams/admin.js +699 -0
- package/dist/packages/server/src/teams/admin.js.map +1 -0
- package/dist/packages/server/src/teams/approval.js +118 -0
- package/dist/packages/server/src/teams/approval.js.map +1 -0
- package/dist/packages/server/src/teams/bot.js +124 -0
- package/dist/packages/server/src/teams/bot.js.map +1 -0
- package/dist/packages/server/src/teams/claude.js +165 -0
- package/dist/packages/server/src/teams/claude.js.map +1 -0
- package/dist/packages/server/src/teams/jwt.js +121 -0
- package/dist/packages/server/src/teams/jwt.js.map +1 -0
- package/dist/packages/server/src/teams/package.js +319 -0
- package/dist/packages/server/src/teams/package.js.map +1 -0
- package/dist/packages/server/src/teams/provision.js +505 -0
- package/dist/packages/server/src/teams/provision.js.map +1 -0
- package/dist/packages/server/src/teams/runner.js +143 -0
- package/dist/packages/server/src/teams/runner.js.map +1 -0
- package/dist/packages/server/src/teams/runtime.js +701 -0
- package/dist/packages/server/src/teams/runtime.js.map +1 -0
- package/dist/packages/server/src/teams/store.js +507 -0
- package/dist/packages/server/src/teams/store.js.map +1 -0
- package/package.json +42 -4
|
@@ -0,0 +1,684 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { connectorSchema, providerSchema } from "../../connector-kit/src/connector.js";
|
|
3
|
+
import { brandingSchema } from "../../connector-kit/src/branding.js";
|
|
4
|
+
import { triggerSchema } from "./teams/admin.js";
|
|
5
|
+
// The admin API's contract: every route once, with its body and the shapes it answers. The
|
|
6
|
+
// router (app.ts) parses bodies with these, tests check every JSON answer against them, and
|
|
7
|
+
// openapi.ts turns them into openapi.json, from which the client package's types are made.
|
|
8
|
+
const name = z.string().trim().min(1).max(200);
|
|
9
|
+
const by = z.object({ by: name });
|
|
10
|
+
const fields = z.record(z.string(), z.string().max(4000));
|
|
11
|
+
const redirectUri = z
|
|
12
|
+
.url()
|
|
13
|
+
.refine((u) => u.startsWith("https://") || /^http:\/\/localhost(:\d+)?\//.test(u), "redirectUri must be https")
|
|
14
|
+
.describe("The admin app's own callback page: https, or http://localhost while developing");
|
|
15
|
+
const consentFinish = z.object({
|
|
16
|
+
state: z.string().max(4000),
|
|
17
|
+
nonce: z.string().min(1).max(200),
|
|
18
|
+
params: z.record(z.string(), z.string().max(4000)),
|
|
19
|
+
connectedBy: name,
|
|
20
|
+
});
|
|
21
|
+
const iso = z.string().describe("ISO 8601, UTC");
|
|
22
|
+
const config = z.record(z.string(), z.string());
|
|
23
|
+
// Shared shapes, each a named schema in openapi.json (`id`).
|
|
24
|
+
const named = (id, schema) => schema.meta({ id });
|
|
25
|
+
export const schemas = (() => {
|
|
26
|
+
const Organization = named("Organization", z.strictObject({ id: z.guid(), name: z.string().nullable(), createdAt: iso }));
|
|
27
|
+
const Check = named("Check", z.strictObject({
|
|
28
|
+
label: z.string(),
|
|
29
|
+
values: z.array(z.string()),
|
|
30
|
+
warning: z.string().optional(),
|
|
31
|
+
}));
|
|
32
|
+
const Ok = z.strictObject({ ok: z.literal(true) });
|
|
33
|
+
const Failed = z.strictObject({ ok: z.literal(false), error: z.string() });
|
|
34
|
+
const CertificateInfo = named("CertificateInfo", z.strictObject({ thumbprint: z.string(), expiresAt: iso }));
|
|
35
|
+
const Connection = named("Connection", z.strictObject({
|
|
36
|
+
id: z.string(),
|
|
37
|
+
organizationId: z.string(),
|
|
38
|
+
connectorId: z.string(),
|
|
39
|
+
providerId: z.string().nullable(),
|
|
40
|
+
capabilities: z.array(z.string()),
|
|
41
|
+
config,
|
|
42
|
+
status: z.enum(["connected", "needs_reconnect"]),
|
|
43
|
+
accountLabel: z.string().nullable(),
|
|
44
|
+
connectedBy: z.string().nullable(),
|
|
45
|
+
connectedAt: iso,
|
|
46
|
+
checkedAt: iso,
|
|
47
|
+
}));
|
|
48
|
+
const ProviderConnection = named("ProviderConnection", z.strictObject({
|
|
49
|
+
id: z.string(),
|
|
50
|
+
organizationId: z.string(),
|
|
51
|
+
provider: z.string(),
|
|
52
|
+
status: z.enum(["pending", "connected", "needs_reconnect"]),
|
|
53
|
+
config,
|
|
54
|
+
accountLabel: z.string().nullable(),
|
|
55
|
+
connectedBy: z.string().nullable(),
|
|
56
|
+
connectedAt: iso,
|
|
57
|
+
checkedAt: iso,
|
|
58
|
+
certificate: CertificateInfo.nullable(),
|
|
59
|
+
nextCertificate: CertificateInfo.nullable(),
|
|
60
|
+
apps: z.array(z.string()),
|
|
61
|
+
}));
|
|
62
|
+
const Limits = named("Limits", z.record(z.string(), z.union([z.array(z.string()), z.string(), z.record(z.string(), z.string())])));
|
|
63
|
+
const Grant = named("Grant", z.strictObject({
|
|
64
|
+
agentId: z.string(),
|
|
65
|
+
connectorId: z.string(),
|
|
66
|
+
capabilities: z.array(z.string()),
|
|
67
|
+
limits: Limits,
|
|
68
|
+
updatedAt: iso,
|
|
69
|
+
}));
|
|
70
|
+
const agentFields = {
|
|
71
|
+
id: z.string(),
|
|
72
|
+
organizationId: z.string(),
|
|
73
|
+
name: z.string(),
|
|
74
|
+
status: z.enum(["active", "disabled"]),
|
|
75
|
+
createdBy: z.string().nullable(),
|
|
76
|
+
createdAt: iso,
|
|
77
|
+
};
|
|
78
|
+
const NewAgent = named("NewAgent", z.strictObject(agentFields));
|
|
79
|
+
const Agent = named("Agent", z.strictObject({ ...agentFields, lastUsedAt: iso.nullable(), grants: z.array(Grant) }));
|
|
80
|
+
const access = z.enum(["granted", "not_granted", "not_found", "failed"]);
|
|
81
|
+
const SiteAccess = named("SiteAccess", z.strictObject({
|
|
82
|
+
site: z.string(),
|
|
83
|
+
status: access,
|
|
84
|
+
name: z.string().nullable(),
|
|
85
|
+
message: z.string(),
|
|
86
|
+
}));
|
|
87
|
+
const LiveCheck = named("LiveCheck", z.strictObject({ state: z.enum(["done", "failing", "todo"]), message: z.string() }));
|
|
88
|
+
const botFields = {
|
|
89
|
+
id: z.string(),
|
|
90
|
+
organizationId: z.string(),
|
|
91
|
+
agentId: z.string(),
|
|
92
|
+
botAppId: z.string().nullable(),
|
|
93
|
+
teamsAppId: z.string(),
|
|
94
|
+
tenantId: z.string(),
|
|
95
|
+
displayName: z.string(),
|
|
96
|
+
manifestVersion: z.number(),
|
|
97
|
+
status: z.enum(["awaiting_setup", "connected", "needs_reconnect"]),
|
|
98
|
+
createdBy: z.string().nullable(),
|
|
99
|
+
createdAt: iso,
|
|
100
|
+
lastRefusedAt: iso.nullable(),
|
|
101
|
+
lastRefusedReason: z.string().nullable(),
|
|
102
|
+
certificate: CertificateInfo.nullable(),
|
|
103
|
+
nextCertificate: CertificateInfo.nullable(),
|
|
104
|
+
madeByService: z.boolean(),
|
|
105
|
+
publishedVersion: z.string().nullable(),
|
|
106
|
+
packageVersion: z.string(),
|
|
107
|
+
};
|
|
108
|
+
const TeamsBotRecord = named("TeamsBotRecord", z.strictObject(botFields));
|
|
109
|
+
const TeamsPlace = named("TeamsPlace", z.strictObject({
|
|
110
|
+
kind: z.enum(["personal", "groupChat", "team"]),
|
|
111
|
+
name: z.string().nullable(),
|
|
112
|
+
id: z.string(),
|
|
113
|
+
conversationId: z.string(),
|
|
114
|
+
}));
|
|
115
|
+
const TeamsBot = named("TeamsBot", z.strictObject({
|
|
116
|
+
...botFields,
|
|
117
|
+
messagingEndpoint: z.string().nullable(),
|
|
118
|
+
mcpUrl: z.string().nullable(),
|
|
119
|
+
installedIn: z.array(TeamsPlace),
|
|
120
|
+
}));
|
|
121
|
+
const TeamsTrigger = named("TeamsTrigger", z.strictObject({
|
|
122
|
+
agentId: z.string(),
|
|
123
|
+
enabled: z.boolean(),
|
|
124
|
+
runner: z.string(),
|
|
125
|
+
settings: z.record(z.string(), z.unknown()),
|
|
126
|
+
hasSigningSecret: z.boolean(),
|
|
127
|
+
// Set for the Claude Managed Agents runner, null for others.
|
|
128
|
+
managedAgentId: z.string().nullable(),
|
|
129
|
+
environmentId: z.string().nullable(),
|
|
130
|
+
vaultIds: z.array(z.string()),
|
|
131
|
+
budgetCents: z.number(),
|
|
132
|
+
maxRunsPerHour: z.number(),
|
|
133
|
+
maxCentsPerDay: z.number(),
|
|
134
|
+
maxConcurrent: z.number(),
|
|
135
|
+
replyMode: z.enum(["mentions", "all"]),
|
|
136
|
+
allowedTeams: z.array(z.string()),
|
|
137
|
+
allowedPeople: z.array(z.string()),
|
|
138
|
+
anyoneInOrganization: z.boolean(),
|
|
139
|
+
updatedBy: z.string().nullable(),
|
|
140
|
+
updatedAt: iso,
|
|
141
|
+
}));
|
|
142
|
+
const TeamsRun = named("TeamsRun", z.strictObject({
|
|
143
|
+
id: z.string(),
|
|
144
|
+
agentId: z.string(),
|
|
145
|
+
botId: z.string(),
|
|
146
|
+
conversationId: z.string(),
|
|
147
|
+
threadId: z.string(),
|
|
148
|
+
triggerActivityId: z.string(),
|
|
149
|
+
runner: z.string(),
|
|
150
|
+
sessionId: z.string().nullable(),
|
|
151
|
+
state: z.enum(["starting", "running", "idle", "ended", "failed", "no_reply"]),
|
|
152
|
+
error: z.string().nullable(),
|
|
153
|
+
note: z.string().nullable(),
|
|
154
|
+
requestedBy: z.string().nullable(),
|
|
155
|
+
replyCount: z.number(),
|
|
156
|
+
repliedAt: iso.nullable(),
|
|
157
|
+
costCents: z.number().nullable(),
|
|
158
|
+
turns: z.number(),
|
|
159
|
+
startedAt: iso,
|
|
160
|
+
finishedAt: iso.nullable(),
|
|
161
|
+
replyTokenAt: iso,
|
|
162
|
+
}));
|
|
163
|
+
const keySet = z.strictObject({
|
|
164
|
+
set: z.literal(true),
|
|
165
|
+
ending: z.string(),
|
|
166
|
+
by: z.string().nullable(),
|
|
167
|
+
at: iso,
|
|
168
|
+
});
|
|
169
|
+
const ClaudeKey = named("ClaudeKey", z.union([z.strictObject({ set: z.literal(false) }), keySet]));
|
|
170
|
+
const ClaudeAgent = named("ClaudeAgent", z.strictObject({ id: z.string(), name: z.string() }));
|
|
171
|
+
const ClaudeKeySaved = named("ClaudeKeySaved", keySet.extend({ agents: z.array(ClaudeAgent) }));
|
|
172
|
+
const SignIn = named("SignIn", z.strictObject({ url: z.string(), nonce: z.string() }));
|
|
173
|
+
const ConnectResult = named("ConnectResult", z.strictObject({ connection: Connection, checks: z.array(Check) }));
|
|
174
|
+
return {
|
|
175
|
+
Error: named("Error", z.strictObject({ error: z.string() })),
|
|
176
|
+
Organization,
|
|
177
|
+
Connector: named("Connector", connectorSchema),
|
|
178
|
+
Branding: named("Branding", brandingSchema),
|
|
179
|
+
Provider: named("Provider", providerSchema.extend({ approval: z.boolean() })),
|
|
180
|
+
ProviderConnection,
|
|
181
|
+
Connection,
|
|
182
|
+
Check,
|
|
183
|
+
CheckOutcome: named("CheckOutcome", z.union([z.strictObject({ ok: z.literal(true), checks: z.array(Check) }), Failed])),
|
|
184
|
+
SignInCheck: named("SignInCheck", z.union([Ok, Failed])),
|
|
185
|
+
ConnectResult,
|
|
186
|
+
SignIn,
|
|
187
|
+
SiteAccess,
|
|
188
|
+
AgentAccess: named("AgentAccess", z.strictObject({ value: z.string(), status: access, message: z.string() })),
|
|
189
|
+
Limits,
|
|
190
|
+
Grant,
|
|
191
|
+
NewAgent,
|
|
192
|
+
Agent,
|
|
193
|
+
AuditRow: named("AuditRow", z.strictObject({
|
|
194
|
+
at: iso,
|
|
195
|
+
agentId: z.string().nullable(),
|
|
196
|
+
agentName: z.string().nullable(),
|
|
197
|
+
connectorId: z.string(),
|
|
198
|
+
tool: z.string(),
|
|
199
|
+
target: z.string().nullable(),
|
|
200
|
+
decision: z.enum(["allowed", "denied", "failed"]),
|
|
201
|
+
reason: z.string().nullable(),
|
|
202
|
+
vendorStatus: z.number().nullable(),
|
|
203
|
+
})),
|
|
204
|
+
Confirmed: named("Confirmed", z.strictObject({ step: z.string(), by: z.string(), at: iso })),
|
|
205
|
+
LiveCheck,
|
|
206
|
+
TeamsBotRecord,
|
|
207
|
+
TeamsPlace,
|
|
208
|
+
TeamsBot,
|
|
209
|
+
AddStep: named("AddStep", z.strictObject({
|
|
210
|
+
id: z.string(),
|
|
211
|
+
label: z.string(),
|
|
212
|
+
state: z.enum(["done", "failed", "waiting", "todo"]),
|
|
213
|
+
message: z.string().optional(),
|
|
214
|
+
})),
|
|
215
|
+
InstallTarget: named("InstallTarget", z.strictObject({ id: z.string(), name: z.string(), detail: z.string().nullable() })),
|
|
216
|
+
TeamsTrigger,
|
|
217
|
+
TeamsRun,
|
|
218
|
+
ClaudeKey,
|
|
219
|
+
ClaudeKeySaved,
|
|
220
|
+
ClaudeAgent,
|
|
221
|
+
Ok,
|
|
222
|
+
};
|
|
223
|
+
})();
|
|
224
|
+
const s = schemas;
|
|
225
|
+
export const PARAMS = {
|
|
226
|
+
org: "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",
|
|
227
|
+
agent: "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",
|
|
228
|
+
app: "[a-z0-9-]+",
|
|
229
|
+
provider: "[a-z0-9-]+",
|
|
230
|
+
step: "[a-z0-9-]+",
|
|
231
|
+
};
|
|
232
|
+
const notFound = { 404: s.Error };
|
|
233
|
+
const ORG = "/orgs/{org}";
|
|
234
|
+
const APP = `${ORG}/connections/{app}`;
|
|
235
|
+
const PROVIDER = `${ORG}/providers/{provider}`;
|
|
236
|
+
const AGENT = `${ORG}/agents/{agent}`;
|
|
237
|
+
const BOT = `${AGENT}/teams-bot`;
|
|
238
|
+
/** Every admin route, by the client method that calls it. */
|
|
239
|
+
export const routes = {
|
|
240
|
+
listOrganizations: {
|
|
241
|
+
method: "GET",
|
|
242
|
+
path: "/orgs",
|
|
243
|
+
summary: "The organizations",
|
|
244
|
+
responses: { 200: z.array(s.Organization) },
|
|
245
|
+
},
|
|
246
|
+
createOrganization: {
|
|
247
|
+
method: "POST",
|
|
248
|
+
path: "/orgs",
|
|
249
|
+
summary: "Makes an organization; its id is made here",
|
|
250
|
+
body: z.object({ name }),
|
|
251
|
+
responses: { 201: s.Organization },
|
|
252
|
+
},
|
|
253
|
+
getOrganization: {
|
|
254
|
+
method: "GET",
|
|
255
|
+
path: ORG,
|
|
256
|
+
summary: "One organization",
|
|
257
|
+
responses: { 200: s.Organization, ...notFound },
|
|
258
|
+
},
|
|
259
|
+
ensureOrganization: {
|
|
260
|
+
method: "PUT",
|
|
261
|
+
path: ORG,
|
|
262
|
+
summary: "Makes the organization with this id if missing, and names it when a name is given",
|
|
263
|
+
body: z.object({ name: name.optional() }),
|
|
264
|
+
responses: { 200: s.Organization },
|
|
265
|
+
},
|
|
266
|
+
branding: {
|
|
267
|
+
method: "GET",
|
|
268
|
+
path: "/branding",
|
|
269
|
+
summary: "The deployment's names and logo, for a UI to show",
|
|
270
|
+
responses: { 200: s.Branding },
|
|
271
|
+
},
|
|
272
|
+
connectors: {
|
|
273
|
+
method: "GET",
|
|
274
|
+
path: "/connectors",
|
|
275
|
+
summary: "The apps agents can use",
|
|
276
|
+
responses: { 200: z.array(s.Connector) },
|
|
277
|
+
},
|
|
278
|
+
providers: {
|
|
279
|
+
method: "GET",
|
|
280
|
+
path: "/providers",
|
|
281
|
+
summary: "The sign-ins several apps share",
|
|
282
|
+
responses: { 200: z.array(s.Provider) },
|
|
283
|
+
},
|
|
284
|
+
providerConnections: {
|
|
285
|
+
method: "GET",
|
|
286
|
+
path: `${ORG}/providers`,
|
|
287
|
+
summary: "The organization's provider connections",
|
|
288
|
+
responses: { 200: z.array(s.ProviderConnection) },
|
|
289
|
+
},
|
|
290
|
+
connectProvider: {
|
|
291
|
+
method: "PUT",
|
|
292
|
+
path: PROVIDER,
|
|
293
|
+
summary: "Connects a provider, proving the sign-in first",
|
|
294
|
+
body: z.object({ fields, connectedBy: name }),
|
|
295
|
+
responses: { 200: s.ProviderConnection },
|
|
296
|
+
},
|
|
297
|
+
disconnectProvider: {
|
|
298
|
+
method: "DELETE",
|
|
299
|
+
path: PROVIDER,
|
|
300
|
+
summary: "Disconnects a provider and every app signing in through it",
|
|
301
|
+
body: by,
|
|
302
|
+
responses: { 204: null, ...notFound },
|
|
303
|
+
},
|
|
304
|
+
checkProvider: {
|
|
305
|
+
method: "POST",
|
|
306
|
+
path: `${PROVIDER}/check`,
|
|
307
|
+
summary: "Signs in again",
|
|
308
|
+
responses: { 200: s.SignInCheck, ...notFound },
|
|
309
|
+
},
|
|
310
|
+
newCertificate: {
|
|
311
|
+
method: "POST",
|
|
312
|
+
path: `${PROVIDER}/certificate`,
|
|
313
|
+
summary: "Before connecting, the certificate to upload; after, one to rotate to",
|
|
314
|
+
body: by,
|
|
315
|
+
responses: { 200: s.ProviderConnection },
|
|
316
|
+
},
|
|
317
|
+
activateCertificate: {
|
|
318
|
+
method: "POST",
|
|
319
|
+
path: `${PROVIDER}/certificate/activate`,
|
|
320
|
+
summary: "Signs in with the new certificate and, if that works, switches to it",
|
|
321
|
+
body: by,
|
|
322
|
+
responses: { 200: s.ProviderConnection },
|
|
323
|
+
},
|
|
324
|
+
setProviderSettings: {
|
|
325
|
+
method: "PUT",
|
|
326
|
+
path: `${PROVIDER}/settings`,
|
|
327
|
+
summary: "Values the provider's apps ask for in their steps",
|
|
328
|
+
body: z.object({ values: z.record(z.string(), z.string().max(400)), by: name }),
|
|
329
|
+
responses: { 200: z.strictObject({ settings: config }) },
|
|
330
|
+
},
|
|
331
|
+
confirmed: {
|
|
332
|
+
method: "GET",
|
|
333
|
+
path: `${ORG}/confirmed`,
|
|
334
|
+
summary: "Setup steps an admin marked done",
|
|
335
|
+
responses: { 200: z.array(s.Confirmed) },
|
|
336
|
+
},
|
|
337
|
+
confirm: {
|
|
338
|
+
method: "PUT",
|
|
339
|
+
path: `${ORG}/confirmed/{step}`,
|
|
340
|
+
summary: "Marks a setup step done",
|
|
341
|
+
body: by,
|
|
342
|
+
responses: { 204: null },
|
|
343
|
+
},
|
|
344
|
+
unconfirm: {
|
|
345
|
+
method: "DELETE",
|
|
346
|
+
path: `${ORG}/confirmed/{step}`,
|
|
347
|
+
summary: "Marks a setup step not done",
|
|
348
|
+
body: by,
|
|
349
|
+
responses: { 204: null },
|
|
350
|
+
},
|
|
351
|
+
connections: {
|
|
352
|
+
method: "GET",
|
|
353
|
+
path: `${ORG}/connections`,
|
|
354
|
+
summary: "The organization's apps that are on",
|
|
355
|
+
responses: { 200: z.array(s.Connection) },
|
|
356
|
+
},
|
|
357
|
+
connect: {
|
|
358
|
+
method: "PUT",
|
|
359
|
+
path: APP,
|
|
360
|
+
summary: "Turns an app on, checking it before saving",
|
|
361
|
+
body: z.object({ capabilities: z.array(z.string()), fields, connectedBy: name }),
|
|
362
|
+
responses: { 200: s.ConnectResult },
|
|
363
|
+
},
|
|
364
|
+
setCeiling: {
|
|
365
|
+
method: "PATCH",
|
|
366
|
+
path: APP,
|
|
367
|
+
summary: "The most any agent may do in the app",
|
|
368
|
+
body: z.object({ capabilities: z.array(z.string()), by: name }),
|
|
369
|
+
responses: { 204: null, ...notFound },
|
|
370
|
+
},
|
|
371
|
+
disconnect: {
|
|
372
|
+
method: "DELETE",
|
|
373
|
+
path: APP,
|
|
374
|
+
summary: "Turns an app off",
|
|
375
|
+
body: by,
|
|
376
|
+
responses: { 204: null, ...notFound },
|
|
377
|
+
},
|
|
378
|
+
startConsent: {
|
|
379
|
+
method: "POST",
|
|
380
|
+
path: `${APP}/consent`,
|
|
381
|
+
summary: "Where the admin approves the shared app",
|
|
382
|
+
body: z.object({ capabilities: z.array(z.string()), redirectUri }),
|
|
383
|
+
responses: { 200: s.SignIn },
|
|
384
|
+
},
|
|
385
|
+
finishConsent: {
|
|
386
|
+
method: "POST",
|
|
387
|
+
path: `${APP}/consent/callback`,
|
|
388
|
+
summary: "The approval came back: `redirect` is the sign-in that proves the organization, " +
|
|
389
|
+
"`provider` the provider connection when the app still needs its own settings",
|
|
390
|
+
body: consentFinish,
|
|
391
|
+
responses: {
|
|
392
|
+
200: z.union([
|
|
393
|
+
z.strictObject({ redirect: z.string() }),
|
|
394
|
+
z.strictObject({ provider: s.ProviderConnection }),
|
|
395
|
+
s.ConnectResult,
|
|
396
|
+
]),
|
|
397
|
+
},
|
|
398
|
+
},
|
|
399
|
+
check: {
|
|
400
|
+
method: "POST",
|
|
401
|
+
path: `${APP}/check`,
|
|
402
|
+
summary: "Checks the app. Recorded (the default) marks a failing app as needing reconnecting " +
|
|
403
|
+
"and needs `by`; record=false only reads",
|
|
404
|
+
query: { record: "false: read only" },
|
|
405
|
+
body: by.optional(),
|
|
406
|
+
responses: { 200: s.CheckOutcome, ...notFound },
|
|
407
|
+
},
|
|
408
|
+
setSites: {
|
|
409
|
+
method: "PUT",
|
|
410
|
+
path: `${APP}/sites`,
|
|
411
|
+
summary: "The sites added to the app, the whole list at once",
|
|
412
|
+
body: z.object({ sites: z.array(z.string().max(500)).max(500), by: name }),
|
|
413
|
+
responses: { 200: z.strictObject({ sites: z.array(z.string()) }) },
|
|
414
|
+
},
|
|
415
|
+
checkSites: {
|
|
416
|
+
method: "POST",
|
|
417
|
+
path: `${APP}/sites/check`,
|
|
418
|
+
summary: "Whether the app can open each added site, or just `site`",
|
|
419
|
+
body: z.object({ site: z.string().max(500).optional() }),
|
|
420
|
+
responses: { 200: z.strictObject({ sites: z.array(s.SiteAccess) }) },
|
|
421
|
+
},
|
|
422
|
+
agentAccess: {
|
|
423
|
+
method: "POST",
|
|
424
|
+
path: `${APP}/agent-access`,
|
|
425
|
+
summary: "Whether the app can reach one agent's own address yet",
|
|
426
|
+
body: z.object({ value: z.string().min(1).max(320), by: name }),
|
|
427
|
+
responses: { 200: s.AgentAccess },
|
|
428
|
+
},
|
|
429
|
+
agents: {
|
|
430
|
+
method: "GET",
|
|
431
|
+
path: `${ORG}/agents`,
|
|
432
|
+
summary: "The organization's agents (API keys) and their grants",
|
|
433
|
+
responses: { 200: z.array(s.Agent) },
|
|
434
|
+
},
|
|
435
|
+
createAgent: {
|
|
436
|
+
method: "POST",
|
|
437
|
+
path: `${ORG}/agents`,
|
|
438
|
+
summary: "Makes an agent; its key is returned this once",
|
|
439
|
+
body: z.object({ name, createdBy: name }),
|
|
440
|
+
responses: { 201: z.strictObject({ agent: s.NewAgent, key: z.string() }), 409: s.Error },
|
|
441
|
+
},
|
|
442
|
+
setAgentStatus: {
|
|
443
|
+
method: "PATCH",
|
|
444
|
+
path: AGENT,
|
|
445
|
+
summary: "Turns an agent's key on or off",
|
|
446
|
+
body: z.object({ status: z.enum(["active", "disabled"]), by: name }),
|
|
447
|
+
responses: { 204: null, ...notFound },
|
|
448
|
+
},
|
|
449
|
+
deleteAgent: {
|
|
450
|
+
method: "DELETE",
|
|
451
|
+
path: AGENT,
|
|
452
|
+
summary: "Deletes an agent",
|
|
453
|
+
body: by,
|
|
454
|
+
responses: { 204: null, ...notFound },
|
|
455
|
+
},
|
|
456
|
+
newKey: {
|
|
457
|
+
method: "POST",
|
|
458
|
+
path: `${AGENT}/key`,
|
|
459
|
+
summary: "Replaces an agent's key; the new one is returned this once",
|
|
460
|
+
body: by,
|
|
461
|
+
responses: { 200: z.strictObject({ key: z.string() }), ...notFound },
|
|
462
|
+
},
|
|
463
|
+
setGrant: {
|
|
464
|
+
method: "PUT",
|
|
465
|
+
path: `${AGENT}/grants/{app}`,
|
|
466
|
+
summary: "What the agent may do in one app",
|
|
467
|
+
body: z.object({ capabilities: z.array(z.string()), limits: z.unknown().optional(), by: name }),
|
|
468
|
+
responses: { 204: null, ...notFound },
|
|
469
|
+
},
|
|
470
|
+
removeGrant: {
|
|
471
|
+
method: "DELETE",
|
|
472
|
+
path: `${AGENT}/grants/{app}`,
|
|
473
|
+
summary: "Takes one app away from the agent",
|
|
474
|
+
body: by,
|
|
475
|
+
responses: { 204: null, ...notFound },
|
|
476
|
+
},
|
|
477
|
+
audit: {
|
|
478
|
+
method: "GET",
|
|
479
|
+
path: `${ORG}/audit`,
|
|
480
|
+
summary: "Recent requests and admin changes, newest first",
|
|
481
|
+
query: { limit: "1 to 500, default 50", agent: "an agent id", app: "an app id" },
|
|
482
|
+
responses: { 200: z.array(s.AuditRow) },
|
|
483
|
+
},
|
|
484
|
+
teamsBots: {
|
|
485
|
+
method: "GET",
|
|
486
|
+
path: `${ORG}/teams/bots`,
|
|
487
|
+
summary: "Each agent's Teams bot",
|
|
488
|
+
responses: { 200: z.array(s.TeamsBot) },
|
|
489
|
+
teams: true,
|
|
490
|
+
},
|
|
491
|
+
teamsSetupState: {
|
|
492
|
+
method: "GET",
|
|
493
|
+
path: `${ORG}/teams/setup`,
|
|
494
|
+
summary: "The Teams page's set-up-once steps, checked live",
|
|
495
|
+
responses: { 200: z.record(z.string(), s.LiveCheck) },
|
|
496
|
+
teams: true,
|
|
497
|
+
},
|
|
498
|
+
finishTeamsPublish: {
|
|
499
|
+
method: "POST",
|
|
500
|
+
path: `${ORG}/teams/publish/callback`,
|
|
501
|
+
summary: "The publishing sign-in came back: publishes the bot's package",
|
|
502
|
+
body: consentFinish.omit({ connectedBy: true }).extend({ by: name }),
|
|
503
|
+
responses: {
|
|
504
|
+
200: z.strictObject({ agentId: z.string(), version: z.string(), changed: z.boolean() }),
|
|
505
|
+
},
|
|
506
|
+
teams: true,
|
|
507
|
+
},
|
|
508
|
+
createTeamsBot: {
|
|
509
|
+
method: "POST",
|
|
510
|
+
path: BOT,
|
|
511
|
+
summary: "Makes the agent's bot's key pair, for the setup script",
|
|
512
|
+
body: z.object({ displayName: z.string(), by: name }),
|
|
513
|
+
responses: { 200: s.TeamsBotRecord },
|
|
514
|
+
teams: true,
|
|
515
|
+
},
|
|
516
|
+
connectTeamsBot: {
|
|
517
|
+
method: "PUT",
|
|
518
|
+
path: BOT,
|
|
519
|
+
summary: "Proves the application ID the setup script printed by signing in as it",
|
|
520
|
+
body: z.object({ botAppId: z.string().max(100), by: name }),
|
|
521
|
+
responses: { 200: s.TeamsBotRecord },
|
|
522
|
+
teams: true,
|
|
523
|
+
},
|
|
524
|
+
removeTeamsBot: {
|
|
525
|
+
method: "DELETE",
|
|
526
|
+
path: BOT,
|
|
527
|
+
summary: "Forgets the bot. What Add to Teams made is deleted (`failed`: what could not be); " +
|
|
528
|
+
"`removal` is the commands for the rest",
|
|
529
|
+
body: by,
|
|
530
|
+
responses: {
|
|
531
|
+
200: z.strictObject({ removal: z.string(), failed: z.array(z.string()) }),
|
|
532
|
+
...notFound,
|
|
533
|
+
},
|
|
534
|
+
teams: true,
|
|
535
|
+
},
|
|
536
|
+
addToTeams: {
|
|
537
|
+
method: "POST",
|
|
538
|
+
path: `${BOT}/add`,
|
|
539
|
+
summary: "Makes the agent's bot in the tenant, each part only if missing",
|
|
540
|
+
body: z.object({ displayName: z.string().max(100), by: name }),
|
|
541
|
+
responses: { 200: z.strictObject({ steps: z.array(s.AddStep), bot: s.TeamsBotRecord }) },
|
|
542
|
+
teams: true,
|
|
543
|
+
},
|
|
544
|
+
startTeamsPublish: {
|
|
545
|
+
method: "POST",
|
|
546
|
+
path: `${BOT}/publish`,
|
|
547
|
+
summary: "Where the administrator signs in to publish the bot",
|
|
548
|
+
body: z.object({ redirectUri }),
|
|
549
|
+
responses: { 200: s.SignIn },
|
|
550
|
+
teams: true,
|
|
551
|
+
},
|
|
552
|
+
teamsTargets: {
|
|
553
|
+
method: "GET",
|
|
554
|
+
path: `${BOT}/targets`,
|
|
555
|
+
summary: "Teams or people to add the bot to, matching `q`",
|
|
556
|
+
query: { kind: "team or person", q: "what the admin typed" },
|
|
557
|
+
responses: { 200: z.array(s.InstallTarget) },
|
|
558
|
+
teams: true,
|
|
559
|
+
},
|
|
560
|
+
installTeamsBot: {
|
|
561
|
+
method: "POST",
|
|
562
|
+
path: `${BOT}/install`,
|
|
563
|
+
summary: "Adds the published bot to a team, a group chat or a person",
|
|
564
|
+
body: z.object({
|
|
565
|
+
kind: z.enum(["team", "chat", "person"]),
|
|
566
|
+
id: z.string().max(2000),
|
|
567
|
+
by: name,
|
|
568
|
+
}),
|
|
569
|
+
responses: { 200: z.strictObject({ result: z.enum(["added", "already"]) }) },
|
|
570
|
+
teams: true,
|
|
571
|
+
},
|
|
572
|
+
teamsKit: {
|
|
573
|
+
method: "GET",
|
|
574
|
+
path: `${BOT}/kit`,
|
|
575
|
+
summary: "The bot's setup script",
|
|
576
|
+
responses: { 200: { file: "text/plain" } },
|
|
577
|
+
teams: true,
|
|
578
|
+
},
|
|
579
|
+
checkTeamsBot: {
|
|
580
|
+
method: "POST",
|
|
581
|
+
path: `${BOT}/check`,
|
|
582
|
+
summary: "Signs in as the bot again",
|
|
583
|
+
responses: { 200: s.SignInCheck },
|
|
584
|
+
teams: true,
|
|
585
|
+
},
|
|
586
|
+
teamsTest: {
|
|
587
|
+
method: "POST",
|
|
588
|
+
path: `${BOT}/test`,
|
|
589
|
+
summary: "A test message from the bot in one place it was added to",
|
|
590
|
+
body: z.object({ conversationId: z.string().max(400), by: name }),
|
|
591
|
+
responses: { 200: s.Ok },
|
|
592
|
+
teams: true,
|
|
593
|
+
},
|
|
594
|
+
teamsCertificate: {
|
|
595
|
+
method: "GET",
|
|
596
|
+
path: `${BOT}/certificate`,
|
|
597
|
+
summary: "The bot certificate's public half",
|
|
598
|
+
responses: { 200: { file: "application/x-pem-file" } },
|
|
599
|
+
teams: true,
|
|
600
|
+
},
|
|
601
|
+
teamsPackage: {
|
|
602
|
+
method: "GET",
|
|
603
|
+
path: `${BOT}/package`,
|
|
604
|
+
summary: "The bot's Teams app package",
|
|
605
|
+
responses: { 200: { file: "application/zip" } },
|
|
606
|
+
teams: true,
|
|
607
|
+
},
|
|
608
|
+
newTeamsCertificate: {
|
|
609
|
+
method: "POST",
|
|
610
|
+
path: `${BOT}/certificate`,
|
|
611
|
+
summary: "A certificate for the bot to rotate to",
|
|
612
|
+
body: by,
|
|
613
|
+
responses: {
|
|
614
|
+
200: z.strictObject({
|
|
615
|
+
bot: s.TeamsBotRecord,
|
|
616
|
+
command: z.string().nullable(),
|
|
617
|
+
certificate: z.string(),
|
|
618
|
+
}),
|
|
619
|
+
},
|
|
620
|
+
teams: true,
|
|
621
|
+
},
|
|
622
|
+
activateTeamsCertificate: {
|
|
623
|
+
method: "POST",
|
|
624
|
+
path: `${BOT}/certificate/activate`,
|
|
625
|
+
summary: "Signs in with the bot's new certificate and, if that works, switches to it",
|
|
626
|
+
body: by,
|
|
627
|
+
responses: { 200: s.TeamsBotRecord },
|
|
628
|
+
teams: true,
|
|
629
|
+
},
|
|
630
|
+
teamsTrigger: {
|
|
631
|
+
method: "GET",
|
|
632
|
+
path: `${AGENT}/teams-trigger`,
|
|
633
|
+
summary: "How the agent answers in Teams",
|
|
634
|
+
responses: { 200: s.TeamsTrigger, ...notFound },
|
|
635
|
+
teams: true,
|
|
636
|
+
},
|
|
637
|
+
setTeamsTrigger: {
|
|
638
|
+
method: "PUT",
|
|
639
|
+
path: `${AGENT}/teams-trigger`,
|
|
640
|
+
summary: "Sets how the agent answers in Teams, checked by its runner first",
|
|
641
|
+
body: triggerSchema,
|
|
642
|
+
responses: { 200: s.TeamsTrigger },
|
|
643
|
+
teams: true,
|
|
644
|
+
},
|
|
645
|
+
teamsRuns: {
|
|
646
|
+
method: "GET",
|
|
647
|
+
path: `${AGENT}/teams-runs`,
|
|
648
|
+
summary: "The agent's recent answers in Teams, newest first",
|
|
649
|
+
query: { limit: "1 to 200, default 20" },
|
|
650
|
+
responses: { 200: z.array(s.TeamsRun) },
|
|
651
|
+
teams: true,
|
|
652
|
+
},
|
|
653
|
+
claudeKey: {
|
|
654
|
+
method: "GET",
|
|
655
|
+
path: `${ORG}/claude-key`,
|
|
656
|
+
summary: "The organization's Claude API key, by its last four characters",
|
|
657
|
+
responses: { 200: s.ClaudeKey },
|
|
658
|
+
teams: true,
|
|
659
|
+
},
|
|
660
|
+
setClaudeKey: {
|
|
661
|
+
method: "PUT",
|
|
662
|
+
path: `${ORG}/claude-key`,
|
|
663
|
+
summary: "Saves the organization's Claude API key, proven by listing its agents",
|
|
664
|
+
body: z.object({ apiKey: z.string().max(400), by: name }),
|
|
665
|
+
responses: { 200: s.ClaudeKeySaved },
|
|
666
|
+
teams: true,
|
|
667
|
+
},
|
|
668
|
+
removeClaudeKey: {
|
|
669
|
+
method: "DELETE",
|
|
670
|
+
path: `${ORG}/claude-key`,
|
|
671
|
+
summary: "Removes the organization's Claude API key",
|
|
672
|
+
body: by,
|
|
673
|
+
responses: { 204: null, ...notFound },
|
|
674
|
+
teams: true,
|
|
675
|
+
},
|
|
676
|
+
claudeAgents: {
|
|
677
|
+
method: "GET",
|
|
678
|
+
path: `${ORG}/claude-key/agents`,
|
|
679
|
+
summary: "The Claude Managed Agents the organization's key can use",
|
|
680
|
+
responses: { 200: z.array(s.ClaudeAgent) },
|
|
681
|
+
teams: true,
|
|
682
|
+
},
|
|
683
|
+
};
|
|
684
|
+
//# sourceMappingURL=api.js.map
|