@alfe.ai/mcp-server 0.2.9 → 0.2.10

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.d.cts CHANGED
@@ -668,6 +668,168 @@ declare class VoiceApi extends ApiBase {
668
668
  }
669
669
  //# sourceMappingURL=voice.d.ts.map
670
670
  //#endregion
671
+ //#region src/domains/identity.d.ts
672
+ type IdentityStatus = "anonymous" | "partial" | "identified" | "verified";
673
+ interface IdentityDirectoryEntry {
674
+ identityId: string;
675
+ status: IdentityStatus;
676
+ displayName: string;
677
+ name?: string;
678
+ avatarUrl?: string;
679
+ lastSeenAt: string;
680
+ lastSeenProvider?: string;
681
+ messageable: boolean;
682
+ }
683
+ declare class IdentityApi extends ApiBase {
684
+ /**
685
+ * Returns the calling agent's own identity context — `{ agentId, tenantId }`
686
+ * decoded server-side from the agent API token. Used by the
687
+ * `@alfe.ai/openclaw-identity` plugin to bootstrap context when the
688
+ * OpenClaw daemon doesn't plumb `ctx.agentId` through to plugin hooks.
689
+ * Plugins should cache this for the daemon's lifetime (single-agent-per-
690
+ * process invariant). One HTTP round-trip per process activate; not for
691
+ * per-call use.
692
+ */
693
+ whoami(): Promise<{
694
+ agentId: string;
695
+ tenantId: string;
696
+ }>;
697
+ resolveIdentity(args: {
698
+ provider: string;
699
+ platformId: string;
700
+ kind?: "user" | "agent" | "service" | "bot" | "workspace";
701
+ displayName?: string;
702
+ }): Promise<{
703
+ identityId: string | null;
704
+ status: string;
705
+ created?: boolean;
706
+ reason?: string;
707
+ /**
708
+ * Flattened auriclabs permission strings for the resolved identity
709
+ * (scope-prefixed where applicable). Empty array on miss / org service
710
+ * outage — the runtime gate fails closed in that case.
711
+ */
712
+ permissions: string[];
713
+ }>;
714
+ searchIdentities(args?: {
715
+ q?: string;
716
+ status?: string;
717
+ limit?: number;
718
+ }): Promise<{
719
+ identities: unknown[];
720
+ }>;
721
+ listIdentities(args?: {
722
+ status?: IdentityStatus;
723
+ limit?: number;
724
+ cursor?: string;
725
+ }): Promise<{
726
+ identities: IdentityDirectoryEntry[];
727
+ cursor: string | null;
728
+ }>;
729
+ getIdentityContext(identityId: string): Promise<{
730
+ context: unknown;
731
+ }>;
732
+ mergeIdentities(survivorId: string, args: {
733
+ mergedId: string;
734
+ }): Promise<{
735
+ ok: boolean;
736
+ error?: string;
737
+ }>;
738
+ unmergeIdentity(identityId: string): Promise<{
739
+ ok: boolean;
740
+ error?: string;
741
+ }>;
742
+ addIdentityNote(identityId: string, args: {
743
+ content: string;
744
+ category?: string;
745
+ }): Promise<{
746
+ noteId: string | null;
747
+ }>;
748
+ tagIdentity(identityId: string, args: {
749
+ tag: string;
750
+ action: "add" | "remove";
751
+ }): Promise<{
752
+ ok: boolean;
753
+ }>;
754
+ getIdentityChangelog(identityId: string, args?: {
755
+ limit?: number;
756
+ cursor?: string;
757
+ }): Promise<{
758
+ entries: unknown[];
759
+ cursor: string | null;
760
+ }>;
761
+ rollbackIdentity(identityId: string, args: {
762
+ targetVersion: number;
763
+ }): Promise<{
764
+ ok: boolean;
765
+ entry?: unknown;
766
+ }>;
767
+ requestIdentityVerification(args: {
768
+ claimedIdentityId: string;
769
+ requestingIdentityId: string;
770
+ requestingProvider: string;
771
+ requestingPlatformId: string;
772
+ preferredChannel?: "mobile" | "email";
773
+ /**
774
+ * Phase 2: agent-supplied contact endpoint. When provided, the top-level
775
+ * `preferredChannel` is ignored — the contact's channel wins.
776
+ */
777
+ contact?: {
778
+ channel: "email" | "mobile";
779
+ value: string;
780
+ };
781
+ }): Promise<{
782
+ verificationId: string;
783
+ channel: string;
784
+ deliveredTo: string;
785
+ expiresAt: string;
786
+ availableChannels: {
787
+ channel: string;
788
+ deliveredTo: string;
789
+ }[];
790
+ } | {
791
+ error: string;
792
+ }>;
793
+ confirmIdentityVerification(args: {
794
+ claimedIdentityId: string;
795
+ verificationId: string;
796
+ phrase: string;
797
+ }): Promise<{
798
+ verified: boolean;
799
+ identityId?: string;
800
+ /** Phase 2: how the confirm resolved — Scenario A vs B. */
801
+ action?: "merged" | "contact_verified" | "already_confirmed";
802
+ error?: string;
803
+ }>;
804
+ /**
805
+ * Update display-shape fields on an Identity. Body excludes `email` /
806
+ * `phone` / `title` / `company` / `metadata` per Section D4 — contacts go
807
+ * via the verify flow, title/company live on OrgMembership, metadata is
808
+ * not agent-writable.
809
+ */
810
+ updateIdentity(identityId: string, args: {
811
+ name?: string;
812
+ avatarUrl?: string;
813
+ timezone?: string;
814
+ locale?: string;
815
+ }): Promise<{
816
+ ok: boolean;
817
+ }>;
818
+ /**
819
+ * Phase 2 (Section H): server-side verification of a Google Chat sender via
820
+ * the agent's existing Google OAuth credentials. Returns the resolved
821
+ * identity (created or matched via Scenario-B email enrichment).
822
+ */
823
+ resolveGoogleChatSender(args: {
824
+ senderUserId: string;
825
+ spaceId?: string;
826
+ }): Promise<{
827
+ identityId: string | null;
828
+ status: string;
829
+ }>;
830
+ }
831
+ //# sourceMappingURL=identity.d.ts.map
832
+ //#endregion
671
833
  //#region src/domains/search.d.ts
672
834
  /**
673
835
  * The broad-news providers behind the metered `services/news` Lambda. The
@@ -779,6 +941,14 @@ declare class WebhooksApi extends ApiBase {
779
941
  //#endregion
780
942
  //#region src/domains/chat.d.ts
781
943
  declare class ChatApi extends ApiBase {
944
+ ensureDirectConversation(identityId: string): Promise<{
945
+ conversationId: string;
946
+ identityId: string;
947
+ tenantId: string;
948
+ userId: string;
949
+ displayName: string;
950
+ created: boolean;
951
+ }>;
782
952
  presignAttachments(files: {
783
953
  filename: string;
784
954
  mimeType: string;
@@ -1431,149 +1601,6 @@ declare class DatabaseApi extends ApiBase {
1431
1601
  }
1432
1602
  //# sourceMappingURL=database.d.ts.map
1433
1603
  //#endregion
1434
- //#region src/domains/identity.d.ts
1435
- declare class IdentityApi extends ApiBase {
1436
- /**
1437
- * Returns the calling agent's own identity context — `{ agentId, tenantId }`
1438
- * decoded server-side from the agent API token. Used by the
1439
- * `@alfe.ai/openclaw-identity` plugin to bootstrap context when the
1440
- * OpenClaw daemon doesn't plumb `ctx.agentId` through to plugin hooks.
1441
- * Plugins should cache this for the daemon's lifetime (single-agent-per-
1442
- * process invariant). One HTTP round-trip per process activate; not for
1443
- * per-call use.
1444
- */
1445
- whoami(): Promise<{
1446
- agentId: string;
1447
- tenantId: string;
1448
- }>;
1449
- resolveIdentity(args: {
1450
- provider: string;
1451
- platformId: string;
1452
- kind?: "user" | "agent" | "service" | "bot" | "workspace";
1453
- displayName?: string;
1454
- }): Promise<{
1455
- identityId: string | null;
1456
- status: string;
1457
- created?: boolean;
1458
- reason?: string;
1459
- /**
1460
- * Flattened auriclabs permission strings for the resolved identity
1461
- * (scope-prefixed where applicable). Empty array on miss / org service
1462
- * outage — the runtime gate fails closed in that case.
1463
- */
1464
- permissions: string[];
1465
- }>;
1466
- searchIdentities(args?: {
1467
- q?: string;
1468
- status?: string;
1469
- limit?: number;
1470
- }): Promise<{
1471
- identities: unknown[];
1472
- }>;
1473
- getIdentityContext(identityId: string): Promise<{
1474
- context: unknown;
1475
- }>;
1476
- mergeIdentities(survivorId: string, args: {
1477
- mergedId: string;
1478
- }): Promise<{
1479
- ok: boolean;
1480
- error?: string;
1481
- }>;
1482
- unmergeIdentity(identityId: string): Promise<{
1483
- ok: boolean;
1484
- error?: string;
1485
- }>;
1486
- addIdentityNote(identityId: string, args: {
1487
- content: string;
1488
- category?: string;
1489
- }): Promise<{
1490
- noteId: string | null;
1491
- }>;
1492
- tagIdentity(identityId: string, args: {
1493
- tag: string;
1494
- action: "add" | "remove";
1495
- }): Promise<{
1496
- ok: boolean;
1497
- }>;
1498
- getIdentityChangelog(identityId: string, args?: {
1499
- limit?: number;
1500
- cursor?: string;
1501
- }): Promise<{
1502
- entries: unknown[];
1503
- cursor: string | null;
1504
- }>;
1505
- rollbackIdentity(identityId: string, args: {
1506
- targetVersion: number;
1507
- }): Promise<{
1508
- ok: boolean;
1509
- entry?: unknown;
1510
- }>;
1511
- requestIdentityVerification(args: {
1512
- claimedIdentityId: string;
1513
- requestingIdentityId: string;
1514
- requestingProvider: string;
1515
- requestingPlatformId: string;
1516
- preferredChannel?: "mobile" | "email";
1517
- /**
1518
- * Phase 2: agent-supplied contact endpoint. When provided, the top-level
1519
- * `preferredChannel` is ignored — the contact's channel wins.
1520
- */
1521
- contact?: {
1522
- channel: "email" | "mobile";
1523
- value: string;
1524
- };
1525
- }): Promise<{
1526
- verificationId: string;
1527
- channel: string;
1528
- deliveredTo: string;
1529
- expiresAt: string;
1530
- availableChannels: {
1531
- channel: string;
1532
- deliveredTo: string;
1533
- }[];
1534
- } | {
1535
- error: string;
1536
- }>;
1537
- confirmIdentityVerification(args: {
1538
- claimedIdentityId: string;
1539
- verificationId: string;
1540
- phrase: string;
1541
- }): Promise<{
1542
- verified: boolean;
1543
- identityId?: string;
1544
- /** Phase 2: how the confirm resolved — Scenario A vs B. */
1545
- action?: "merged" | "contact_verified" | "already_confirmed";
1546
- error?: string;
1547
- }>;
1548
- /**
1549
- * Update display-shape fields on an Identity. Body excludes `email` /
1550
- * `phone` / `title` / `company` / `metadata` per Section D4 — contacts go
1551
- * via the verify flow, title/company live on OrgMembership, metadata is
1552
- * not agent-writable.
1553
- */
1554
- updateIdentity(identityId: string, args: {
1555
- name?: string;
1556
- avatarUrl?: string;
1557
- timezone?: string;
1558
- locale?: string;
1559
- }): Promise<{
1560
- ok: boolean;
1561
- }>;
1562
- /**
1563
- * Phase 2 (Section H): server-side verification of a Google Chat sender via
1564
- * the agent's existing Google OAuth credentials. Returns the resolved
1565
- * identity (created or matched via Scenario-B email enrichment).
1566
- */
1567
- resolveGoogleChatSender(args: {
1568
- senderUserId: string;
1569
- spaceId?: string;
1570
- }): Promise<{
1571
- identityId: string | null;
1572
- status: string;
1573
- }>;
1574
- }
1575
- //# sourceMappingURL=identity.d.ts.map
1576
- //#endregion
1577
1604
  //#region src/domains/images.d.ts
1578
1605
  declare class ImagesApi extends ApiBase {
1579
1606
  /**