@alfe.ai/mcp-server 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.cjs +4 -0
- package/dist/bin.d.cts +1 -0
- package/dist/bin.d.ts +1 -0
- package/dist/bin.js +8 -0
- package/dist/bin.js.map +1 -0
- package/dist/index.cjs +81 -0
- package/dist/index.d.cts +777 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +777 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +79 -0
- package/dist/index.js.map +1 -0
- package/package.json +36 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,777 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { ChangelogEntry, EncryptedEnvelopeV1, FieldEnvelope, FieldFormat, FieldSensitivity, GeneratedDataKey, IntegrationConfigResult, IntegrationInstall, RegistryEntry, ScopeInfo, SecretAggregate, SecretCategory, SecretMetadata, SecretScope } from "@alfe/types";
|
|
3
|
+
|
|
4
|
+
//#region ../agent-api-client/dist/index.d.ts
|
|
5
|
+
//#region src/index.d.ts
|
|
6
|
+
interface AgentApiClientConfig {
|
|
7
|
+
apiKey: string;
|
|
8
|
+
apiUrl: string;
|
|
9
|
+
}
|
|
10
|
+
interface SyncAgentInfo {
|
|
11
|
+
agentId: string;
|
|
12
|
+
tenantId: string;
|
|
13
|
+
displayName: string;
|
|
14
|
+
s3Prefix: string;
|
|
15
|
+
status: "stale" | "syncing" | "synced";
|
|
16
|
+
fileCount?: number;
|
|
17
|
+
totalSize?: number;
|
|
18
|
+
lastSync?: string;
|
|
19
|
+
}
|
|
20
|
+
interface SyncManifestEntry {
|
|
21
|
+
hash: string;
|
|
22
|
+
size: number;
|
|
23
|
+
modified: string;
|
|
24
|
+
etag?: string;
|
|
25
|
+
storageClass?: string;
|
|
26
|
+
compressed?: boolean;
|
|
27
|
+
}
|
|
28
|
+
interface SyncManifest {
|
|
29
|
+
version: 1;
|
|
30
|
+
agentId: string;
|
|
31
|
+
lastSync: string;
|
|
32
|
+
files: Record<string, SyncManifestEntry>;
|
|
33
|
+
}
|
|
34
|
+
interface SyncPresignedUrl {
|
|
35
|
+
path: string;
|
|
36
|
+
url: string;
|
|
37
|
+
expiresAt: string;
|
|
38
|
+
}
|
|
39
|
+
interface SyncConfirmedUpload {
|
|
40
|
+
filePath: string;
|
|
41
|
+
hash: string;
|
|
42
|
+
size: number;
|
|
43
|
+
storageClass: "STANDARD" | "GLACIER_IR";
|
|
44
|
+
syncedAt: string;
|
|
45
|
+
}
|
|
46
|
+
interface SyncReconstructFile {
|
|
47
|
+
path: string;
|
|
48
|
+
size: number;
|
|
49
|
+
url: string;
|
|
50
|
+
storageClass?: string;
|
|
51
|
+
compressed?: boolean;
|
|
52
|
+
}
|
|
53
|
+
interface SyncReconstructBundle {
|
|
54
|
+
agentId: string;
|
|
55
|
+
mode: "full" | "active" | "memory";
|
|
56
|
+
fileCount: number;
|
|
57
|
+
totalSize: number;
|
|
58
|
+
files: SyncReconstructFile[];
|
|
59
|
+
expiresAt: string;
|
|
60
|
+
}
|
|
61
|
+
interface SyncAgentStats {
|
|
62
|
+
agentId: string;
|
|
63
|
+
standardBytes: number;
|
|
64
|
+
glacierBytes: number;
|
|
65
|
+
fileCount: number;
|
|
66
|
+
lastSyncAt: string | null;
|
|
67
|
+
}
|
|
68
|
+
interface SyncFileEntry {
|
|
69
|
+
filePath: string;
|
|
70
|
+
size: number;
|
|
71
|
+
modified: string;
|
|
72
|
+
contentHash: string;
|
|
73
|
+
storageClass?: string;
|
|
74
|
+
compressed?: boolean;
|
|
75
|
+
}
|
|
76
|
+
interface SyncSessionEntry {
|
|
77
|
+
sessionId: string;
|
|
78
|
+
size: number;
|
|
79
|
+
lastModified: string;
|
|
80
|
+
storageClass?: string;
|
|
81
|
+
isArchived: boolean;
|
|
82
|
+
}
|
|
83
|
+
interface SyncSessionContent {
|
|
84
|
+
sessionId: string;
|
|
85
|
+
content: string;
|
|
86
|
+
compressed: boolean;
|
|
87
|
+
}
|
|
88
|
+
interface SharedFileEntry {
|
|
89
|
+
filePath: string;
|
|
90
|
+
fileName: string;
|
|
91
|
+
size: number;
|
|
92
|
+
contentType?: string;
|
|
93
|
+
}
|
|
94
|
+
declare class AgentApiClient {
|
|
95
|
+
private readonly apiKey;
|
|
96
|
+
private readonly apiUrl;
|
|
97
|
+
constructor(config: AgentApiClientConfig);
|
|
98
|
+
private request;
|
|
99
|
+
syncRegister(args?: {
|
|
100
|
+
displayName?: string;
|
|
101
|
+
}): Promise<{
|
|
102
|
+
agent: SyncAgentInfo;
|
|
103
|
+
}>;
|
|
104
|
+
syncGetManifest(): Promise<SyncManifest>;
|
|
105
|
+
syncPresign(args: {
|
|
106
|
+
files: {
|
|
107
|
+
path: string;
|
|
108
|
+
operation: "put" | "get";
|
|
109
|
+
contentType?: string;
|
|
110
|
+
}[];
|
|
111
|
+
}): Promise<{
|
|
112
|
+
urls: SyncPresignedUrl[];
|
|
113
|
+
}>;
|
|
114
|
+
syncConfirmUpload(args: {
|
|
115
|
+
filePath: string;
|
|
116
|
+
hash: string;
|
|
117
|
+
size: number;
|
|
118
|
+
storageClass?: "STANDARD" | "GLACIER_IR";
|
|
119
|
+
}): Promise<SyncConfirmedUpload>;
|
|
120
|
+
syncReconstruct(args: {
|
|
121
|
+
mode: "full" | "active" | "memory";
|
|
122
|
+
}): Promise<SyncReconstructBundle>;
|
|
123
|
+
syncGetStats(): Promise<SyncAgentStats>;
|
|
124
|
+
syncListFiles(args?: {
|
|
125
|
+
prefix?: string;
|
|
126
|
+
}): Promise<{
|
|
127
|
+
files: SyncFileEntry[];
|
|
128
|
+
}>;
|
|
129
|
+
syncListSessions(): Promise<{
|
|
130
|
+
sessions: SyncSessionEntry[];
|
|
131
|
+
}>;
|
|
132
|
+
syncGetSession(sessionId: string): Promise<SyncSessionContent>;
|
|
133
|
+
syncDeleteFile(filePath: string): Promise<{
|
|
134
|
+
removed: boolean;
|
|
135
|
+
}>;
|
|
136
|
+
sharedListFiles(args: {
|
|
137
|
+
scope: "org" | "team" | "project";
|
|
138
|
+
scopeId: string;
|
|
139
|
+
}): Promise<{
|
|
140
|
+
files: SharedFileEntry[];
|
|
141
|
+
nextCursor: string | null;
|
|
142
|
+
}>;
|
|
143
|
+
sharedDownloadUrl(args: {
|
|
144
|
+
scope: "org" | "team" | "project";
|
|
145
|
+
scopeId: string;
|
|
146
|
+
filePath: string;
|
|
147
|
+
}): Promise<{
|
|
148
|
+
downloadUrl: string;
|
|
149
|
+
expiresIn: number;
|
|
150
|
+
}>;
|
|
151
|
+
listIntegrations(): Promise<IntegrationInstall[]>;
|
|
152
|
+
getIntegrationConfig(integrationId: string): Promise<IntegrationConfigResult>;
|
|
153
|
+
updateIntegrationConfig(integrationId: string, config: Record<string, unknown>): Promise<void>;
|
|
154
|
+
installIntegration(integrationId: string, options?: {
|
|
155
|
+
version?: string;
|
|
156
|
+
config?: Record<string, unknown>;
|
|
157
|
+
}): Promise<IntegrationInstall>;
|
|
158
|
+
removeIntegration(integrationId: string): Promise<IntegrationInstall>;
|
|
159
|
+
getOAuthUrl(provider: string, scopes?: string[]): Promise<{
|
|
160
|
+
url: string;
|
|
161
|
+
provider: string;
|
|
162
|
+
expiresIn: number;
|
|
163
|
+
}>;
|
|
164
|
+
getOAuthStatus(provider: string): Promise<{
|
|
165
|
+
provider: string;
|
|
166
|
+
connected: boolean;
|
|
167
|
+
config?: Record<string, string>;
|
|
168
|
+
}>;
|
|
169
|
+
getRegistry(): Promise<{
|
|
170
|
+
integrations: RegistryEntry[];
|
|
171
|
+
}>;
|
|
172
|
+
/**
|
|
173
|
+
* Returns every connected Google account for the agent. Multi-account by
|
|
174
|
+
* design — the openclaw-google plugin requires the LLM to pass `email`
|
|
175
|
+
* explicitly to `google_run_command` so an account is always selected
|
|
176
|
+
* deliberately.
|
|
177
|
+
*
|
|
178
|
+
* 2026-05-14 (connections-redesign PR 1): the legacy flat shape (`email`,
|
|
179
|
+
* `refreshToken`, `accessToken`, etc., populated from the default account)
|
|
180
|
+
* is gone. Iterate over `accounts`.
|
|
181
|
+
*/
|
|
182
|
+
getGoogleCredentials(): Promise<{
|
|
183
|
+
accounts: {
|
|
184
|
+
email: string;
|
|
185
|
+
refreshToken: string;
|
|
186
|
+
clientId: string;
|
|
187
|
+
clientSecret: string;
|
|
188
|
+
displayName?: string;
|
|
189
|
+
connectedAt?: string;
|
|
190
|
+
}[];
|
|
191
|
+
}>;
|
|
192
|
+
disconnectGoogleAccount(email: string): Promise<{
|
|
193
|
+
accounts: {
|
|
194
|
+
email: string;
|
|
195
|
+
displayName?: string;
|
|
196
|
+
connectedAt?: string;
|
|
197
|
+
}[];
|
|
198
|
+
}>;
|
|
199
|
+
getGoogleChatCredentials(): Promise<{
|
|
200
|
+
email: string;
|
|
201
|
+
refreshToken: string;
|
|
202
|
+
clientId: string;
|
|
203
|
+
clientSecret: string;
|
|
204
|
+
displayName?: string;
|
|
205
|
+
}>;
|
|
206
|
+
getGithubCredentials(): Promise<{
|
|
207
|
+
login: string;
|
|
208
|
+
accessToken: string;
|
|
209
|
+
}>;
|
|
210
|
+
getXeroCredentials(): Promise<{
|
|
211
|
+
accessToken: string;
|
|
212
|
+
accessTokenExpiresAt: string;
|
|
213
|
+
xeroTenantId: string;
|
|
214
|
+
}>;
|
|
215
|
+
refreshXeroToken(): Promise<{
|
|
216
|
+
accessToken: string;
|
|
217
|
+
expiresAt: string;
|
|
218
|
+
}>;
|
|
219
|
+
getNotionCredentials(): Promise<{
|
|
220
|
+
accessToken: string;
|
|
221
|
+
workspaceId: string;
|
|
222
|
+
workspaceName: string;
|
|
223
|
+
}>;
|
|
224
|
+
getAtlassianCredentials(): Promise<{
|
|
225
|
+
accessToken: string;
|
|
226
|
+
refreshToken: string;
|
|
227
|
+
accessTokenExpiresAt: string;
|
|
228
|
+
cloudId: string;
|
|
229
|
+
siteName: string;
|
|
230
|
+
siteUrl: string;
|
|
231
|
+
email: string;
|
|
232
|
+
enabledProducts: string[];
|
|
233
|
+
clientId: string;
|
|
234
|
+
clientSecret: string;
|
|
235
|
+
}>;
|
|
236
|
+
refreshAtlassianToken(): Promise<{
|
|
237
|
+
accessToken: string;
|
|
238
|
+
expiresAt: string;
|
|
239
|
+
}>;
|
|
240
|
+
getMYOBCredentials(): Promise<{
|
|
241
|
+
accessToken: string;
|
|
242
|
+
accessTokenExpiresAt: string;
|
|
243
|
+
myobBusinessId: string;
|
|
244
|
+
clientId: string;
|
|
245
|
+
}>;
|
|
246
|
+
refreshMYOBToken(): Promise<{
|
|
247
|
+
accessToken: string;
|
|
248
|
+
expiresAt: string;
|
|
249
|
+
}>;
|
|
250
|
+
getTeamsCredentials(): Promise<{
|
|
251
|
+
agentId: string;
|
|
252
|
+
tenantId: string;
|
|
253
|
+
azureAppId: string;
|
|
254
|
+
azureBotId: string;
|
|
255
|
+
azureClientSecret: string;
|
|
256
|
+
botDisplayName?: string;
|
|
257
|
+
teamsTenantId?: string;
|
|
258
|
+
serviceUrl?: string;
|
|
259
|
+
}>;
|
|
260
|
+
sendTeamsMessage(data: {
|
|
261
|
+
conversationId: string;
|
|
262
|
+
text?: string;
|
|
263
|
+
adaptiveCard?: Record<string, unknown>;
|
|
264
|
+
}): Promise<{
|
|
265
|
+
ok: boolean;
|
|
266
|
+
activityId: string;
|
|
267
|
+
}>;
|
|
268
|
+
listTeamsChannels(): Promise<{
|
|
269
|
+
channels: {
|
|
270
|
+
id: string;
|
|
271
|
+
name: string;
|
|
272
|
+
description?: string;
|
|
273
|
+
}[];
|
|
274
|
+
}>;
|
|
275
|
+
presignAttachments(files: {
|
|
276
|
+
filename: string;
|
|
277
|
+
mimeType: string;
|
|
278
|
+
size: number;
|
|
279
|
+
}[]): Promise<{
|
|
280
|
+
attachments: {
|
|
281
|
+
id: string;
|
|
282
|
+
uploadUrl: string;
|
|
283
|
+
downloadUrl: string;
|
|
284
|
+
s3Key: string;
|
|
285
|
+
expiresAt: string;
|
|
286
|
+
}[];
|
|
287
|
+
}>;
|
|
288
|
+
recordActivity(data: {
|
|
289
|
+
userId?: string;
|
|
290
|
+
channel: string;
|
|
291
|
+
role: "user" | "assistant";
|
|
292
|
+
}): Promise<{
|
|
293
|
+
recorded: boolean;
|
|
294
|
+
}>;
|
|
295
|
+
/**
|
|
296
|
+
* Mint a fresh AES-256 data key for a specific (secret, field) pair. The
|
|
297
|
+
* encryption context is rebuilt server-side from `auth.tenantId` + the body
|
|
298
|
+
* fields including `fieldKey`; the agent cannot forge context for a scope
|
|
299
|
+
* or field it doesn't own. Legacy single-envelope secrets are migrated to
|
|
300
|
+
* `field#value` rows by the data migration, so call with `fieldKey: "value"`
|
|
301
|
+
* to reach them.
|
|
302
|
+
*/
|
|
303
|
+
generateSecretDataKey(args: {
|
|
304
|
+
scope: SecretScope;
|
|
305
|
+
scopeId: string;
|
|
306
|
+
secretId: string;
|
|
307
|
+
fieldKey: string;
|
|
308
|
+
}): Promise<GeneratedDataKey>;
|
|
309
|
+
/**
|
|
310
|
+
* Unwrap a wrapped data key so the agent can decrypt the envelope locally.
|
|
311
|
+
* `fieldKey` MUST match the value supplied when the data key was generated
|
|
312
|
+
* (it's bound into KMS encryption context); mismatch fails with
|
|
313
|
+
* `InvalidCiphertextException`.
|
|
314
|
+
*/
|
|
315
|
+
decryptSecretDataKey(args: {
|
|
316
|
+
scope: SecretScope;
|
|
317
|
+
scopeId: string;
|
|
318
|
+
secretId: string;
|
|
319
|
+
fieldKey: string;
|
|
320
|
+
dataKeyCiphertext: string;
|
|
321
|
+
}): Promise<{
|
|
322
|
+
plaintextKey: string;
|
|
323
|
+
}>;
|
|
324
|
+
/**
|
|
325
|
+
* Create a new secret with one or more fields. Encrypted fields must arrive
|
|
326
|
+
* pre-sealed (the agent has already obtained per-field data keys via
|
|
327
|
+
* `generateSecretDataKey({ ..., fieldKey })` and AES-encrypted locally).
|
|
328
|
+
* Plaintext fields ship the value inline.
|
|
329
|
+
*/
|
|
330
|
+
createSecret(args: {
|
|
331
|
+
scope: SecretScope;
|
|
332
|
+
scopeId: string;
|
|
333
|
+
secretId: string;
|
|
334
|
+
secretName: string;
|
|
335
|
+
category?: SecretCategory;
|
|
336
|
+
description?: string;
|
|
337
|
+
tags?: string[];
|
|
338
|
+
fields: {
|
|
339
|
+
key: string;
|
|
340
|
+
format?: FieldFormat;
|
|
341
|
+
sensitivity: FieldSensitivity;
|
|
342
|
+
value?: string;
|
|
343
|
+
envelope?: EncryptedEnvelopeV1;
|
|
344
|
+
}[];
|
|
345
|
+
reason?: string;
|
|
346
|
+
}): Promise<SecretAggregate>;
|
|
347
|
+
/** Fetch the secret aggregate plus per-field encrypted envelopes. */
|
|
348
|
+
getSecret(args: {
|
|
349
|
+
scope: SecretScope;
|
|
350
|
+
scopeId: string;
|
|
351
|
+
secretId: string;
|
|
352
|
+
}): Promise<{
|
|
353
|
+
aggregate: SecretAggregate;
|
|
354
|
+
envelopes: FieldEnvelope[];
|
|
355
|
+
}>;
|
|
356
|
+
/** Fetch one field. Plaintext: value inline. Encrypted: envelope. */
|
|
357
|
+
getSecretField(args: {
|
|
358
|
+
scope: SecretScope;
|
|
359
|
+
scopeId: string;
|
|
360
|
+
secretId: string;
|
|
361
|
+
fieldKey: string;
|
|
362
|
+
}): Promise<{
|
|
363
|
+
key: string;
|
|
364
|
+
sensitivity: FieldSensitivity;
|
|
365
|
+
format?: FieldFormat;
|
|
366
|
+
value?: string;
|
|
367
|
+
envelope?: EncryptedEnvelopeV1;
|
|
368
|
+
rotatedAt?: string;
|
|
369
|
+
createdAt: string;
|
|
370
|
+
updatedAt: string;
|
|
371
|
+
}>;
|
|
372
|
+
/** Add OR rotate one field. */
|
|
373
|
+
setSecretField(args: {
|
|
374
|
+
scope: SecretScope;
|
|
375
|
+
scopeId: string;
|
|
376
|
+
secretId: string;
|
|
377
|
+
fieldKey: string;
|
|
378
|
+
sensitivity: FieldSensitivity;
|
|
379
|
+
format?: FieldFormat;
|
|
380
|
+
value?: string;
|
|
381
|
+
envelope?: EncryptedEnvelopeV1;
|
|
382
|
+
reason?: string;
|
|
383
|
+
}): Promise<{
|
|
384
|
+
fieldKey: string;
|
|
385
|
+
rotated: boolean;
|
|
386
|
+
}>;
|
|
387
|
+
/** Remove one field. */
|
|
388
|
+
removeSecretField(args: {
|
|
389
|
+
scope: SecretScope;
|
|
390
|
+
scopeId: string;
|
|
391
|
+
secretId: string;
|
|
392
|
+
fieldKey: string;
|
|
393
|
+
}): Promise<void>;
|
|
394
|
+
/** Update secret-level metadata (name/description/tags/category). */
|
|
395
|
+
updateSecretMetadata(args: {
|
|
396
|
+
scope: SecretScope;
|
|
397
|
+
scopeId: string;
|
|
398
|
+
secretId: string;
|
|
399
|
+
secretName?: string;
|
|
400
|
+
description?: string;
|
|
401
|
+
tags?: string[];
|
|
402
|
+
category?: SecretCategory;
|
|
403
|
+
reason?: string;
|
|
404
|
+
}): Promise<SecretAggregate>;
|
|
405
|
+
/** List metadata for secrets in a scope. Optional filters route through the byFacet GSI. */
|
|
406
|
+
listSecrets(args: {
|
|
407
|
+
scope: SecretScope;
|
|
408
|
+
scopeId: string;
|
|
409
|
+
category?: SecretCategory;
|
|
410
|
+
tag?: string;
|
|
411
|
+
fieldKey?: string;
|
|
412
|
+
}): Promise<SecretMetadata[]>;
|
|
413
|
+
/** Bounded changelog read — metadata-only audit entries. */
|
|
414
|
+
getSecretHistory(args: {
|
|
415
|
+
scope: SecretScope;
|
|
416
|
+
scopeId: string;
|
|
417
|
+
secretId: string;
|
|
418
|
+
limit?: number;
|
|
419
|
+
cursor?: string;
|
|
420
|
+
}): Promise<{
|
|
421
|
+
entries: ChangelogEntry[];
|
|
422
|
+
nextCursor?: string;
|
|
423
|
+
}>;
|
|
424
|
+
/** Delete a secret (and all its field rows + tag rows + changelog rows). */
|
|
425
|
+
deleteSecret(args: {
|
|
426
|
+
scope: SecretScope;
|
|
427
|
+
scopeId: string;
|
|
428
|
+
secretId: string;
|
|
429
|
+
}): Promise<void>;
|
|
430
|
+
/** Enumerate scopes (org/team/project/agent) this agent can access. */
|
|
431
|
+
listSecretScopes(): Promise<ScopeInfo[]>;
|
|
432
|
+
/**
|
|
433
|
+
* Returns the calling agent's own identity context — `{ agentId, tenantId }`
|
|
434
|
+
* decoded server-side from the agent API token. Used by the
|
|
435
|
+
* `@alfe.ai/openclaw-identity` plugin to bootstrap context when the
|
|
436
|
+
* OpenClaw daemon doesn't plumb `ctx.agentId` through to plugin hooks.
|
|
437
|
+
* Plugins should cache this for the daemon's lifetime (single-agent-per-
|
|
438
|
+
* process invariant). One HTTP round-trip per process activate; not for
|
|
439
|
+
* per-call use.
|
|
440
|
+
*/
|
|
441
|
+
whoami(): Promise<{
|
|
442
|
+
agentId: string;
|
|
443
|
+
tenantId: string;
|
|
444
|
+
}>;
|
|
445
|
+
resolveIdentity(args: {
|
|
446
|
+
provider: string;
|
|
447
|
+
platformId: string;
|
|
448
|
+
kind?: "user" | "agent" | "service" | "bot" | "workspace";
|
|
449
|
+
displayName?: string;
|
|
450
|
+
}): Promise<{
|
|
451
|
+
identityId: string | null;
|
|
452
|
+
status: string;
|
|
453
|
+
created?: boolean;
|
|
454
|
+
reason?: string;
|
|
455
|
+
/**
|
|
456
|
+
* Flattened auriclabs permission strings for the resolved identity
|
|
457
|
+
* (scope-prefixed where applicable). Empty array on miss / org service
|
|
458
|
+
* outage — the runtime gate fails closed in that case.
|
|
459
|
+
*/
|
|
460
|
+
permissions: string[];
|
|
461
|
+
}>;
|
|
462
|
+
searchIdentities(args?: {
|
|
463
|
+
q?: string;
|
|
464
|
+
status?: string;
|
|
465
|
+
limit?: number;
|
|
466
|
+
}): Promise<{
|
|
467
|
+
identities: unknown[];
|
|
468
|
+
}>;
|
|
469
|
+
getIdentityContext(identityId: string): Promise<{
|
|
470
|
+
context: unknown;
|
|
471
|
+
}>;
|
|
472
|
+
mergeIdentities(survivorId: string, args: {
|
|
473
|
+
mergedId: string;
|
|
474
|
+
changedBy: {
|
|
475
|
+
type: string;
|
|
476
|
+
id: string;
|
|
477
|
+
name?: string;
|
|
478
|
+
};
|
|
479
|
+
}): Promise<{
|
|
480
|
+
ok: boolean;
|
|
481
|
+
error?: string;
|
|
482
|
+
}>;
|
|
483
|
+
unmergeIdentity(identityId: string, args: {
|
|
484
|
+
changedBy: {
|
|
485
|
+
type: string;
|
|
486
|
+
id: string;
|
|
487
|
+
name?: string;
|
|
488
|
+
};
|
|
489
|
+
}): Promise<{
|
|
490
|
+
ok: boolean;
|
|
491
|
+
error?: string;
|
|
492
|
+
}>;
|
|
493
|
+
addIdentityNote(identityId: string, args: {
|
|
494
|
+
content: string;
|
|
495
|
+
category?: string;
|
|
496
|
+
changedBy: {
|
|
497
|
+
type: string;
|
|
498
|
+
id: string;
|
|
499
|
+
name?: string;
|
|
500
|
+
};
|
|
501
|
+
}): Promise<{
|
|
502
|
+
noteId: string | null;
|
|
503
|
+
}>;
|
|
504
|
+
tagIdentity(identityId: string, args: {
|
|
505
|
+
tag: string;
|
|
506
|
+
action: "add" | "remove";
|
|
507
|
+
changedBy: {
|
|
508
|
+
type: string;
|
|
509
|
+
id: string;
|
|
510
|
+
name?: string;
|
|
511
|
+
};
|
|
512
|
+
}): Promise<{
|
|
513
|
+
ok: boolean;
|
|
514
|
+
}>;
|
|
515
|
+
getIdentityChangelog(identityId: string, args?: {
|
|
516
|
+
limit?: number;
|
|
517
|
+
}): Promise<{
|
|
518
|
+
entries: unknown[];
|
|
519
|
+
}>;
|
|
520
|
+
rollbackIdentity(identityId: string, args: {
|
|
521
|
+
targetVersion: number;
|
|
522
|
+
changedBy: {
|
|
523
|
+
type: string;
|
|
524
|
+
id: string;
|
|
525
|
+
name?: string;
|
|
526
|
+
};
|
|
527
|
+
}): Promise<{
|
|
528
|
+
ok: boolean;
|
|
529
|
+
entry?: unknown;
|
|
530
|
+
}>;
|
|
531
|
+
requestIdentityVerification(args: {
|
|
532
|
+
claimedIdentityId: string;
|
|
533
|
+
requestingIdentityId: string;
|
|
534
|
+
requestingProvider: string;
|
|
535
|
+
requestingPlatformId: string;
|
|
536
|
+
preferredChannel?: "mobile" | "email";
|
|
537
|
+
/**
|
|
538
|
+
* Phase 2: agent-supplied contact endpoint. When provided, the top-level
|
|
539
|
+
* `preferredChannel` is ignored — the contact's channel wins.
|
|
540
|
+
*/
|
|
541
|
+
contact?: {
|
|
542
|
+
channel: "email" | "mobile";
|
|
543
|
+
value: string;
|
|
544
|
+
};
|
|
545
|
+
}): Promise<{
|
|
546
|
+
verificationId: string;
|
|
547
|
+
channel: string;
|
|
548
|
+
deliveredTo: string;
|
|
549
|
+
expiresAt: string;
|
|
550
|
+
availableChannels: {
|
|
551
|
+
channel: string;
|
|
552
|
+
deliveredTo: string;
|
|
553
|
+
}[];
|
|
554
|
+
} | {
|
|
555
|
+
error: string;
|
|
556
|
+
}>;
|
|
557
|
+
confirmIdentityVerification(args: {
|
|
558
|
+
claimedIdentityId: string;
|
|
559
|
+
verificationId: string;
|
|
560
|
+
phrase: string;
|
|
561
|
+
}): Promise<{
|
|
562
|
+
verified: boolean;
|
|
563
|
+
identityId?: string;
|
|
564
|
+
/** Phase 2: how the confirm resolved — Scenario A vs B. */
|
|
565
|
+
action?: "merged" | "contact_verified";
|
|
566
|
+
error?: string;
|
|
567
|
+
}>;
|
|
568
|
+
/**
|
|
569
|
+
* Update display-shape fields on an Identity. Body excludes `email` /
|
|
570
|
+
* `phone` / `title` / `company` / `metadata` per Section D4 — contacts go
|
|
571
|
+
* via the verify flow, title/company live on OrgMembership, metadata is
|
|
572
|
+
* not agent-writable.
|
|
573
|
+
*/
|
|
574
|
+
updateIdentity(identityId: string, args: {
|
|
575
|
+
name?: string;
|
|
576
|
+
avatarUrl?: string;
|
|
577
|
+
timezone?: string;
|
|
578
|
+
locale?: string;
|
|
579
|
+
}): Promise<{
|
|
580
|
+
ok: boolean;
|
|
581
|
+
}>;
|
|
582
|
+
/**
|
|
583
|
+
* Phase 2 (Section H): server-side verification of a Google Chat sender via
|
|
584
|
+
* the agent's existing Google OAuth credentials. Returns the resolved
|
|
585
|
+
* identity (created or matched via Scenario-B email enrichment).
|
|
586
|
+
*/
|
|
587
|
+
resolveGoogleChatSender(args: {
|
|
588
|
+
senderUserId: string;
|
|
589
|
+
spaceId?: string;
|
|
590
|
+
}): Promise<{
|
|
591
|
+
identityId: string | null;
|
|
592
|
+
status: string;
|
|
593
|
+
}>;
|
|
594
|
+
memorySearch(query: string, opts?: {
|
|
595
|
+
limit?: number;
|
|
596
|
+
topic?: string;
|
|
597
|
+
subtopic?: string;
|
|
598
|
+
tag?: string;
|
|
599
|
+
includeKnowledge?: boolean;
|
|
600
|
+
}): Promise<{
|
|
601
|
+
facts: {
|
|
602
|
+
subject: string;
|
|
603
|
+
predicate: string;
|
|
604
|
+
object: string;
|
|
605
|
+
since: string;
|
|
606
|
+
confidence: number;
|
|
607
|
+
}[];
|
|
608
|
+
memories: {
|
|
609
|
+
id: string;
|
|
610
|
+
text: string;
|
|
611
|
+
topic: string;
|
|
612
|
+
subtopic: string;
|
|
613
|
+
tag: string;
|
|
614
|
+
importance: number;
|
|
615
|
+
timestamp: number;
|
|
616
|
+
score: number;
|
|
617
|
+
}[];
|
|
618
|
+
}>;
|
|
619
|
+
memoryStore(text: string, opts?: {
|
|
620
|
+
topic?: string;
|
|
621
|
+
subtopic?: string;
|
|
622
|
+
tag?: string;
|
|
623
|
+
importance?: number;
|
|
624
|
+
}): Promise<{
|
|
625
|
+
memoryId: string;
|
|
626
|
+
}>;
|
|
627
|
+
memoryIngest(sessionKey: string, messages: {
|
|
628
|
+
role: string;
|
|
629
|
+
content: string;
|
|
630
|
+
index: number;
|
|
631
|
+
timestamp?: string;
|
|
632
|
+
}[], metadata?: {
|
|
633
|
+
channelId?: string;
|
|
634
|
+
userId?: string;
|
|
635
|
+
userName?: string;
|
|
636
|
+
}): Promise<{
|
|
637
|
+
queued: boolean;
|
|
638
|
+
messageCount: number;
|
|
639
|
+
}>;
|
|
640
|
+
memoryLoadContext(tier?: number, topicHint?: string): Promise<{
|
|
641
|
+
formatted: string;
|
|
642
|
+
[key: string]: unknown;
|
|
643
|
+
}>;
|
|
644
|
+
memoryLookupEntity(subject: string): Promise<{
|
|
645
|
+
subject: string;
|
|
646
|
+
triples: {
|
|
647
|
+
tripleId: string;
|
|
648
|
+
predicate: string;
|
|
649
|
+
object: string;
|
|
650
|
+
validFrom: string;
|
|
651
|
+
validTo?: string;
|
|
652
|
+
confidence: number;
|
|
653
|
+
}[];
|
|
654
|
+
}>;
|
|
655
|
+
memoryNavigate(): Promise<{
|
|
656
|
+
topics: {
|
|
657
|
+
name: string;
|
|
658
|
+
tripleCount: number;
|
|
659
|
+
subtopics: string[];
|
|
660
|
+
}[];
|
|
661
|
+
cursor: string | null;
|
|
662
|
+
}>;
|
|
663
|
+
memoryDelete(memoryId: string): Promise<{
|
|
664
|
+
deleted: boolean;
|
|
665
|
+
}>;
|
|
666
|
+
memoryStats(): Promise<{
|
|
667
|
+
vectorCount: number;
|
|
668
|
+
tripleCount: number;
|
|
669
|
+
storageEstimateBytes: number;
|
|
670
|
+
lastIngestionAt?: string;
|
|
671
|
+
}>;
|
|
672
|
+
memoryLearn(args: {
|
|
673
|
+
text: string;
|
|
674
|
+
source?: string;
|
|
675
|
+
sourceType?: "file" | "url" | "inline";
|
|
676
|
+
metadata?: {
|
|
677
|
+
sessionId?: string;
|
|
678
|
+
channelId?: string;
|
|
679
|
+
userName?: string;
|
|
680
|
+
};
|
|
681
|
+
}): Promise<{
|
|
682
|
+
memoriesStored: number;
|
|
683
|
+
triplesStored: number;
|
|
684
|
+
chunks: number;
|
|
685
|
+
source?: string;
|
|
686
|
+
}>;
|
|
687
|
+
memoryBootstrapStatus(): Promise<{
|
|
688
|
+
synced: boolean;
|
|
689
|
+
syncedAt?: string;
|
|
690
|
+
}>;
|
|
691
|
+
memoryBootstrapStatusMark(): Promise<{
|
|
692
|
+
synced: true;
|
|
693
|
+
syncedAt: string;
|
|
694
|
+
}>;
|
|
695
|
+
searchWeb(params: {
|
|
696
|
+
query: string;
|
|
697
|
+
count?: number;
|
|
698
|
+
offset?: number;
|
|
699
|
+
country?: string;
|
|
700
|
+
freshness?: string;
|
|
701
|
+
}): Promise<unknown>;
|
|
702
|
+
searchImages(params: {
|
|
703
|
+
query: string;
|
|
704
|
+
count?: number;
|
|
705
|
+
}): Promise<unknown>;
|
|
706
|
+
searchNews(params: {
|
|
707
|
+
query: string;
|
|
708
|
+
count?: number;
|
|
709
|
+
freshness?: string;
|
|
710
|
+
}): Promise<unknown>;
|
|
711
|
+
registerDatabaseCredentials(): Promise<{
|
|
712
|
+
connectionString: string;
|
|
713
|
+
username: string;
|
|
714
|
+
password: string;
|
|
715
|
+
databases: string[];
|
|
716
|
+
}>;
|
|
717
|
+
reportDatabaseAudit(entry: {
|
|
718
|
+
database: string;
|
|
719
|
+
collection: string;
|
|
720
|
+
operation: string;
|
|
721
|
+
summary?: string;
|
|
722
|
+
}): Promise<void>;
|
|
723
|
+
}
|
|
724
|
+
//# sourceMappingURL=index.d.ts.map
|
|
725
|
+
//#endregion
|
|
726
|
+
//#endregion
|
|
727
|
+
//#region src/index.d.ts
|
|
728
|
+
/**
|
|
729
|
+
* Wire shape the bundler advertises this server as — must match the
|
|
730
|
+
* key the CLI registers (`alfe-platform`) so namespacing is consistent
|
|
731
|
+
* across components.
|
|
732
|
+
*/
|
|
733
|
+
declare const SERVER_NAME = "alfe-platform";
|
|
734
|
+
/**
|
|
735
|
+
* Single source of truth for the server's own version, read straight
|
|
736
|
+
* from package.json so it can't drift with bumps. The CLI's
|
|
737
|
+
* version-drift hook compares this against the entry stored in
|
|
738
|
+
* `~/.alfe/mcp/servers.json` and re-resolves the command path when
|
|
739
|
+
* they diverge (e.g. after an `npm install -g @alfe.ai/cli`).
|
|
740
|
+
*/
|
|
741
|
+
declare const SERVER_VERSION: string;
|
|
742
|
+
interface ServerOptions {
|
|
743
|
+
/**
|
|
744
|
+
* Optional override for the API client — tests inject a fake so the
|
|
745
|
+
* server can be exercised end-to-end without real network I/O.
|
|
746
|
+
*/
|
|
747
|
+
client?: AgentApiClient;
|
|
748
|
+
/** Pre-resolved context fields. If omitted, the server calls `whoami()` itself. */
|
|
749
|
+
identity?: {
|
|
750
|
+
agentId: string;
|
|
751
|
+
tenantId: string;
|
|
752
|
+
};
|
|
753
|
+
/** Override apiUrl reported in the ToolContext. Defaults to the resolved CLI config. */
|
|
754
|
+
apiUrl?: string;
|
|
755
|
+
}
|
|
756
|
+
/**
|
|
757
|
+
* Build a configured `McpServer` with all thin-slice tools registered.
|
|
758
|
+
* Pure construction — does not connect a transport. Callers (the bin
|
|
759
|
+
* entry, or tests) attach `StdioServerTransport` or any other transport.
|
|
760
|
+
*
|
|
761
|
+
* `resolveConfig()` is only called when neither `client` nor `apiUrl`
|
|
762
|
+
* is provided — tests can fully construct the server without touching
|
|
763
|
+
* `~/.alfe/config.toml`.
|
|
764
|
+
*/
|
|
765
|
+
declare function createServer(opts?: ServerOptions): Promise<McpServer>;
|
|
766
|
+
/**
|
|
767
|
+
* Entry point — boot the server on stdio. Used by `bin.ts`. Any
|
|
768
|
+
* startup failure is fatal: log and exit non-zero so the bundler's
|
|
769
|
+
* connection attempt surfaces a clear error rather than a hung
|
|
770
|
+
* handshake.
|
|
771
|
+
*/
|
|
772
|
+
declare function main(): Promise<void>;
|
|
773
|
+
//# sourceMappingURL=index.d.ts.map
|
|
774
|
+
|
|
775
|
+
//#endregion
|
|
776
|
+
export { SERVER_NAME, SERVER_VERSION, ServerOptions, createServer, main };
|
|
777
|
+
//# sourceMappingURL=index.d.cts.map
|