@agentcall/mcp-server 0.4.21 → 0.6.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/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/schemas.d.ts +407 -0
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +173 -0
- package/dist/schemas.js.map +1 -1
- package/dist/tools/memory.d.ts +14 -0
- package/dist/tools/memory.d.ts.map +1 -0
- package/dist/tools/memory.js +561 -0
- package/dist/tools/memory.js.map +1 -0
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -8,6 +8,7 @@ import { registerSMSTools } from "./tools/sms.js";
|
|
|
8
8
|
import { registerCallTools } from "./tools/calls.js";
|
|
9
9
|
import { registerWebhookTools } from "./tools/webhooks.js";
|
|
10
10
|
import { registerUsageTools } from "./tools/usage.js";
|
|
11
|
+
import { registerMemoryTools } from "./tools/memory.js";
|
|
11
12
|
function getApiKey() {
|
|
12
13
|
// Check CLI args: --api-key <key>
|
|
13
14
|
const args = process.argv.slice(2);
|
|
@@ -36,7 +37,7 @@ async function main() {
|
|
|
36
37
|
// hover/inspection; keep in sync with package.json on every release.
|
|
37
38
|
const server = new McpServer({
|
|
38
39
|
name: "agentcall",
|
|
39
|
-
version: "0.
|
|
40
|
+
version: "0.6.0",
|
|
40
41
|
});
|
|
41
42
|
// Register all tools
|
|
42
43
|
registerNumberTools(server, client);
|
|
@@ -44,6 +45,7 @@ async function main() {
|
|
|
44
45
|
registerCallTools(server, client);
|
|
45
46
|
registerWebhookTools(server, client);
|
|
46
47
|
registerUsageTools(server, client);
|
|
48
|
+
registerMemoryTools(server, client);
|
|
47
49
|
// Register prompts
|
|
48
50
|
server.prompt("setup-agent-phone", "Provision a phone number and configure it for an AI agent", {
|
|
49
51
|
use_case: z.string().describe("What the number will be used for (e.g. 'OTP verification', 'customer support', 'appointment reminders')"),
|
|
@@ -115,7 +117,7 @@ async function main() {
|
|
|
115
117
|
// Connect via stdio transport
|
|
116
118
|
const transport = new StdioServerTransport();
|
|
117
119
|
await server.connect(transport);
|
|
118
|
-
console.error("AgentCall MCP server running (
|
|
120
|
+
console.error("AgentCall MCP server running (42 tools, 4 prompts registered)");
|
|
119
121
|
}
|
|
120
122
|
main().catch((err) => {
|
|
121
123
|
console.error("Fatal error:", err);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,O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C,CAAC,CAAC"}
|
package/dist/schemas.d.ts
CHANGED
|
@@ -302,4 +302,411 @@ export declare const ackOutputSchema: {
|
|
|
302
302
|
success: z.ZodBoolean;
|
|
303
303
|
message: z.ZodString;
|
|
304
304
|
};
|
|
305
|
+
export declare const contactOutputSchema: {
|
|
306
|
+
id: z.ZodString;
|
|
307
|
+
phone: z.ZodString;
|
|
308
|
+
displayName: z.ZodNullable<z.ZodString>;
|
|
309
|
+
tags: z.ZodArray<z.ZodString, "many">;
|
|
310
|
+
ownerNotes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
311
|
+
verified: z.ZodBoolean;
|
|
312
|
+
blockedAt: z.ZodNullable<z.ZodString>;
|
|
313
|
+
callCount: z.ZodNumber;
|
|
314
|
+
firstSeenAt: z.ZodString;
|
|
315
|
+
lastSeenAt: z.ZodString;
|
|
316
|
+
};
|
|
317
|
+
export declare const contactListOutputSchema: {
|
|
318
|
+
data: z.ZodArray<z.ZodObject<{
|
|
319
|
+
id: z.ZodString;
|
|
320
|
+
phone: z.ZodString;
|
|
321
|
+
displayName: z.ZodNullable<z.ZodString>;
|
|
322
|
+
tags: z.ZodArray<z.ZodString, "many">;
|
|
323
|
+
ownerNotes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
324
|
+
verified: z.ZodBoolean;
|
|
325
|
+
blockedAt: z.ZodNullable<z.ZodString>;
|
|
326
|
+
callCount: z.ZodNumber;
|
|
327
|
+
firstSeenAt: z.ZodString;
|
|
328
|
+
lastSeenAt: z.ZodString;
|
|
329
|
+
}, "strip", z.ZodTypeAny, {
|
|
330
|
+
id: string;
|
|
331
|
+
phone: string;
|
|
332
|
+
displayName: string | null;
|
|
333
|
+
tags: string[];
|
|
334
|
+
verified: boolean;
|
|
335
|
+
blockedAt: string | null;
|
|
336
|
+
callCount: number;
|
|
337
|
+
firstSeenAt: string;
|
|
338
|
+
lastSeenAt: string;
|
|
339
|
+
ownerNotes?: string | null | undefined;
|
|
340
|
+
}, {
|
|
341
|
+
id: string;
|
|
342
|
+
phone: string;
|
|
343
|
+
displayName: string | null;
|
|
344
|
+
tags: string[];
|
|
345
|
+
verified: boolean;
|
|
346
|
+
blockedAt: string | null;
|
|
347
|
+
callCount: number;
|
|
348
|
+
firstSeenAt: string;
|
|
349
|
+
lastSeenAt: string;
|
|
350
|
+
ownerNotes?: string | null | undefined;
|
|
351
|
+
}>, "many">;
|
|
352
|
+
hasMore: z.ZodBoolean;
|
|
353
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
354
|
+
};
|
|
355
|
+
export declare const nextCallContextOutputSchema: {
|
|
356
|
+
contactId: z.ZodString;
|
|
357
|
+
phone: z.ZodString;
|
|
358
|
+
numberId: z.ZodString;
|
|
359
|
+
contextBlock: z.ZodString;
|
|
360
|
+
contextBlockChars: z.ZodNumber;
|
|
361
|
+
isEmpty: z.ZodBoolean;
|
|
362
|
+
};
|
|
363
|
+
export declare const memoryOutputSchema: {
|
|
364
|
+
id: z.ZodString;
|
|
365
|
+
scope: z.ZodString;
|
|
366
|
+
scopeKey: z.ZodString;
|
|
367
|
+
type: z.ZodString;
|
|
368
|
+
slug: z.ZodString;
|
|
369
|
+
text: z.ZodString;
|
|
370
|
+
confidence: z.ZodNumber;
|
|
371
|
+
sourceReportIds: z.ZodArray<z.ZodString, "many">;
|
|
372
|
+
lastEvidenceQuote: z.ZodNullable<z.ZodString>;
|
|
373
|
+
contactId: z.ZodNullable<z.ZodString>;
|
|
374
|
+
numberId: z.ZodNullable<z.ZodString>;
|
|
375
|
+
active: z.ZodOptional<z.ZodBoolean>;
|
|
376
|
+
expiresAt: z.ZodNullable<z.ZodString>;
|
|
377
|
+
createdAt: z.ZodString;
|
|
378
|
+
updatedAt: z.ZodString;
|
|
379
|
+
};
|
|
380
|
+
export declare const memoryListOutputSchema: {
|
|
381
|
+
data: z.ZodArray<z.ZodObject<{
|
|
382
|
+
id: z.ZodString;
|
|
383
|
+
scope: z.ZodString;
|
|
384
|
+
scopeKey: z.ZodString;
|
|
385
|
+
type: z.ZodString;
|
|
386
|
+
slug: z.ZodString;
|
|
387
|
+
text: z.ZodString;
|
|
388
|
+
confidence: z.ZodNumber;
|
|
389
|
+
sourceReportIds: z.ZodArray<z.ZodString, "many">;
|
|
390
|
+
lastEvidenceQuote: z.ZodNullable<z.ZodString>;
|
|
391
|
+
contactId: z.ZodNullable<z.ZodString>;
|
|
392
|
+
numberId: z.ZodNullable<z.ZodString>;
|
|
393
|
+
active: z.ZodOptional<z.ZodBoolean>;
|
|
394
|
+
expiresAt: z.ZodNullable<z.ZodString>;
|
|
395
|
+
createdAt: z.ZodString;
|
|
396
|
+
updatedAt: z.ZodString;
|
|
397
|
+
}, "strip", z.ZodTypeAny, {
|
|
398
|
+
type: string;
|
|
399
|
+
id: string;
|
|
400
|
+
createdAt: string;
|
|
401
|
+
text: string;
|
|
402
|
+
scope: string;
|
|
403
|
+
scopeKey: string;
|
|
404
|
+
slug: string;
|
|
405
|
+
confidence: number;
|
|
406
|
+
sourceReportIds: string[];
|
|
407
|
+
lastEvidenceQuote: string | null;
|
|
408
|
+
contactId: string | null;
|
|
409
|
+
numberId: string | null;
|
|
410
|
+
expiresAt: string | null;
|
|
411
|
+
updatedAt: string;
|
|
412
|
+
active?: boolean | undefined;
|
|
413
|
+
}, {
|
|
414
|
+
type: string;
|
|
415
|
+
id: string;
|
|
416
|
+
createdAt: string;
|
|
417
|
+
text: string;
|
|
418
|
+
scope: string;
|
|
419
|
+
scopeKey: string;
|
|
420
|
+
slug: string;
|
|
421
|
+
confidence: number;
|
|
422
|
+
sourceReportIds: string[];
|
|
423
|
+
lastEvidenceQuote: string | null;
|
|
424
|
+
contactId: string | null;
|
|
425
|
+
numberId: string | null;
|
|
426
|
+
expiresAt: string | null;
|
|
427
|
+
updatedAt: string;
|
|
428
|
+
active?: boolean | undefined;
|
|
429
|
+
}>, "many">;
|
|
430
|
+
};
|
|
431
|
+
export declare const memoryTimelineOutputSchema: {
|
|
432
|
+
memoryId: z.ZodString;
|
|
433
|
+
events: z.ZodArray<z.ZodObject<{
|
|
434
|
+
id: z.ZodString;
|
|
435
|
+
action: z.ZodString;
|
|
436
|
+
actor: z.ZodString;
|
|
437
|
+
before: z.ZodNullable<z.ZodUnknown>;
|
|
438
|
+
after: z.ZodNullable<z.ZodUnknown>;
|
|
439
|
+
reportId: z.ZodNullable<z.ZodString>;
|
|
440
|
+
note: z.ZodNullable<z.ZodString>;
|
|
441
|
+
createdAt: z.ZodString;
|
|
442
|
+
}, "strip", z.ZodTypeAny, {
|
|
443
|
+
id: string;
|
|
444
|
+
createdAt: string;
|
|
445
|
+
action: string;
|
|
446
|
+
actor: string;
|
|
447
|
+
reportId: string | null;
|
|
448
|
+
note: string | null;
|
|
449
|
+
before?: unknown;
|
|
450
|
+
after?: unknown;
|
|
451
|
+
}, {
|
|
452
|
+
id: string;
|
|
453
|
+
createdAt: string;
|
|
454
|
+
action: string;
|
|
455
|
+
actor: string;
|
|
456
|
+
reportId: string | null;
|
|
457
|
+
note: string | null;
|
|
458
|
+
before?: unknown;
|
|
459
|
+
after?: unknown;
|
|
460
|
+
}>, "many">;
|
|
461
|
+
};
|
|
462
|
+
export declare const memoryCandidatesListOutputSchema: {
|
|
463
|
+
data: z.ZodArray<z.ZodObject<{
|
|
464
|
+
id: z.ZodString;
|
|
465
|
+
reportId: z.ZodString;
|
|
466
|
+
contactId: z.ZodNullable<z.ZodString>;
|
|
467
|
+
type: z.ZodString;
|
|
468
|
+
scope: z.ZodString;
|
|
469
|
+
slug: z.ZodNullable<z.ZodString>;
|
|
470
|
+
text: z.ZodString;
|
|
471
|
+
confidence: z.ZodNumber;
|
|
472
|
+
evidenceQuote: z.ZodString;
|
|
473
|
+
status: z.ZodString;
|
|
474
|
+
appliedToMemoryId: z.ZodNullable<z.ZodString>;
|
|
475
|
+
resolvedAt: z.ZodNullable<z.ZodString>;
|
|
476
|
+
resolvedBy: z.ZodNullable<z.ZodString>;
|
|
477
|
+
createdAt: z.ZodString;
|
|
478
|
+
}, "strip", z.ZodTypeAny, {
|
|
479
|
+
type: string;
|
|
480
|
+
status: string;
|
|
481
|
+
id: string;
|
|
482
|
+
createdAt: string;
|
|
483
|
+
text: string;
|
|
484
|
+
scope: string;
|
|
485
|
+
slug: string | null;
|
|
486
|
+
confidence: number;
|
|
487
|
+
contactId: string | null;
|
|
488
|
+
reportId: string;
|
|
489
|
+
evidenceQuote: string;
|
|
490
|
+
appliedToMemoryId: string | null;
|
|
491
|
+
resolvedAt: string | null;
|
|
492
|
+
resolvedBy: string | null;
|
|
493
|
+
}, {
|
|
494
|
+
type: string;
|
|
495
|
+
status: string;
|
|
496
|
+
id: string;
|
|
497
|
+
createdAt: string;
|
|
498
|
+
text: string;
|
|
499
|
+
scope: string;
|
|
500
|
+
slug: string | null;
|
|
501
|
+
confidence: number;
|
|
502
|
+
contactId: string | null;
|
|
503
|
+
reportId: string;
|
|
504
|
+
evidenceQuote: string;
|
|
505
|
+
appliedToMemoryId: string | null;
|
|
506
|
+
resolvedAt: string | null;
|
|
507
|
+
resolvedBy: string | null;
|
|
508
|
+
}>, "many">;
|
|
509
|
+
hasMore: z.ZodBoolean;
|
|
510
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
511
|
+
};
|
|
512
|
+
export declare const reportsListOutputSchema: {
|
|
513
|
+
data: z.ZodArray<z.ZodObject<{
|
|
514
|
+
id: z.ZodString;
|
|
515
|
+
callId: z.ZodString;
|
|
516
|
+
contactId: z.ZodNullable<z.ZodString>;
|
|
517
|
+
intent: z.ZodNullable<z.ZodString>;
|
|
518
|
+
urgency: z.ZodNullable<z.ZodString>;
|
|
519
|
+
spam: z.ZodBoolean;
|
|
520
|
+
briefWorthy: z.ZodBoolean;
|
|
521
|
+
extractorVersion: z.ZodString;
|
|
522
|
+
generatedAt: z.ZodString;
|
|
523
|
+
redactedAt: z.ZodNullable<z.ZodString>;
|
|
524
|
+
}, "strip", z.ZodTypeAny, {
|
|
525
|
+
id: string;
|
|
526
|
+
contactId: string | null;
|
|
527
|
+
callId: string;
|
|
528
|
+
intent: string | null;
|
|
529
|
+
urgency: string | null;
|
|
530
|
+
spam: boolean;
|
|
531
|
+
briefWorthy: boolean;
|
|
532
|
+
extractorVersion: string;
|
|
533
|
+
generatedAt: string;
|
|
534
|
+
redactedAt: string | null;
|
|
535
|
+
}, {
|
|
536
|
+
id: string;
|
|
537
|
+
contactId: string | null;
|
|
538
|
+
callId: string;
|
|
539
|
+
intent: string | null;
|
|
540
|
+
urgency: string | null;
|
|
541
|
+
spam: boolean;
|
|
542
|
+
briefWorthy: boolean;
|
|
543
|
+
extractorVersion: string;
|
|
544
|
+
generatedAt: string;
|
|
545
|
+
redactedAt: string | null;
|
|
546
|
+
}>, "many">;
|
|
547
|
+
hasMore: z.ZodBoolean;
|
|
548
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
549
|
+
};
|
|
550
|
+
export declare const purgeContactOutputSchema: {
|
|
551
|
+
contactId: z.ZodString;
|
|
552
|
+
memoriesDeleted: z.ZodNumber;
|
|
553
|
+
candidatesDeleted: z.ZodNumber;
|
|
554
|
+
briefsDeleted: z.ZodNumber;
|
|
555
|
+
reportsRedacted: z.ZodNumber;
|
|
556
|
+
};
|
|
557
|
+
export declare const approveCandidateOutputSchema: {
|
|
558
|
+
id: z.ZodString;
|
|
559
|
+
status: z.ZodLiteral<"applied">;
|
|
560
|
+
memoryId: z.ZodString;
|
|
561
|
+
action: z.ZodEnum<["created", "corroborated", "superseded"]>;
|
|
562
|
+
supersededMemoryId: z.ZodOptional<z.ZodString>;
|
|
563
|
+
alreadyApplied: z.ZodOptional<z.ZodBoolean>;
|
|
564
|
+
};
|
|
565
|
+
export declare const briefsListOutputSchema: {
|
|
566
|
+
data: z.ZodArray<z.ZodObject<{
|
|
567
|
+
id: z.ZodString;
|
|
568
|
+
reportId: z.ZodString;
|
|
569
|
+
contactId: z.ZodNullable<z.ZodString>;
|
|
570
|
+
numberId: z.ZodNullable<z.ZodString>;
|
|
571
|
+
type: z.ZodString;
|
|
572
|
+
title: z.ZodString;
|
|
573
|
+
detail: z.ZodString;
|
|
574
|
+
urgency: z.ZodString;
|
|
575
|
+
status: z.ZodString;
|
|
576
|
+
acknowledgedAt: z.ZodNullable<z.ZodString>;
|
|
577
|
+
resolvedAt: z.ZodNullable<z.ZodString>;
|
|
578
|
+
createdAt: z.ZodString;
|
|
579
|
+
updatedAt: z.ZodString;
|
|
580
|
+
}, "strip", z.ZodTypeAny, {
|
|
581
|
+
type: string;
|
|
582
|
+
status: string;
|
|
583
|
+
id: string;
|
|
584
|
+
createdAt: string;
|
|
585
|
+
contactId: string | null;
|
|
586
|
+
numberId: string | null;
|
|
587
|
+
updatedAt: string;
|
|
588
|
+
reportId: string;
|
|
589
|
+
resolvedAt: string | null;
|
|
590
|
+
urgency: string;
|
|
591
|
+
title: string;
|
|
592
|
+
detail: string;
|
|
593
|
+
acknowledgedAt: string | null;
|
|
594
|
+
}, {
|
|
595
|
+
type: string;
|
|
596
|
+
status: string;
|
|
597
|
+
id: string;
|
|
598
|
+
createdAt: string;
|
|
599
|
+
contactId: string | null;
|
|
600
|
+
numberId: string | null;
|
|
601
|
+
updatedAt: string;
|
|
602
|
+
reportId: string;
|
|
603
|
+
resolvedAt: string | null;
|
|
604
|
+
urgency: string;
|
|
605
|
+
title: string;
|
|
606
|
+
detail: string;
|
|
607
|
+
acknowledgedAt: string | null;
|
|
608
|
+
}>, "many">;
|
|
609
|
+
hasMore: z.ZodBoolean;
|
|
610
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
611
|
+
};
|
|
612
|
+
export declare const briefAckOutputSchema: {
|
|
613
|
+
id: z.ZodString;
|
|
614
|
+
status: z.ZodString;
|
|
615
|
+
acknowledgedAt: z.ZodNullable<z.ZodString>;
|
|
616
|
+
};
|
|
617
|
+
export declare const briefResolveOutputSchema: {
|
|
618
|
+
id: z.ZodString;
|
|
619
|
+
status: z.ZodLiteral<"resolved">;
|
|
620
|
+
resolvedAt: z.ZodString;
|
|
621
|
+
};
|
|
622
|
+
export declare const callReportOutputSchema: {
|
|
623
|
+
callId: z.ZodString;
|
|
624
|
+
reportId: z.ZodString;
|
|
625
|
+
generatedAt: z.ZodString;
|
|
626
|
+
direction: z.ZodString;
|
|
627
|
+
from: z.ZodString;
|
|
628
|
+
to: z.ZodString;
|
|
629
|
+
duration: z.ZodNullable<z.ZodNumber>;
|
|
630
|
+
contact: z.ZodNullable<z.ZodObject<{
|
|
631
|
+
id: z.ZodString;
|
|
632
|
+
phone: z.ZodString;
|
|
633
|
+
displayName: z.ZodNullable<z.ZodString>;
|
|
634
|
+
verified: z.ZodBoolean;
|
|
635
|
+
}, "strip", z.ZodTypeAny, {
|
|
636
|
+
id: string;
|
|
637
|
+
phone: string;
|
|
638
|
+
displayName: string | null;
|
|
639
|
+
verified: boolean;
|
|
640
|
+
}, {
|
|
641
|
+
id: string;
|
|
642
|
+
phone: string;
|
|
643
|
+
displayName: string | null;
|
|
644
|
+
verified: boolean;
|
|
645
|
+
}>>;
|
|
646
|
+
intent: z.ZodNullable<z.ZodString>;
|
|
647
|
+
urgency: z.ZodNullable<z.ZodString>;
|
|
648
|
+
spam: z.ZodBoolean;
|
|
649
|
+
briefWorthy: z.ZodBoolean;
|
|
650
|
+
payload: z.ZodNullable<z.ZodUnknown>;
|
|
651
|
+
redactedAt: z.ZodNullable<z.ZodString>;
|
|
652
|
+
extractor: z.ZodObject<{
|
|
653
|
+
model: z.ZodString;
|
|
654
|
+
version: z.ZodString;
|
|
655
|
+
promptHash: z.ZodString;
|
|
656
|
+
}, "strip", z.ZodTypeAny, {
|
|
657
|
+
model: string;
|
|
658
|
+
version: string;
|
|
659
|
+
promptHash: string;
|
|
660
|
+
}, {
|
|
661
|
+
model: string;
|
|
662
|
+
version: string;
|
|
663
|
+
promptHash: string;
|
|
664
|
+
}>;
|
|
665
|
+
candidates: z.ZodArray<z.ZodObject<{
|
|
666
|
+
id: z.ZodString;
|
|
667
|
+
reportId: z.ZodString;
|
|
668
|
+
contactId: z.ZodNullable<z.ZodString>;
|
|
669
|
+
type: z.ZodString;
|
|
670
|
+
scope: z.ZodString;
|
|
671
|
+
slug: z.ZodNullable<z.ZodString>;
|
|
672
|
+
text: z.ZodString;
|
|
673
|
+
confidence: z.ZodNumber;
|
|
674
|
+
evidenceQuote: z.ZodString;
|
|
675
|
+
status: z.ZodString;
|
|
676
|
+
appliedToMemoryId: z.ZodNullable<z.ZodString>;
|
|
677
|
+
resolvedAt: z.ZodNullable<z.ZodString>;
|
|
678
|
+
resolvedBy: z.ZodNullable<z.ZodString>;
|
|
679
|
+
createdAt: z.ZodString;
|
|
680
|
+
}, "strip", z.ZodTypeAny, {
|
|
681
|
+
type: string;
|
|
682
|
+
status: string;
|
|
683
|
+
id: string;
|
|
684
|
+
createdAt: string;
|
|
685
|
+
text: string;
|
|
686
|
+
scope: string;
|
|
687
|
+
slug: string | null;
|
|
688
|
+
confidence: number;
|
|
689
|
+
contactId: string | null;
|
|
690
|
+
reportId: string;
|
|
691
|
+
evidenceQuote: string;
|
|
692
|
+
appliedToMemoryId: string | null;
|
|
693
|
+
resolvedAt: string | null;
|
|
694
|
+
resolvedBy: string | null;
|
|
695
|
+
}, {
|
|
696
|
+
type: string;
|
|
697
|
+
status: string;
|
|
698
|
+
id: string;
|
|
699
|
+
createdAt: string;
|
|
700
|
+
text: string;
|
|
701
|
+
scope: string;
|
|
702
|
+
slug: string | null;
|
|
703
|
+
confidence: number;
|
|
704
|
+
contactId: string | null;
|
|
705
|
+
reportId: string;
|
|
706
|
+
evidenceQuote: string;
|
|
707
|
+
appliedToMemoryId: string | null;
|
|
708
|
+
resolvedAt: string | null;
|
|
709
|
+
resolvedBy: string | null;
|
|
710
|
+
}>, "many">;
|
|
711
|
+
};
|
|
305
712
|
//# sourceMappingURL=schemas.d.ts.map
|
package/dist/schemas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["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;;;;;;;;;;CAInC,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;;;;CAMpC,CAAC;AAEF,eAAO,MAAM,4BAA4B;;;;;;;CASxC,CAAC;AAkBF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIlC,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;;CAIhC,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;;CAIpC,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BlC,CAAC"}
|
package/dist/schemas.js
CHANGED
|
@@ -142,4 +142,177 @@ export const ackOutputSchema = {
|
|
|
142
142
|
success: z.boolean().describe("Whether the action completed successfully"),
|
|
143
143
|
message: z.string().describe("Human-readable status message"),
|
|
144
144
|
};
|
|
145
|
+
// ── Auditable Call Memory ────────────────────────────────────────────
|
|
146
|
+
const contactShape = {
|
|
147
|
+
id: z.string().describe("Contact ID (e.g. 'ct_abc123')"),
|
|
148
|
+
phone: z.string().describe("E.164 phone, or 'anonymous:<callId>' if caller ID was withheld"),
|
|
149
|
+
displayName: z.string().nullable().describe("Display name (owner-set or extracted), or null"),
|
|
150
|
+
tags: z.array(z.string()).describe("Owner-set tags for filtering and routing"),
|
|
151
|
+
ownerNotes: z.string().nullable().optional().describe("Owner-only free-form notes; not shown in pre-call context"),
|
|
152
|
+
verified: z.boolean().describe("Whether caller ID has been verified. Default false: AgentCall does NOT verify caller ID automatically."),
|
|
153
|
+
blockedAt: z.string().nullable().describe("ISO 8601 timestamp when the owner marked this caller do-not-engage, or null"),
|
|
154
|
+
callCount: z.number().describe("Total prior calls"),
|
|
155
|
+
firstSeenAt: z.string().describe("ISO 8601 timestamp of first call"),
|
|
156
|
+
lastSeenAt: z.string().describe("ISO 8601 timestamp of most recent call"),
|
|
157
|
+
};
|
|
158
|
+
export const contactOutputSchema = contactShape;
|
|
159
|
+
export const contactListOutputSchema = {
|
|
160
|
+
data: z.array(z.object(contactShape)).describe("Array of contacts ordered by lastSeenAt desc"),
|
|
161
|
+
hasMore: z.boolean().describe("Whether more results are available"),
|
|
162
|
+
nextCursor: z.string().nullable().describe("Pagination cursor, or null"),
|
|
163
|
+
};
|
|
164
|
+
export const nextCallContextOutputSchema = {
|
|
165
|
+
contactId: z.string().describe("Contact ID this context is for"),
|
|
166
|
+
phone: z.string().describe("Caller's phone number"),
|
|
167
|
+
numberId: z.string().describe("Which AgentCall number the context was rendered from"),
|
|
168
|
+
contextBlock: z.string().describe("Compact natural-language paragraph that would be injected into the next AI call's system prompt. Empty when there's nothing useful to inject."),
|
|
169
|
+
contextBlockChars: z.number().describe("Length of the context block in characters"),
|
|
170
|
+
isEmpty: z.boolean().describe("true when contextBlock is empty (first call, or no extracted memory yet)"),
|
|
171
|
+
};
|
|
172
|
+
const memoryShape = {
|
|
173
|
+
id: z.string().describe("Memory ID"),
|
|
174
|
+
scope: z.string().describe("Scope: caller | contact | company | phone_number | workspace | agent"),
|
|
175
|
+
scopeKey: z.string().describe("Natural key for the scope (E.164 phone for caller/contact, agentId for workspace, etc)"),
|
|
176
|
+
type: z.string().describe("Memory type: fact | preference | business_context | etc"),
|
|
177
|
+
slug: z.string().describe("Stable concept handle (camelCase). Used for dedup across calls."),
|
|
178
|
+
text: z.string().describe("Plain-English memory text"),
|
|
179
|
+
confidence: z.number().describe("Confidence 0..1"),
|
|
180
|
+
sourceReportIds: z.array(z.string()).describe("CallReport IDs that corroborate this memory"),
|
|
181
|
+
lastEvidenceQuote: z.string().nullable().describe("Most recent verbatim transcript quote"),
|
|
182
|
+
contactId: z.string().nullable().describe("Linked Contact ID for caller/contact-scoped memories"),
|
|
183
|
+
numberId: z.string().nullable().describe("Linked phone number ID for phone_number-scoped memories"),
|
|
184
|
+
active: z.boolean().optional().describe("Whether this memory is currently active"),
|
|
185
|
+
expiresAt: z.string().nullable().describe("Expiration timestamp, or null for indefinite"),
|
|
186
|
+
createdAt: z.string(),
|
|
187
|
+
updatedAt: z.string(),
|
|
188
|
+
};
|
|
189
|
+
export const memoryOutputSchema = memoryShape;
|
|
190
|
+
export const memoryListOutputSchema = {
|
|
191
|
+
data: z.array(z.object(memoryShape)).describe("Active memory rows"),
|
|
192
|
+
};
|
|
193
|
+
export const memoryTimelineOutputSchema = {
|
|
194
|
+
memoryId: z.string(),
|
|
195
|
+
events: z
|
|
196
|
+
.array(z.object({
|
|
197
|
+
id: z.string(),
|
|
198
|
+
action: z.string().describe("proposed | applied | corroborated | superseded | rejected | edited | expired"),
|
|
199
|
+
actor: z.string().describe("extractor | auto_policy | owner:<userId> | agent_action | expiry_worker"),
|
|
200
|
+
before: z.unknown().nullable(),
|
|
201
|
+
after: z.unknown().nullable(),
|
|
202
|
+
reportId: z.string().nullable(),
|
|
203
|
+
note: z.string().nullable(),
|
|
204
|
+
createdAt: z.string(),
|
|
205
|
+
}))
|
|
206
|
+
.describe("Append-only events oldest to newest"),
|
|
207
|
+
};
|
|
208
|
+
const memoryCandidateShape = {
|
|
209
|
+
id: z.string(),
|
|
210
|
+
reportId: z.string(),
|
|
211
|
+
contactId: z.string().nullable(),
|
|
212
|
+
type: z.string(),
|
|
213
|
+
scope: z.string(),
|
|
214
|
+
slug: z.string().nullable(),
|
|
215
|
+
text: z.string(),
|
|
216
|
+
confidence: z.number(),
|
|
217
|
+
evidenceQuote: z.string(),
|
|
218
|
+
status: z.string().describe("proposed | approved | rejected | applied | expired | superseded"),
|
|
219
|
+
appliedToMemoryId: z.string().nullable(),
|
|
220
|
+
resolvedAt: z.string().nullable(),
|
|
221
|
+
resolvedBy: z.string().nullable(),
|
|
222
|
+
createdAt: z.string(),
|
|
223
|
+
};
|
|
224
|
+
export const memoryCandidatesListOutputSchema = {
|
|
225
|
+
data: z.array(z.object(memoryCandidateShape)),
|
|
226
|
+
hasMore: z.boolean(),
|
|
227
|
+
nextCursor: z.string().nullable(),
|
|
228
|
+
};
|
|
229
|
+
const callReportSummaryShape = {
|
|
230
|
+
id: z.string(),
|
|
231
|
+
callId: z.string(),
|
|
232
|
+
contactId: z.string().nullable(),
|
|
233
|
+
intent: z.string().nullable(),
|
|
234
|
+
urgency: z.string().nullable().describe("high | medium | low"),
|
|
235
|
+
spam: z.boolean(),
|
|
236
|
+
briefWorthy: z.boolean(),
|
|
237
|
+
extractorVersion: z.string(),
|
|
238
|
+
generatedAt: z.string(),
|
|
239
|
+
redactedAt: z.string().nullable(),
|
|
240
|
+
};
|
|
241
|
+
export const reportsListOutputSchema = {
|
|
242
|
+
data: z.array(z.object(callReportSummaryShape)),
|
|
243
|
+
hasMore: z.boolean(),
|
|
244
|
+
nextCursor: z.string().nullable(),
|
|
245
|
+
};
|
|
246
|
+
export const purgeContactOutputSchema = {
|
|
247
|
+
contactId: z.string(),
|
|
248
|
+
memoriesDeleted: z.number().describe("Memory rows wiped via FK cascade"),
|
|
249
|
+
candidatesDeleted: z.number().describe("MemoryCandidate rows wiped via FK cascade"),
|
|
250
|
+
briefsDeleted: z.number().describe("Brief rows wiped via FK cascade"),
|
|
251
|
+
reportsRedacted: z.number().describe("CallReport rows redacted (payload=null, redactedAt stamped)"),
|
|
252
|
+
};
|
|
253
|
+
export const approveCandidateOutputSchema = {
|
|
254
|
+
id: z.string().describe("Candidate ID"),
|
|
255
|
+
status: z.literal("applied"),
|
|
256
|
+
memoryId: z.string().describe("The Memory row the candidate landed on"),
|
|
257
|
+
action: z.enum(["created", "corroborated", "superseded"]).describe("What the approval did to the slot. created: empty slot, new Memory row. corroborated: existing same-text slot, confidence raised. superseded: existing different-text slot deactivated, new Memory row created."),
|
|
258
|
+
supersededMemoryId: z.string().optional().describe("Set when action='superseded'; the now-inactive Memory row"),
|
|
259
|
+
alreadyApplied: z.boolean().optional().describe("true when the candidate was already applied prior to this call (idempotent)"),
|
|
260
|
+
};
|
|
261
|
+
const briefShape = {
|
|
262
|
+
id: z.string(),
|
|
263
|
+
reportId: z.string(),
|
|
264
|
+
contactId: z.string().nullable(),
|
|
265
|
+
numberId: z.string().nullable(),
|
|
266
|
+
type: z.string().describe("hot_lead | promise_made | missed_followup | escalation | new_fact | pattern"),
|
|
267
|
+
title: z.string(),
|
|
268
|
+
detail: z.string(),
|
|
269
|
+
urgency: z.string().describe("high | medium | low"),
|
|
270
|
+
status: z.string().describe("open | acknowledged | resolved | dismissed"),
|
|
271
|
+
acknowledgedAt: z.string().nullable(),
|
|
272
|
+
resolvedAt: z.string().nullable(),
|
|
273
|
+
createdAt: z.string(),
|
|
274
|
+
updatedAt: z.string(),
|
|
275
|
+
};
|
|
276
|
+
export const briefsListOutputSchema = {
|
|
277
|
+
data: z.array(z.object(briefShape)),
|
|
278
|
+
hasMore: z.boolean(),
|
|
279
|
+
nextCursor: z.string().nullable(),
|
|
280
|
+
};
|
|
281
|
+
export const briefAckOutputSchema = {
|
|
282
|
+
id: z.string(),
|
|
283
|
+
status: z.string(),
|
|
284
|
+
acknowledgedAt: z.string().nullable(),
|
|
285
|
+
};
|
|
286
|
+
export const briefResolveOutputSchema = {
|
|
287
|
+
id: z.string(),
|
|
288
|
+
status: z.literal("resolved"),
|
|
289
|
+
resolvedAt: z.string(),
|
|
290
|
+
};
|
|
291
|
+
export const callReportOutputSchema = {
|
|
292
|
+
callId: z.string(),
|
|
293
|
+
reportId: z.string(),
|
|
294
|
+
generatedAt: z.string(),
|
|
295
|
+
direction: z.string(),
|
|
296
|
+
from: z.string(),
|
|
297
|
+
to: z.string(),
|
|
298
|
+
duration: z.number().nullable(),
|
|
299
|
+
contact: z.object({
|
|
300
|
+
id: z.string(),
|
|
301
|
+
phone: z.string(),
|
|
302
|
+
displayName: z.string().nullable(),
|
|
303
|
+
verified: z.boolean(),
|
|
304
|
+
}).nullable(),
|
|
305
|
+
intent: z.string().nullable(),
|
|
306
|
+
urgency: z.string().nullable(),
|
|
307
|
+
spam: z.boolean(),
|
|
308
|
+
briefWorthy: z.boolean(),
|
|
309
|
+
payload: z.unknown().nullable().describe("Structured analysis (summary, callerName, facts, decisions, commitments, tasks, preferences, unresolved, risks, nextAction, nextCallContext, ownerBrief). Null after right-to-forget redaction."),
|
|
310
|
+
redactedAt: z.string().nullable(),
|
|
311
|
+
extractor: z.object({
|
|
312
|
+
model: z.string(),
|
|
313
|
+
version: z.string(),
|
|
314
|
+
promptHash: z.string(),
|
|
315
|
+
}),
|
|
316
|
+
candidates: z.array(z.object(memoryCandidateShape)),
|
|
317
|
+
};
|
|
145
318
|
//# sourceMappingURL=schemas.js.map
|