@alfe.ai/microsoft-mcp 0.1.11 → 0.1.13

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/server.d.cts CHANGED
@@ -1,5 +1,5 @@
1
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";
2
+ import { ChangelogEntry, EncryptedEnvelopeV1, FieldEnvelope, FieldFormat, FieldSensitivity, GeneratedDataKey, IntegrationActivationSource, IntegrationActualStatus, IntegrationConfigResult, IntegrationDesiredStatus, IntegrationInstall, IntegrationScope, RegistryEntry, ScopeInfo, SecretAggregate, SecretCategory, SecretMetadata, SecretScope } from "@alfe/types";
3
3
 
4
4
  //#region ../agent-api-client/dist/index.d.ts
5
5
 
@@ -69,6 +69,69 @@ declare class ApiBase {
69
69
  }
70
70
  //# sourceMappingURL=transport.d.ts.map
71
71
  //#endregion
72
+ //#region src/domains/integrations.d.ts
73
+ /**
74
+ * One entry in the agent's EFFECTIVE integration list. Agent-scope install
75
+ * rows keep their full public row shape (config included, `scope: "agent"`);
76
+ * connection-/channel-/custom-driven activations and inherited
77
+ * org/team/project installs have no agent-scope row and appear as the
78
+ * narrower projection. Discriminate on `config`: only the agent-scope row
79
+ * arm carries it (`source` alone is NOT a discriminator — inherited explicit
80
+ * rows land in the narrow arm with `source: "explicit"` too).
81
+ */
82
+ type AgentIntegrationListEntry = (IntegrationInstall & {
83
+ source: "explicit";
84
+ }) | {
85
+ integrationId: string;
86
+ version: string;
87
+ desiredStatus: IntegrationDesiredStatus;
88
+ actualStatus: IntegrationActualStatus;
89
+ source: IntegrationActivationSource;
90
+ /** Winning row's scope — present only on inherited explicit entries. */
91
+ scope?: IntegrationScope;
92
+ scopeId?: string;
93
+ config?: undefined;
94
+ connectionId?: string;
95
+ channelId?: string;
96
+ displayName?: string;
97
+ icon?: string;
98
+ availableVersion?: string;
99
+ reinstallRequestedAt?: string;
100
+ };
101
+ declare class IntegrationsApi extends ApiBase {
102
+ /**
103
+ * List the integrations EFFECTIVE for this agent — explicit agent-scope
104
+ * installs plus driven activations (google, myob, xero, google-chat, …)
105
+ * and inherited org-scope installs, discriminated by `source`.
106
+ */
107
+ listIntegrations(): Promise<{
108
+ integrations: AgentIntegrationListEntry[];
109
+ }>;
110
+ getIntegrationConfig(integrationId: string): Promise<IntegrationConfigResult>;
111
+ updateIntegrationConfig(integrationId: string, config: Record<string, unknown>): Promise<void>;
112
+ installIntegration(integrationId: string, options?: {
113
+ version?: string;
114
+ config?: Record<string, unknown>;
115
+ }): Promise<IntegrationInstall>;
116
+ removeIntegration(integrationId: string): Promise<IntegrationInstall>;
117
+ getOAuthUrl(provider: string, scopes?: string[], options?: {
118
+ shop?: string;
119
+ }): Promise<{
120
+ url: string;
121
+ provider: string;
122
+ expiresIn: number;
123
+ }>;
124
+ getOAuthStatus(provider: string): Promise<{
125
+ provider: string;
126
+ connected: boolean;
127
+ config?: Record<string, string>;
128
+ }>;
129
+ getRegistry(): Promise<{
130
+ integrations: RegistryEntry[];
131
+ }>;
132
+ }
133
+ //# sourceMappingURL=integrations.d.ts.map
134
+ //#endregion
72
135
  //#region src/domains/workspace.d.ts
73
136
  /** Response of GET /agent/workspace (services/agents). */
74
137
  interface AgentWorkspaceInfo {
@@ -667,6 +730,168 @@ declare class VoiceApi extends ApiBase {
667
730
  }
668
731
  //# sourceMappingURL=voice.d.ts.map
669
732
  //#endregion
733
+ //#region src/domains/identity.d.ts
734
+ type IdentityStatus = "anonymous" | "partial" | "identified" | "verified";
735
+ interface IdentityDirectoryEntry {
736
+ identityId: string;
737
+ status: IdentityStatus;
738
+ displayName: string;
739
+ name?: string;
740
+ avatarUrl?: string;
741
+ lastSeenAt: string;
742
+ lastSeenProvider?: string;
743
+ messageable: boolean;
744
+ }
745
+ declare class IdentityApi extends ApiBase {
746
+ /**
747
+ * Returns the calling agent's own identity context — `{ agentId, tenantId }`
748
+ * decoded server-side from the agent API token. Used by the
749
+ * `@alfe.ai/openclaw-identity` plugin to bootstrap context when the
750
+ * OpenClaw daemon doesn't plumb `ctx.agentId` through to plugin hooks.
751
+ * Plugins should cache this for the daemon's lifetime (single-agent-per-
752
+ * process invariant). One HTTP round-trip per process activate; not for
753
+ * per-call use.
754
+ */
755
+ whoami(): Promise<{
756
+ agentId: string;
757
+ tenantId: string;
758
+ }>;
759
+ resolveIdentity(args: {
760
+ provider: string;
761
+ platformId: string;
762
+ kind?: "user" | "agent" | "service" | "bot" | "workspace";
763
+ displayName?: string;
764
+ }): Promise<{
765
+ identityId: string | null;
766
+ status: string;
767
+ created?: boolean;
768
+ reason?: string;
769
+ /**
770
+ * Flattened auriclabs permission strings for the resolved identity
771
+ * (scope-prefixed where applicable). Empty array on miss / org service
772
+ * outage — the runtime gate fails closed in that case.
773
+ */
774
+ permissions: string[];
775
+ }>;
776
+ searchIdentities(args?: {
777
+ q?: string;
778
+ status?: string;
779
+ limit?: number;
780
+ }): Promise<{
781
+ identities: unknown[];
782
+ }>;
783
+ listIdentities(args?: {
784
+ status?: IdentityStatus;
785
+ limit?: number;
786
+ cursor?: string;
787
+ }): Promise<{
788
+ identities: IdentityDirectoryEntry[];
789
+ cursor: string | null;
790
+ }>;
791
+ getIdentityContext(identityId: string): Promise<{
792
+ context: unknown;
793
+ }>;
794
+ mergeIdentities(survivorId: string, args: {
795
+ mergedId: string;
796
+ }): Promise<{
797
+ ok: boolean;
798
+ error?: string;
799
+ }>;
800
+ unmergeIdentity(identityId: string): Promise<{
801
+ ok: boolean;
802
+ error?: string;
803
+ }>;
804
+ addIdentityNote(identityId: string, args: {
805
+ content: string;
806
+ category?: string;
807
+ }): Promise<{
808
+ noteId: string | null;
809
+ }>;
810
+ tagIdentity(identityId: string, args: {
811
+ tag: string;
812
+ action: "add" | "remove";
813
+ }): Promise<{
814
+ ok: boolean;
815
+ }>;
816
+ getIdentityChangelog(identityId: string, args?: {
817
+ limit?: number;
818
+ cursor?: string;
819
+ }): Promise<{
820
+ entries: unknown[];
821
+ cursor: string | null;
822
+ }>;
823
+ rollbackIdentity(identityId: string, args: {
824
+ targetVersion: number;
825
+ }): Promise<{
826
+ ok: boolean;
827
+ entry?: unknown;
828
+ }>;
829
+ requestIdentityVerification(args: {
830
+ claimedIdentityId: string;
831
+ requestingIdentityId: string;
832
+ requestingProvider: string;
833
+ requestingPlatformId: string;
834
+ preferredChannel?: "mobile" | "email";
835
+ /**
836
+ * Phase 2: agent-supplied contact endpoint. When provided, the top-level
837
+ * `preferredChannel` is ignored — the contact's channel wins.
838
+ */
839
+ contact?: {
840
+ channel: "email" | "mobile";
841
+ value: string;
842
+ };
843
+ }): Promise<{
844
+ verificationId: string;
845
+ channel: string;
846
+ deliveredTo: string;
847
+ expiresAt: string;
848
+ availableChannels: {
849
+ channel: string;
850
+ deliveredTo: string;
851
+ }[];
852
+ } | {
853
+ error: string;
854
+ }>;
855
+ confirmIdentityVerification(args: {
856
+ claimedIdentityId: string;
857
+ verificationId: string;
858
+ phrase: string;
859
+ }): Promise<{
860
+ verified: boolean;
861
+ identityId?: string;
862
+ /** Phase 2: how the confirm resolved — Scenario A vs B. */
863
+ action?: "merged" | "contact_verified" | "already_confirmed";
864
+ error?: string;
865
+ }>;
866
+ /**
867
+ * Update display-shape fields on an Identity. Body excludes `email` /
868
+ * `phone` / `title` / `company` / `metadata` per Section D4 — contacts go
869
+ * via the verify flow, title/company live on OrgMembership, metadata is
870
+ * not agent-writable.
871
+ */
872
+ updateIdentity(identityId: string, args: {
873
+ name?: string;
874
+ avatarUrl?: string;
875
+ timezone?: string;
876
+ locale?: string;
877
+ }): Promise<{
878
+ ok: boolean;
879
+ }>;
880
+ /**
881
+ * Phase 2 (Section H): server-side verification of a Google Chat sender via
882
+ * the agent's existing Google OAuth credentials. Returns the resolved
883
+ * identity (created or matched via Scenario-B email enrichment).
884
+ */
885
+ resolveGoogleChatSender(args: {
886
+ senderUserId: string;
887
+ spaceId?: string;
888
+ }): Promise<{
889
+ identityId: string | null;
890
+ status: string;
891
+ }>;
892
+ }
893
+ //# sourceMappingURL=identity.d.ts.map
894
+ //#endregion
670
895
  //#region src/domains/search.d.ts
671
896
  /**
672
897
  * The broad-news providers behind the metered `services/news` Lambda. The
@@ -778,6 +1003,14 @@ declare class WebhooksApi extends ApiBase {
778
1003
  //#endregion
779
1004
  //#region src/domains/chat.d.ts
780
1005
  declare class ChatApi extends ApiBase {
1006
+ ensureDirectConversation(identityId: string): Promise<{
1007
+ conversationId: string;
1008
+ identityId: string;
1009
+ tenantId: string;
1010
+ userId: string;
1011
+ displayName: string;
1012
+ created: boolean;
1013
+ }>;
781
1014
  presignAttachments(files: {
782
1015
  filename: string;
783
1016
  mimeType: string;
@@ -1430,149 +1663,6 @@ declare class DatabaseApi extends ApiBase {
1430
1663
  }
1431
1664
  //# sourceMappingURL=database.d.ts.map
1432
1665
  //#endregion
1433
- //#region src/domains/identity.d.ts
1434
- declare class IdentityApi extends ApiBase {
1435
- /**
1436
- * Returns the calling agent's own identity context — `{ agentId, tenantId }`
1437
- * decoded server-side from the agent API token. Used by the
1438
- * `@alfe.ai/openclaw-identity` plugin to bootstrap context when the
1439
- * OpenClaw daemon doesn't plumb `ctx.agentId` through to plugin hooks.
1440
- * Plugins should cache this for the daemon's lifetime (single-agent-per-
1441
- * process invariant). One HTTP round-trip per process activate; not for
1442
- * per-call use.
1443
- */
1444
- whoami(): Promise<{
1445
- agentId: string;
1446
- tenantId: string;
1447
- }>;
1448
- resolveIdentity(args: {
1449
- provider: string;
1450
- platformId: string;
1451
- kind?: "user" | "agent" | "service" | "bot" | "workspace";
1452
- displayName?: string;
1453
- }): Promise<{
1454
- identityId: string | null;
1455
- status: string;
1456
- created?: boolean;
1457
- reason?: string;
1458
- /**
1459
- * Flattened auriclabs permission strings for the resolved identity
1460
- * (scope-prefixed where applicable). Empty array on miss / org service
1461
- * outage — the runtime gate fails closed in that case.
1462
- */
1463
- permissions: string[];
1464
- }>;
1465
- searchIdentities(args?: {
1466
- q?: string;
1467
- status?: string;
1468
- limit?: number;
1469
- }): Promise<{
1470
- identities: unknown[];
1471
- }>;
1472
- getIdentityContext(identityId: string): Promise<{
1473
- context: unknown;
1474
- }>;
1475
- mergeIdentities(survivorId: string, args: {
1476
- mergedId: string;
1477
- }): Promise<{
1478
- ok: boolean;
1479
- error?: string;
1480
- }>;
1481
- unmergeIdentity(identityId: string): Promise<{
1482
- ok: boolean;
1483
- error?: string;
1484
- }>;
1485
- addIdentityNote(identityId: string, args: {
1486
- content: string;
1487
- category?: string;
1488
- }): Promise<{
1489
- noteId: string | null;
1490
- }>;
1491
- tagIdentity(identityId: string, args: {
1492
- tag: string;
1493
- action: "add" | "remove";
1494
- }): Promise<{
1495
- ok: boolean;
1496
- }>;
1497
- getIdentityChangelog(identityId: string, args?: {
1498
- limit?: number;
1499
- cursor?: string;
1500
- }): Promise<{
1501
- entries: unknown[];
1502
- cursor: string | null;
1503
- }>;
1504
- rollbackIdentity(identityId: string, args: {
1505
- targetVersion: number;
1506
- }): Promise<{
1507
- ok: boolean;
1508
- entry?: unknown;
1509
- }>;
1510
- requestIdentityVerification(args: {
1511
- claimedIdentityId: string;
1512
- requestingIdentityId: string;
1513
- requestingProvider: string;
1514
- requestingPlatformId: string;
1515
- preferredChannel?: "mobile" | "email";
1516
- /**
1517
- * Phase 2: agent-supplied contact endpoint. When provided, the top-level
1518
- * `preferredChannel` is ignored — the contact's channel wins.
1519
- */
1520
- contact?: {
1521
- channel: "email" | "mobile";
1522
- value: string;
1523
- };
1524
- }): Promise<{
1525
- verificationId: string;
1526
- channel: string;
1527
- deliveredTo: string;
1528
- expiresAt: string;
1529
- availableChannels: {
1530
- channel: string;
1531
- deliveredTo: string;
1532
- }[];
1533
- } | {
1534
- error: string;
1535
- }>;
1536
- confirmIdentityVerification(args: {
1537
- claimedIdentityId: string;
1538
- verificationId: string;
1539
- phrase: string;
1540
- }): Promise<{
1541
- verified: boolean;
1542
- identityId?: string;
1543
- /** Phase 2: how the confirm resolved — Scenario A vs B. */
1544
- action?: "merged" | "contact_verified" | "already_confirmed";
1545
- error?: string;
1546
- }>;
1547
- /**
1548
- * Update display-shape fields on an Identity. Body excludes `email` /
1549
- * `phone` / `title` / `company` / `metadata` per Section D4 — contacts go
1550
- * via the verify flow, title/company live on OrgMembership, metadata is
1551
- * not agent-writable.
1552
- */
1553
- updateIdentity(identityId: string, args: {
1554
- name?: string;
1555
- avatarUrl?: string;
1556
- timezone?: string;
1557
- locale?: string;
1558
- }): Promise<{
1559
- ok: boolean;
1560
- }>;
1561
- /**
1562
- * Phase 2 (Section H): server-side verification of a Google Chat sender via
1563
- * the agent's existing Google OAuth credentials. Returns the resolved
1564
- * identity (created or matched via Scenario-B email enrichment).
1565
- */
1566
- resolveGoogleChatSender(args: {
1567
- senderUserId: string;
1568
- spaceId?: string;
1569
- }): Promise<{
1570
- identityId: string | null;
1571
- status: string;
1572
- }>;
1573
- }
1574
- //# sourceMappingURL=identity.d.ts.map
1575
- //#endregion
1576
1666
  //#region src/domains/images.d.ts
1577
1667
  declare class ImagesApi extends ApiBase {
1578
1668
  /**
@@ -1598,34 +1688,6 @@ declare class ImagesApi extends ApiBase {
1598
1688
  }
1599
1689
  //# sourceMappingURL=images.d.ts.map
1600
1690
  //#endregion
1601
- //#region src/domains/integrations.d.ts
1602
- declare class IntegrationsApi extends ApiBase {
1603
- listIntegrations(): Promise<IntegrationInstall[]>;
1604
- getIntegrationConfig(integrationId: string): Promise<IntegrationConfigResult>;
1605
- updateIntegrationConfig(integrationId: string, config: Record<string, unknown>): Promise<void>;
1606
- installIntegration(integrationId: string, options?: {
1607
- version?: string;
1608
- config?: Record<string, unknown>;
1609
- }): Promise<IntegrationInstall>;
1610
- removeIntegration(integrationId: string): Promise<IntegrationInstall>;
1611
- getOAuthUrl(provider: string, scopes?: string[], options?: {
1612
- shop?: string;
1613
- }): Promise<{
1614
- url: string;
1615
- provider: string;
1616
- expiresIn: number;
1617
- }>;
1618
- getOAuthStatus(provider: string): Promise<{
1619
- provider: string;
1620
- connected: boolean;
1621
- config?: Record<string, string>;
1622
- }>;
1623
- getRegistry(): Promise<{
1624
- integrations: RegistryEntry[];
1625
- }>;
1626
- }
1627
- //# sourceMappingURL=integrations.d.ts.map
1628
- //#endregion
1629
1691
  //#region src/domains/memory.d.ts
1630
1692
  declare class MemoryApi extends ApiBase {
1631
1693
  memorySearch(query: string, opts?: {
package/dist/server.d.ts CHANGED
@@ -1,5 +1,5 @@
1
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";
2
+ import { ChangelogEntry, EncryptedEnvelopeV1, FieldEnvelope, FieldFormat, FieldSensitivity, GeneratedDataKey, IntegrationActivationSource, IntegrationActualStatus, IntegrationConfigResult, IntegrationDesiredStatus, IntegrationInstall, IntegrationScope, RegistryEntry, ScopeInfo, SecretAggregate, SecretCategory, SecretMetadata, SecretScope } from "@alfe/types";
3
3
 
4
4
  //#region ../agent-api-client/dist/index.d.ts
5
5
 
@@ -69,6 +69,69 @@ declare class ApiBase {
69
69
  }
70
70
  //# sourceMappingURL=transport.d.ts.map
71
71
  //#endregion
72
+ //#region src/domains/integrations.d.ts
73
+ /**
74
+ * One entry in the agent's EFFECTIVE integration list. Agent-scope install
75
+ * rows keep their full public row shape (config included, `scope: "agent"`);
76
+ * connection-/channel-/custom-driven activations and inherited
77
+ * org/team/project installs have no agent-scope row and appear as the
78
+ * narrower projection. Discriminate on `config`: only the agent-scope row
79
+ * arm carries it (`source` alone is NOT a discriminator — inherited explicit
80
+ * rows land in the narrow arm with `source: "explicit"` too).
81
+ */
82
+ type AgentIntegrationListEntry = (IntegrationInstall & {
83
+ source: "explicit";
84
+ }) | {
85
+ integrationId: string;
86
+ version: string;
87
+ desiredStatus: IntegrationDesiredStatus;
88
+ actualStatus: IntegrationActualStatus;
89
+ source: IntegrationActivationSource;
90
+ /** Winning row's scope — present only on inherited explicit entries. */
91
+ scope?: IntegrationScope;
92
+ scopeId?: string;
93
+ config?: undefined;
94
+ connectionId?: string;
95
+ channelId?: string;
96
+ displayName?: string;
97
+ icon?: string;
98
+ availableVersion?: string;
99
+ reinstallRequestedAt?: string;
100
+ };
101
+ declare class IntegrationsApi extends ApiBase {
102
+ /**
103
+ * List the integrations EFFECTIVE for this agent — explicit agent-scope
104
+ * installs plus driven activations (google, myob, xero, google-chat, …)
105
+ * and inherited org-scope installs, discriminated by `source`.
106
+ */
107
+ listIntegrations(): Promise<{
108
+ integrations: AgentIntegrationListEntry[];
109
+ }>;
110
+ getIntegrationConfig(integrationId: string): Promise<IntegrationConfigResult>;
111
+ updateIntegrationConfig(integrationId: string, config: Record<string, unknown>): Promise<void>;
112
+ installIntegration(integrationId: string, options?: {
113
+ version?: string;
114
+ config?: Record<string, unknown>;
115
+ }): Promise<IntegrationInstall>;
116
+ removeIntegration(integrationId: string): Promise<IntegrationInstall>;
117
+ getOAuthUrl(provider: string, scopes?: string[], options?: {
118
+ shop?: string;
119
+ }): Promise<{
120
+ url: string;
121
+ provider: string;
122
+ expiresIn: number;
123
+ }>;
124
+ getOAuthStatus(provider: string): Promise<{
125
+ provider: string;
126
+ connected: boolean;
127
+ config?: Record<string, string>;
128
+ }>;
129
+ getRegistry(): Promise<{
130
+ integrations: RegistryEntry[];
131
+ }>;
132
+ }
133
+ //# sourceMappingURL=integrations.d.ts.map
134
+ //#endregion
72
135
  //#region src/domains/workspace.d.ts
73
136
  /** Response of GET /agent/workspace (services/agents). */
74
137
  interface AgentWorkspaceInfo {
@@ -667,6 +730,168 @@ declare class VoiceApi extends ApiBase {
667
730
  }
668
731
  //# sourceMappingURL=voice.d.ts.map
669
732
  //#endregion
733
+ //#region src/domains/identity.d.ts
734
+ type IdentityStatus = "anonymous" | "partial" | "identified" | "verified";
735
+ interface IdentityDirectoryEntry {
736
+ identityId: string;
737
+ status: IdentityStatus;
738
+ displayName: string;
739
+ name?: string;
740
+ avatarUrl?: string;
741
+ lastSeenAt: string;
742
+ lastSeenProvider?: string;
743
+ messageable: boolean;
744
+ }
745
+ declare class IdentityApi extends ApiBase {
746
+ /**
747
+ * Returns the calling agent's own identity context — `{ agentId, tenantId }`
748
+ * decoded server-side from the agent API token. Used by the
749
+ * `@alfe.ai/openclaw-identity` plugin to bootstrap context when the
750
+ * OpenClaw daemon doesn't plumb `ctx.agentId` through to plugin hooks.
751
+ * Plugins should cache this for the daemon's lifetime (single-agent-per-
752
+ * process invariant). One HTTP round-trip per process activate; not for
753
+ * per-call use.
754
+ */
755
+ whoami(): Promise<{
756
+ agentId: string;
757
+ tenantId: string;
758
+ }>;
759
+ resolveIdentity(args: {
760
+ provider: string;
761
+ platformId: string;
762
+ kind?: "user" | "agent" | "service" | "bot" | "workspace";
763
+ displayName?: string;
764
+ }): Promise<{
765
+ identityId: string | null;
766
+ status: string;
767
+ created?: boolean;
768
+ reason?: string;
769
+ /**
770
+ * Flattened auriclabs permission strings for the resolved identity
771
+ * (scope-prefixed where applicable). Empty array on miss / org service
772
+ * outage — the runtime gate fails closed in that case.
773
+ */
774
+ permissions: string[];
775
+ }>;
776
+ searchIdentities(args?: {
777
+ q?: string;
778
+ status?: string;
779
+ limit?: number;
780
+ }): Promise<{
781
+ identities: unknown[];
782
+ }>;
783
+ listIdentities(args?: {
784
+ status?: IdentityStatus;
785
+ limit?: number;
786
+ cursor?: string;
787
+ }): Promise<{
788
+ identities: IdentityDirectoryEntry[];
789
+ cursor: string | null;
790
+ }>;
791
+ getIdentityContext(identityId: string): Promise<{
792
+ context: unknown;
793
+ }>;
794
+ mergeIdentities(survivorId: string, args: {
795
+ mergedId: string;
796
+ }): Promise<{
797
+ ok: boolean;
798
+ error?: string;
799
+ }>;
800
+ unmergeIdentity(identityId: string): Promise<{
801
+ ok: boolean;
802
+ error?: string;
803
+ }>;
804
+ addIdentityNote(identityId: string, args: {
805
+ content: string;
806
+ category?: string;
807
+ }): Promise<{
808
+ noteId: string | null;
809
+ }>;
810
+ tagIdentity(identityId: string, args: {
811
+ tag: string;
812
+ action: "add" | "remove";
813
+ }): Promise<{
814
+ ok: boolean;
815
+ }>;
816
+ getIdentityChangelog(identityId: string, args?: {
817
+ limit?: number;
818
+ cursor?: string;
819
+ }): Promise<{
820
+ entries: unknown[];
821
+ cursor: string | null;
822
+ }>;
823
+ rollbackIdentity(identityId: string, args: {
824
+ targetVersion: number;
825
+ }): Promise<{
826
+ ok: boolean;
827
+ entry?: unknown;
828
+ }>;
829
+ requestIdentityVerification(args: {
830
+ claimedIdentityId: string;
831
+ requestingIdentityId: string;
832
+ requestingProvider: string;
833
+ requestingPlatformId: string;
834
+ preferredChannel?: "mobile" | "email";
835
+ /**
836
+ * Phase 2: agent-supplied contact endpoint. When provided, the top-level
837
+ * `preferredChannel` is ignored — the contact's channel wins.
838
+ */
839
+ contact?: {
840
+ channel: "email" | "mobile";
841
+ value: string;
842
+ };
843
+ }): Promise<{
844
+ verificationId: string;
845
+ channel: string;
846
+ deliveredTo: string;
847
+ expiresAt: string;
848
+ availableChannels: {
849
+ channel: string;
850
+ deliveredTo: string;
851
+ }[];
852
+ } | {
853
+ error: string;
854
+ }>;
855
+ confirmIdentityVerification(args: {
856
+ claimedIdentityId: string;
857
+ verificationId: string;
858
+ phrase: string;
859
+ }): Promise<{
860
+ verified: boolean;
861
+ identityId?: string;
862
+ /** Phase 2: how the confirm resolved — Scenario A vs B. */
863
+ action?: "merged" | "contact_verified" | "already_confirmed";
864
+ error?: string;
865
+ }>;
866
+ /**
867
+ * Update display-shape fields on an Identity. Body excludes `email` /
868
+ * `phone` / `title` / `company` / `metadata` per Section D4 — contacts go
869
+ * via the verify flow, title/company live on OrgMembership, metadata is
870
+ * not agent-writable.
871
+ */
872
+ updateIdentity(identityId: string, args: {
873
+ name?: string;
874
+ avatarUrl?: string;
875
+ timezone?: string;
876
+ locale?: string;
877
+ }): Promise<{
878
+ ok: boolean;
879
+ }>;
880
+ /**
881
+ * Phase 2 (Section H): server-side verification of a Google Chat sender via
882
+ * the agent's existing Google OAuth credentials. Returns the resolved
883
+ * identity (created or matched via Scenario-B email enrichment).
884
+ */
885
+ resolveGoogleChatSender(args: {
886
+ senderUserId: string;
887
+ spaceId?: string;
888
+ }): Promise<{
889
+ identityId: string | null;
890
+ status: string;
891
+ }>;
892
+ }
893
+ //# sourceMappingURL=identity.d.ts.map
894
+ //#endregion
670
895
  //#region src/domains/search.d.ts
671
896
  /**
672
897
  * The broad-news providers behind the metered `services/news` Lambda. The
@@ -778,6 +1003,14 @@ declare class WebhooksApi extends ApiBase {
778
1003
  //#endregion
779
1004
  //#region src/domains/chat.d.ts
780
1005
  declare class ChatApi extends ApiBase {
1006
+ ensureDirectConversation(identityId: string): Promise<{
1007
+ conversationId: string;
1008
+ identityId: string;
1009
+ tenantId: string;
1010
+ userId: string;
1011
+ displayName: string;
1012
+ created: boolean;
1013
+ }>;
781
1014
  presignAttachments(files: {
782
1015
  filename: string;
783
1016
  mimeType: string;
@@ -1430,149 +1663,6 @@ declare class DatabaseApi extends ApiBase {
1430
1663
  }
1431
1664
  //# sourceMappingURL=database.d.ts.map
1432
1665
  //#endregion
1433
- //#region src/domains/identity.d.ts
1434
- declare class IdentityApi extends ApiBase {
1435
- /**
1436
- * Returns the calling agent's own identity context — `{ agentId, tenantId }`
1437
- * decoded server-side from the agent API token. Used by the
1438
- * `@alfe.ai/openclaw-identity` plugin to bootstrap context when the
1439
- * OpenClaw daemon doesn't plumb `ctx.agentId` through to plugin hooks.
1440
- * Plugins should cache this for the daemon's lifetime (single-agent-per-
1441
- * process invariant). One HTTP round-trip per process activate; not for
1442
- * per-call use.
1443
- */
1444
- whoami(): Promise<{
1445
- agentId: string;
1446
- tenantId: string;
1447
- }>;
1448
- resolveIdentity(args: {
1449
- provider: string;
1450
- platformId: string;
1451
- kind?: "user" | "agent" | "service" | "bot" | "workspace";
1452
- displayName?: string;
1453
- }): Promise<{
1454
- identityId: string | null;
1455
- status: string;
1456
- created?: boolean;
1457
- reason?: string;
1458
- /**
1459
- * Flattened auriclabs permission strings for the resolved identity
1460
- * (scope-prefixed where applicable). Empty array on miss / org service
1461
- * outage — the runtime gate fails closed in that case.
1462
- */
1463
- permissions: string[];
1464
- }>;
1465
- searchIdentities(args?: {
1466
- q?: string;
1467
- status?: string;
1468
- limit?: number;
1469
- }): Promise<{
1470
- identities: unknown[];
1471
- }>;
1472
- getIdentityContext(identityId: string): Promise<{
1473
- context: unknown;
1474
- }>;
1475
- mergeIdentities(survivorId: string, args: {
1476
- mergedId: string;
1477
- }): Promise<{
1478
- ok: boolean;
1479
- error?: string;
1480
- }>;
1481
- unmergeIdentity(identityId: string): Promise<{
1482
- ok: boolean;
1483
- error?: string;
1484
- }>;
1485
- addIdentityNote(identityId: string, args: {
1486
- content: string;
1487
- category?: string;
1488
- }): Promise<{
1489
- noteId: string | null;
1490
- }>;
1491
- tagIdentity(identityId: string, args: {
1492
- tag: string;
1493
- action: "add" | "remove";
1494
- }): Promise<{
1495
- ok: boolean;
1496
- }>;
1497
- getIdentityChangelog(identityId: string, args?: {
1498
- limit?: number;
1499
- cursor?: string;
1500
- }): Promise<{
1501
- entries: unknown[];
1502
- cursor: string | null;
1503
- }>;
1504
- rollbackIdentity(identityId: string, args: {
1505
- targetVersion: number;
1506
- }): Promise<{
1507
- ok: boolean;
1508
- entry?: unknown;
1509
- }>;
1510
- requestIdentityVerification(args: {
1511
- claimedIdentityId: string;
1512
- requestingIdentityId: string;
1513
- requestingProvider: string;
1514
- requestingPlatformId: string;
1515
- preferredChannel?: "mobile" | "email";
1516
- /**
1517
- * Phase 2: agent-supplied contact endpoint. When provided, the top-level
1518
- * `preferredChannel` is ignored — the contact's channel wins.
1519
- */
1520
- contact?: {
1521
- channel: "email" | "mobile";
1522
- value: string;
1523
- };
1524
- }): Promise<{
1525
- verificationId: string;
1526
- channel: string;
1527
- deliveredTo: string;
1528
- expiresAt: string;
1529
- availableChannels: {
1530
- channel: string;
1531
- deliveredTo: string;
1532
- }[];
1533
- } | {
1534
- error: string;
1535
- }>;
1536
- confirmIdentityVerification(args: {
1537
- claimedIdentityId: string;
1538
- verificationId: string;
1539
- phrase: string;
1540
- }): Promise<{
1541
- verified: boolean;
1542
- identityId?: string;
1543
- /** Phase 2: how the confirm resolved — Scenario A vs B. */
1544
- action?: "merged" | "contact_verified" | "already_confirmed";
1545
- error?: string;
1546
- }>;
1547
- /**
1548
- * Update display-shape fields on an Identity. Body excludes `email` /
1549
- * `phone` / `title` / `company` / `metadata` per Section D4 — contacts go
1550
- * via the verify flow, title/company live on OrgMembership, metadata is
1551
- * not agent-writable.
1552
- */
1553
- updateIdentity(identityId: string, args: {
1554
- name?: string;
1555
- avatarUrl?: string;
1556
- timezone?: string;
1557
- locale?: string;
1558
- }): Promise<{
1559
- ok: boolean;
1560
- }>;
1561
- /**
1562
- * Phase 2 (Section H): server-side verification of a Google Chat sender via
1563
- * the agent's existing Google OAuth credentials. Returns the resolved
1564
- * identity (created or matched via Scenario-B email enrichment).
1565
- */
1566
- resolveGoogleChatSender(args: {
1567
- senderUserId: string;
1568
- spaceId?: string;
1569
- }): Promise<{
1570
- identityId: string | null;
1571
- status: string;
1572
- }>;
1573
- }
1574
- //# sourceMappingURL=identity.d.ts.map
1575
- //#endregion
1576
1666
  //#region src/domains/images.d.ts
1577
1667
  declare class ImagesApi extends ApiBase {
1578
1668
  /**
@@ -1598,34 +1688,6 @@ declare class ImagesApi extends ApiBase {
1598
1688
  }
1599
1689
  //# sourceMappingURL=images.d.ts.map
1600
1690
  //#endregion
1601
- //#region src/domains/integrations.d.ts
1602
- declare class IntegrationsApi extends ApiBase {
1603
- listIntegrations(): Promise<IntegrationInstall[]>;
1604
- getIntegrationConfig(integrationId: string): Promise<IntegrationConfigResult>;
1605
- updateIntegrationConfig(integrationId: string, config: Record<string, unknown>): Promise<void>;
1606
- installIntegration(integrationId: string, options?: {
1607
- version?: string;
1608
- config?: Record<string, unknown>;
1609
- }): Promise<IntegrationInstall>;
1610
- removeIntegration(integrationId: string): Promise<IntegrationInstall>;
1611
- getOAuthUrl(provider: string, scopes?: string[], options?: {
1612
- shop?: string;
1613
- }): Promise<{
1614
- url: string;
1615
- provider: string;
1616
- expiresIn: number;
1617
- }>;
1618
- getOAuthStatus(provider: string): Promise<{
1619
- provider: string;
1620
- connected: boolean;
1621
- config?: Record<string, string>;
1622
- }>;
1623
- getRegistry(): Promise<{
1624
- integrations: RegistryEntry[];
1625
- }>;
1626
- }
1627
- //# sourceMappingURL=integrations.d.ts.map
1628
- //#endregion
1629
1691
  //#region src/domains/memory.d.ts
1630
1692
  declare class MemoryApi extends ApiBase {
1631
1693
  memorySearch(query: string, opts?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfe.ai/microsoft-mcp",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "description": "Microsoft 365 MCP server — multi-account Microsoft Graph access using Alfe OAuth credentials with server-mediated token refresh",
5
5
  "type": "module",
6
6
  "main": "./dist/server.js",
@@ -22,7 +22,7 @@
22
22
  "@modelcontextprotocol/sdk": "^1.29.0",
23
23
  "zod": "^4.0.5",
24
24
  "@alfe.ai/config": "0.4.1",
25
- "@alfe.ai/agent-api-client": "0.17.0"
25
+ "@alfe.ai/agent-api-client": "0.18.0"
26
26
  },
27
27
  "license": "UNLICENSED",
28
28
  "homepage": "https://alfe.ai",