@alfe.ai/mcp-server 0.2.9 → 0.2.11

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
@@ -1,6 +1,6 @@
1
1
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
2
  import { Transport } from "@modelcontextprotocol/sdk/shared/transport.js";
3
- import { ChangelogEntry, EncryptedEnvelopeV1, FieldEnvelope, FieldFormat, FieldSensitivity, GeneratedDataKey, IntegrationConfigResult, IntegrationInstall, RegistryEntry, ScopeInfo, SecretAggregate, SecretCategory, SecretMetadata, SecretScope } from "@alfe/types";
3
+ import { ChangelogEntry, EncryptedEnvelopeV1, FieldEnvelope, FieldFormat, FieldSensitivity, GeneratedDataKey, IntegrationActivationSource, IntegrationActualStatus, IntegrationConfigResult, IntegrationDesiredStatus, IntegrationInstall, IntegrationScope, RegistryEntry, ScopeInfo, SecretAggregate, SecretCategory, SecretMetadata, SecretScope } from "@alfe/types";
4
4
 
5
5
  //#region ../agent-api-client/dist/index.d.ts
6
6
 
@@ -70,6 +70,69 @@ declare class ApiBase {
70
70
  }
71
71
  //# sourceMappingURL=transport.d.ts.map
72
72
  //#endregion
73
+ //#region src/domains/integrations.d.ts
74
+ /**
75
+ * One entry in the agent's EFFECTIVE integration list. Agent-scope install
76
+ * rows keep their full public row shape (config included, `scope: "agent"`);
77
+ * connection-/channel-/custom-driven activations and inherited
78
+ * org/team/project installs have no agent-scope row and appear as the
79
+ * narrower projection. Discriminate on `config`: only the agent-scope row
80
+ * arm carries it (`source` alone is NOT a discriminator — inherited explicit
81
+ * rows land in the narrow arm with `source: "explicit"` too).
82
+ */
83
+ type AgentIntegrationListEntry = (IntegrationInstall & {
84
+ source: "explicit";
85
+ }) | {
86
+ integrationId: string;
87
+ version: string;
88
+ desiredStatus: IntegrationDesiredStatus;
89
+ actualStatus: IntegrationActualStatus;
90
+ source: IntegrationActivationSource;
91
+ /** Winning row's scope — present only on inherited explicit entries. */
92
+ scope?: IntegrationScope;
93
+ scopeId?: string;
94
+ config?: undefined;
95
+ connectionId?: string;
96
+ channelId?: string;
97
+ displayName?: string;
98
+ icon?: string;
99
+ availableVersion?: string;
100
+ reinstallRequestedAt?: string;
101
+ };
102
+ declare class IntegrationsApi extends ApiBase {
103
+ /**
104
+ * List the integrations EFFECTIVE for this agent — explicit agent-scope
105
+ * installs plus driven activations (google, myob, xero, google-chat, …)
106
+ * and inherited org-scope installs, discriminated by `source`.
107
+ */
108
+ listIntegrations(): Promise<{
109
+ integrations: AgentIntegrationListEntry[];
110
+ }>;
111
+ getIntegrationConfig(integrationId: string): Promise<IntegrationConfigResult>;
112
+ updateIntegrationConfig(integrationId: string, config: Record<string, unknown>): Promise<void>;
113
+ installIntegration(integrationId: string, options?: {
114
+ version?: string;
115
+ config?: Record<string, unknown>;
116
+ }): Promise<IntegrationInstall>;
117
+ removeIntegration(integrationId: string): Promise<IntegrationInstall>;
118
+ getOAuthUrl(provider: string, scopes?: string[], options?: {
119
+ shop?: string;
120
+ }): Promise<{
121
+ url: string;
122
+ provider: string;
123
+ expiresIn: number;
124
+ }>;
125
+ getOAuthStatus(provider: string): Promise<{
126
+ provider: string;
127
+ connected: boolean;
128
+ config?: Record<string, string>;
129
+ }>;
130
+ getRegistry(): Promise<{
131
+ integrations: RegistryEntry[];
132
+ }>;
133
+ }
134
+ //# sourceMappingURL=integrations.d.ts.map
135
+ //#endregion
73
136
  //#region src/domains/workspace.d.ts
74
137
  /** Response of GET /agent/workspace (services/agents). */
75
138
  interface AgentWorkspaceInfo {
@@ -668,6 +731,168 @@ declare class VoiceApi extends ApiBase {
668
731
  }
669
732
  //# sourceMappingURL=voice.d.ts.map
670
733
  //#endregion
734
+ //#region src/domains/identity.d.ts
735
+ type IdentityStatus = "anonymous" | "partial" | "identified" | "verified";
736
+ interface IdentityDirectoryEntry {
737
+ identityId: string;
738
+ status: IdentityStatus;
739
+ displayName: string;
740
+ name?: string;
741
+ avatarUrl?: string;
742
+ lastSeenAt: string;
743
+ lastSeenProvider?: string;
744
+ messageable: boolean;
745
+ }
746
+ declare class IdentityApi extends ApiBase {
747
+ /**
748
+ * Returns the calling agent's own identity context — `{ agentId, tenantId }`
749
+ * decoded server-side from the agent API token. Used by the
750
+ * `@alfe.ai/openclaw-identity` plugin to bootstrap context when the
751
+ * OpenClaw daemon doesn't plumb `ctx.agentId` through to plugin hooks.
752
+ * Plugins should cache this for the daemon's lifetime (single-agent-per-
753
+ * process invariant). One HTTP round-trip per process activate; not for
754
+ * per-call use.
755
+ */
756
+ whoami(): Promise<{
757
+ agentId: string;
758
+ tenantId: string;
759
+ }>;
760
+ resolveIdentity(args: {
761
+ provider: string;
762
+ platformId: string;
763
+ kind?: "user" | "agent" | "service" | "bot" | "workspace";
764
+ displayName?: string;
765
+ }): Promise<{
766
+ identityId: string | null;
767
+ status: string;
768
+ created?: boolean;
769
+ reason?: string;
770
+ /**
771
+ * Flattened auriclabs permission strings for the resolved identity
772
+ * (scope-prefixed where applicable). Empty array on miss / org service
773
+ * outage — the runtime gate fails closed in that case.
774
+ */
775
+ permissions: string[];
776
+ }>;
777
+ searchIdentities(args?: {
778
+ q?: string;
779
+ status?: string;
780
+ limit?: number;
781
+ }): Promise<{
782
+ identities: unknown[];
783
+ }>;
784
+ listIdentities(args?: {
785
+ status?: IdentityStatus;
786
+ limit?: number;
787
+ cursor?: string;
788
+ }): Promise<{
789
+ identities: IdentityDirectoryEntry[];
790
+ cursor: string | null;
791
+ }>;
792
+ getIdentityContext(identityId: string): Promise<{
793
+ context: unknown;
794
+ }>;
795
+ mergeIdentities(survivorId: string, args: {
796
+ mergedId: string;
797
+ }): Promise<{
798
+ ok: boolean;
799
+ error?: string;
800
+ }>;
801
+ unmergeIdentity(identityId: string): Promise<{
802
+ ok: boolean;
803
+ error?: string;
804
+ }>;
805
+ addIdentityNote(identityId: string, args: {
806
+ content: string;
807
+ category?: string;
808
+ }): Promise<{
809
+ noteId: string | null;
810
+ }>;
811
+ tagIdentity(identityId: string, args: {
812
+ tag: string;
813
+ action: "add" | "remove";
814
+ }): Promise<{
815
+ ok: boolean;
816
+ }>;
817
+ getIdentityChangelog(identityId: string, args?: {
818
+ limit?: number;
819
+ cursor?: string;
820
+ }): Promise<{
821
+ entries: unknown[];
822
+ cursor: string | null;
823
+ }>;
824
+ rollbackIdentity(identityId: string, args: {
825
+ targetVersion: number;
826
+ }): Promise<{
827
+ ok: boolean;
828
+ entry?: unknown;
829
+ }>;
830
+ requestIdentityVerification(args: {
831
+ claimedIdentityId: string;
832
+ requestingIdentityId: string;
833
+ requestingProvider: string;
834
+ requestingPlatformId: string;
835
+ preferredChannel?: "mobile" | "email";
836
+ /**
837
+ * Phase 2: agent-supplied contact endpoint. When provided, the top-level
838
+ * `preferredChannel` is ignored — the contact's channel wins.
839
+ */
840
+ contact?: {
841
+ channel: "email" | "mobile";
842
+ value: string;
843
+ };
844
+ }): Promise<{
845
+ verificationId: string;
846
+ channel: string;
847
+ deliveredTo: string;
848
+ expiresAt: string;
849
+ availableChannels: {
850
+ channel: string;
851
+ deliveredTo: string;
852
+ }[];
853
+ } | {
854
+ error: string;
855
+ }>;
856
+ confirmIdentityVerification(args: {
857
+ claimedIdentityId: string;
858
+ verificationId: string;
859
+ phrase: string;
860
+ }): Promise<{
861
+ verified: boolean;
862
+ identityId?: string;
863
+ /** Phase 2: how the confirm resolved — Scenario A vs B. */
864
+ action?: "merged" | "contact_verified" | "already_confirmed";
865
+ error?: string;
866
+ }>;
867
+ /**
868
+ * Update display-shape fields on an Identity. Body excludes `email` /
869
+ * `phone` / `title` / `company` / `metadata` per Section D4 — contacts go
870
+ * via the verify flow, title/company live on OrgMembership, metadata is
871
+ * not agent-writable.
872
+ */
873
+ updateIdentity(identityId: string, args: {
874
+ name?: string;
875
+ avatarUrl?: string;
876
+ timezone?: string;
877
+ locale?: string;
878
+ }): Promise<{
879
+ ok: boolean;
880
+ }>;
881
+ /**
882
+ * Phase 2 (Section H): server-side verification of a Google Chat sender via
883
+ * the agent's existing Google OAuth credentials. Returns the resolved
884
+ * identity (created or matched via Scenario-B email enrichment).
885
+ */
886
+ resolveGoogleChatSender(args: {
887
+ senderUserId: string;
888
+ spaceId?: string;
889
+ }): Promise<{
890
+ identityId: string | null;
891
+ status: string;
892
+ }>;
893
+ }
894
+ //# sourceMappingURL=identity.d.ts.map
895
+ //#endregion
671
896
  //#region src/domains/search.d.ts
672
897
  /**
673
898
  * The broad-news providers behind the metered `services/news` Lambda. The
@@ -779,6 +1004,14 @@ declare class WebhooksApi extends ApiBase {
779
1004
  //#endregion
780
1005
  //#region src/domains/chat.d.ts
781
1006
  declare class ChatApi extends ApiBase {
1007
+ ensureDirectConversation(identityId: string): Promise<{
1008
+ conversationId: string;
1009
+ identityId: string;
1010
+ tenantId: string;
1011
+ userId: string;
1012
+ displayName: string;
1013
+ created: boolean;
1014
+ }>;
782
1015
  presignAttachments(files: {
783
1016
  filename: string;
784
1017
  mimeType: string;
@@ -1431,149 +1664,6 @@ declare class DatabaseApi extends ApiBase {
1431
1664
  }
1432
1665
  //# sourceMappingURL=database.d.ts.map
1433
1666
  //#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
1667
  //#region src/domains/images.d.ts
1578
1668
  declare class ImagesApi extends ApiBase {
1579
1669
  /**
@@ -1599,34 +1689,6 @@ declare class ImagesApi extends ApiBase {
1599
1689
  }
1600
1690
  //# sourceMappingURL=images.d.ts.map
1601
1691
  //#endregion
1602
- //#region src/domains/integrations.d.ts
1603
- declare class IntegrationsApi extends ApiBase {
1604
- listIntegrations(): Promise<IntegrationInstall[]>;
1605
- getIntegrationConfig(integrationId: string): Promise<IntegrationConfigResult>;
1606
- updateIntegrationConfig(integrationId: string, config: Record<string, unknown>): Promise<void>;
1607
- installIntegration(integrationId: string, options?: {
1608
- version?: string;
1609
- config?: Record<string, unknown>;
1610
- }): Promise<IntegrationInstall>;
1611
- removeIntegration(integrationId: string): Promise<IntegrationInstall>;
1612
- getOAuthUrl(provider: string, scopes?: string[], options?: {
1613
- shop?: string;
1614
- }): Promise<{
1615
- url: string;
1616
- provider: string;
1617
- expiresIn: number;
1618
- }>;
1619
- getOAuthStatus(provider: string): Promise<{
1620
- provider: string;
1621
- connected: boolean;
1622
- config?: Record<string, string>;
1623
- }>;
1624
- getRegistry(): Promise<{
1625
- integrations: RegistryEntry[];
1626
- }>;
1627
- }
1628
- //# sourceMappingURL=integrations.d.ts.map
1629
- //#endregion
1630
1692
  //#region src/domains/memory.d.ts
1631
1693
  declare class MemoryApi extends ApiBase {
1632
1694
  memorySearch(query: string, opts?: {