@hashgraphonline/standards-sdk 0.0.88 → 0.0.89

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.
Files changed (170) hide show
  1. package/dist/es/hcs-10/connections-manager.d.ts.map +1 -1
  2. package/dist/es/standards-sdk.es10.js +2 -2
  3. package/dist/es/standards-sdk.es10.js.map +1 -1
  4. package/dist/es/standards-sdk.es104.js +15 -3
  5. package/dist/es/standards-sdk.es104.js.map +1 -1
  6. package/dist/es/standards-sdk.es105.js +4 -15
  7. package/dist/es/standards-sdk.es105.js.map +1 -1
  8. package/dist/es/standards-sdk.es106.js +39 -5
  9. package/dist/es/standards-sdk.es106.js.map +1 -1
  10. package/dist/es/standards-sdk.es107.js +38 -37
  11. package/dist/es/standards-sdk.es107.js.map +1 -1
  12. package/dist/es/standards-sdk.es108.js +33 -36
  13. package/dist/es/standards-sdk.es108.js.map +1 -1
  14. package/dist/es/standards-sdk.es109.js +75 -34
  15. package/dist/es/standards-sdk.es109.js.map +1 -1
  16. package/dist/es/standards-sdk.es110.js +4 -78
  17. package/dist/es/standards-sdk.es110.js.map +1 -1
  18. package/dist/es/standards-sdk.es111.js +34 -3
  19. package/dist/es/standards-sdk.es111.js.map +1 -1
  20. package/dist/es/standards-sdk.es112.js +33 -2
  21. package/dist/es/standards-sdk.es112.js.map +1 -1
  22. package/dist/es/standards-sdk.es113.js +9 -2
  23. package/dist/es/standards-sdk.es113.js.map +1 -1
  24. package/dist/es/standards-sdk.es114.js +32 -32
  25. package/dist/es/standards-sdk.es114.js.map +1 -1
  26. package/dist/es/standards-sdk.es115.js +3 -33
  27. package/dist/es/standards-sdk.es115.js.map +1 -1
  28. package/dist/es/standards-sdk.es116.js +2 -9
  29. package/dist/es/standards-sdk.es116.js.map +1 -1
  30. package/dist/es/standards-sdk.es117.js +2 -34
  31. package/dist/es/standards-sdk.es117.js.map +1 -1
  32. package/dist/es/standards-sdk.es13.js +3 -3
  33. package/dist/es/standards-sdk.es15.js +1 -1
  34. package/dist/es/standards-sdk.es18.js +2 -2
  35. package/dist/es/standards-sdk.es19.js +3 -3
  36. package/dist/es/standards-sdk.es22.js +1692 -966
  37. package/dist/es/standards-sdk.es22.js.map +1 -1
  38. package/dist/es/standards-sdk.es23.js +5544 -121
  39. package/dist/es/standards-sdk.es23.js.map +1 -1
  40. package/dist/es/standards-sdk.es24.js +1041 -3
  41. package/dist/es/standards-sdk.es24.js.map +1 -1
  42. package/dist/es/standards-sdk.es25.js +36 -4167
  43. package/dist/es/standards-sdk.es25.js.map +1 -1
  44. package/dist/es/standards-sdk.es26.js +48 -36
  45. package/dist/es/standards-sdk.es26.js.map +1 -1
  46. package/dist/es/standards-sdk.es27.js +3 -48
  47. package/dist/es/standards-sdk.es27.js.map +1 -1
  48. package/dist/es/standards-sdk.es28.js +2 -7190
  49. package/dist/es/standards-sdk.es28.js.map +1 -1
  50. package/dist/es/standards-sdk.es29.js +5 -2
  51. package/dist/es/standards-sdk.es29.js.map +1 -1
  52. package/dist/es/standards-sdk.es30.js +4167 -5
  53. package/dist/es/standards-sdk.es30.js.map +1 -1
  54. package/dist/es/standards-sdk.es31.js +7109 -74
  55. package/dist/es/standards-sdk.es31.js.map +1 -1
  56. package/dist/es/standards-sdk.es32.js +3 -2
  57. package/dist/es/standards-sdk.es32.js.map +1 -1
  58. package/dist/es/standards-sdk.es33.js +96 -11
  59. package/dist/es/standards-sdk.es33.js.map +1 -1
  60. package/dist/es/standards-sdk.es34.js +2 -409
  61. package/dist/es/standards-sdk.es34.js.map +1 -1
  62. package/dist/es/standards-sdk.es35.js +16 -2282
  63. package/dist/es/standards-sdk.es35.js.map +1 -1
  64. package/dist/es/standards-sdk.es36.js +400 -155
  65. package/dist/es/standards-sdk.es36.js.map +1 -1
  66. package/dist/es/standards-sdk.es38.js +2 -2
  67. package/dist/es/standards-sdk.es4.js +1 -1
  68. package/dist/es/standards-sdk.es40.js +5 -5
  69. package/dist/es/standards-sdk.es42.js +3 -3
  70. package/dist/es/standards-sdk.es48.js +1 -1
  71. package/dist/es/standards-sdk.es5.js +3 -3
  72. package/dist/es/standards-sdk.es52.js +1 -1
  73. package/dist/es/standards-sdk.es53.js +3 -3
  74. package/dist/es/standards-sdk.es55.js +2281 -194
  75. package/dist/es/standards-sdk.es55.js.map +1 -1
  76. package/dist/es/standards-sdk.es56.js +138 -412
  77. package/dist/es/standards-sdk.es56.js.map +1 -1
  78. package/dist/es/standards-sdk.es57.js +80 -21
  79. package/dist/es/standards-sdk.es57.js.map +1 -1
  80. package/dist/es/standards-sdk.es58.js +21 -137
  81. package/dist/es/standards-sdk.es58.js.map +1 -1
  82. package/dist/es/standards-sdk.es59.js +143 -13
  83. package/dist/es/standards-sdk.es59.js.map +1 -1
  84. package/dist/es/standards-sdk.es60.js +83 -21
  85. package/dist/es/standards-sdk.es60.js.map +1 -1
  86. package/dist/es/standards-sdk.es61.js +191 -25
  87. package/dist/es/standards-sdk.es61.js.map +1 -1
  88. package/dist/es/standards-sdk.es62.js +432 -15
  89. package/dist/es/standards-sdk.es62.js.map +1 -1
  90. package/dist/es/standards-sdk.es63.js +15 -34
  91. package/dist/es/standards-sdk.es63.js.map +1 -1
  92. package/dist/es/standards-sdk.es64.js +131 -10
  93. package/dist/es/standards-sdk.es64.js.map +1 -1
  94. package/dist/es/standards-sdk.es65.js +10 -53
  95. package/dist/es/standards-sdk.es65.js.map +1 -1
  96. package/dist/es/standards-sdk.es66.js +21 -1281
  97. package/dist/es/standards-sdk.es66.js.map +1 -1
  98. package/dist/es/standards-sdk.es67.js +25 -144
  99. package/dist/es/standards-sdk.es67.js.map +1 -1
  100. package/dist/es/standards-sdk.es68.js +17 -87
  101. package/dist/es/standards-sdk.es68.js.map +1 -1
  102. package/dist/es/standards-sdk.es69.js +38 -78
  103. package/dist/es/standards-sdk.es69.js.map +1 -1
  104. package/dist/es/standards-sdk.es7.js +3 -3
  105. package/dist/es/standards-sdk.es70.js +15 -29
  106. package/dist/es/standards-sdk.es70.js.map +1 -1
  107. package/dist/es/standards-sdk.es71.js +60 -5
  108. package/dist/es/standards-sdk.es71.js.map +1 -1
  109. package/dist/es/standards-sdk.es72.js +1269 -139
  110. package/dist/es/standards-sdk.es72.js.map +1 -1
  111. package/dist/es/standards-sdk.es73.js +30 -21
  112. package/dist/es/standards-sdk.es73.js.map +1 -1
  113. package/dist/es/standards-sdk.es74.js +5 -792
  114. package/dist/es/standards-sdk.es74.js.map +1 -1
  115. package/dist/es/standards-sdk.es75.js +145 -160
  116. package/dist/es/standards-sdk.es75.js.map +1 -1
  117. package/dist/es/standards-sdk.es76.js +780 -130
  118. package/dist/es/standards-sdk.es76.js.map +1 -1
  119. package/dist/es/standards-sdk.es77.js +174 -3
  120. package/dist/es/standards-sdk.es77.js.map +1 -1
  121. package/dist/es/standards-sdk.es78.js +136 -25
  122. package/dist/es/standards-sdk.es78.js.map +1 -1
  123. package/dist/es/standards-sdk.es79.js +25 -56
  124. package/dist/es/standards-sdk.es79.js.map +1 -1
  125. package/dist/es/standards-sdk.es8.js +3 -3
  126. package/dist/es/standards-sdk.es80.js +58 -45
  127. package/dist/es/standards-sdk.es80.js.map +1 -1
  128. package/dist/es/standards-sdk.es81.js +48 -8
  129. package/dist/es/standards-sdk.es81.js.map +1 -1
  130. package/dist/es/standards-sdk.es82.js +8 -63
  131. package/dist/es/standards-sdk.es82.js.map +1 -1
  132. package/dist/es/standards-sdk.es83.js +64 -5
  133. package/dist/es/standards-sdk.es83.js.map +1 -1
  134. package/dist/es/standards-sdk.es84.js +6 -15
  135. package/dist/es/standards-sdk.es84.js.map +1 -1
  136. package/dist/es/standards-sdk.es85.js +15 -7
  137. package/dist/es/standards-sdk.es85.js.map +1 -1
  138. package/dist/es/standards-sdk.es86.js +6 -44
  139. package/dist/es/standards-sdk.es86.js.map +1 -1
  140. package/dist/es/standards-sdk.es87.js +45 -2
  141. package/dist/es/standards-sdk.es87.js.map +1 -1
  142. package/dist/es/standards-sdk.es88.js +2 -136
  143. package/dist/es/standards-sdk.es88.js.map +1 -1
  144. package/dist/es/standards-sdk.es89.js +124 -160
  145. package/dist/es/standards-sdk.es89.js.map +1 -1
  146. package/dist/es/standards-sdk.es9.js +1 -1
  147. package/dist/es/standards-sdk.es90.js +172 -21
  148. package/dist/es/standards-sdk.es90.js.map +1 -1
  149. package/dist/es/standards-sdk.es91.js +19 -25
  150. package/dist/es/standards-sdk.es91.js.map +1 -1
  151. package/dist/es/standards-sdk.es92.js +24 -23
  152. package/dist/es/standards-sdk.es92.js.map +1 -1
  153. package/dist/es/standards-sdk.es93.js +23 -35
  154. package/dist/es/standards-sdk.es93.js.map +1 -1
  155. package/dist/es/standards-sdk.es94.js +36 -417
  156. package/dist/es/standards-sdk.es94.js.map +1 -1
  157. package/dist/es/standards-sdk.es95.js +419 -2
  158. package/dist/es/standards-sdk.es95.js.map +1 -1
  159. package/dist/es/standards-sdk.es96.js +2 -120
  160. package/dist/es/standards-sdk.es96.js.map +1 -1
  161. package/dist/es/standards-sdk.es97.js +120 -13
  162. package/dist/es/standards-sdk.es97.js.map +1 -1
  163. package/dist/es/standards-sdk.es98.js +13 -13
  164. package/dist/es/standards-sdk.es98.js.map +1 -1
  165. package/dist/es/standards-sdk.es99.js +13 -7136
  166. package/dist/es/standards-sdk.es99.js.map +1 -1
  167. package/dist/umd/hcs-10/connections-manager.d.ts.map +1 -1
  168. package/dist/umd/standards-sdk.umd.js +1 -1
  169. package/dist/umd/standards-sdk.umd.js.map +1 -1
  170. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"connections-manager.d.ts","sourceRoot":"","sources":["../../../src/hcs-10/connections-manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC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AIG;IACH,OAAO,CAAC,mCAAmC;IAO3C;;;OAGG;IACH,oBAAoB,IAAI,UAAU,EAAE;IAMpC;;;OAGG;IACH,iCAAiC,IAAI,UAAU,EAAE;IASjD;;;;OAIG;IACH,sBAAsB,CAAC,iBAAiB,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS;IAIzE;;;;OAIG;IACH,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS;IAOnE;;;;OAIG;IACH,yBAAyB,CAAC,SAAS,EAAE,MAAM,GAAG,UAAU,EAAE;IAM1D;;;OAGG;IACH,qBAAqB,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI;IAInD;;OAEG;IACH,QAAQ,IAAI,IAAI;IAKhB;;;;;;;OAOG;IACH,4BAA4B,CAC1B,cAAc,EAAE,MAAM,EACtB,SAAS,EAAE,MAAM,GAChB,OAAO;IAsBV;;;;;;OAMG;IACH,8BAA8B,CAC5B,cAAc,EAAE,MAAM,EACtB,SAAS,EAAE,MAAM,GAChB,OAAO;CAmCX"}
1
+ {"version":3,"file":"connections-manager.d.ts","sourceRoot":"","sources":["../../../src/hcs-10/connections-manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,IAAI,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;CAC9C;AAED;;GA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E;;;;OAIG;IACH,yBAAyB,CAAC,SAAS,EAAE,MAAM,GAAG,UAAU,EAAE;IAM1D;;;OAGG;IACH,qBAAqB,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI;IAInD;;OAEG;IACH,QAAQ,IAAI,IAAI;IAKhB;;;;;;;OAOG;IACH,4BAA4B,CAC1B,cAAc,EAAE,MAAM,EACtB,SAAS,EAAE,MAAM,GAChB,OAAO;IAsBV;;;;;;OAMG;IACH,8BAA8B,CAC5B,cAAc,EAAE,MAAM,EACtB,SAAS,EAAE,MAAM,GAChB,OAAO;CAmCX"}
@@ -689,7 +689,7 @@ class ConnectionsManager {
689
689
  getPendingRequests() {
690
690
  const pendingConnections = Array.from(this.connections.values()).filter(
691
691
  (conn) => {
692
- return conn.isPending && (!this.filterPendingAccountIds.has(conn.targetAccountId) || this.hasEstablishedConnectionWithAccount(conn.targetAccountId));
692
+ return conn.isPending && !this.filterPendingAccountIds.has(conn.targetAccountId);
693
693
  }
694
694
  );
695
695
  return pendingConnections;
@@ -719,7 +719,7 @@ class ConnectionsManager {
719
719
  */
720
720
  getConnectionsNeedingConfirmation() {
721
721
  return Array.from(this.connections.values()).filter(
722
- (conn) => conn.needsConfirmation && (!this.filterPendingAccountIds.has(conn.targetAccountId) || this.hasEstablishedConnectionWithAccount(conn.targetAccountId))
722
+ (conn) => conn.needsConfirmation && !this.filterPendingAccountIds.has(conn.targetAccountId)
723
723
  );
724
724
  }
725
725
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"standards-sdk.es10.js","sources":["../../src/hcs-10/connections-manager.ts"],"sourcesContent":["import { Logger, LoggerOptions } from '../utils/logger';\nimport { HCSMessage, HCS10BaseClient } from './base-client';\nimport { AIAgentProfile } from '../hcs-11';\n\n/**\n * Represents a connection request between agents\n */\nexport interface ConnectionRequest {\n id: number;\n requesterId: string;\n requesterTopicId: string;\n targetAccountId: string;\n targetTopicId: string;\n operatorId: string;\n sequenceNumber: number;\n created: Date;\n memo?: string;\n status: 'pending' | 'confirmed' | 'rejected';\n}\n\n/**\n * Represents an active connection between agents\n */\nexport interface Connection {\n connectionTopicId: string;\n targetAccountId: string;\n targetAgentName?: string;\n targetInboundTopicId?: string;\n targetOutboundTopicId?: string;\n status: 'pending' | 'established' | 'needs_confirmation' | 'closed';\n isPending: boolean;\n needsConfirmation: boolean;\n memo?: string;\n created: Date;\n lastActivity?: Date;\n profileInfo?: AIAgentProfile;\n connectionRequestId?: number;\n confirmedRequestId?: number;\n requesterOutboundTopicId?: string;\n inboundRequestId?: number;\n closedReason?: string;\n closeMethod?: string;\n uniqueRequestKey?: string;\n originTopicId?: string;\n processed: boolean;\n}\n\n/**\n * Options for the connections manager\n */\nexport interface ConnectionsManagerOptions {\n logLevel?: 'debug' | 'info' | 'warn' | 'error';\n filterPendingAccountIds?: string[];\n baseClient: HCS10BaseClient;\n}\n\n/**\n * Defines the interface for a connections manager that handles HCS-10 connections\n * This interface represents the public API of ConnectionsManager\n */\nexport interface IConnectionsManager {\n /**\n * Fetches and processes connection data using the configured client\n * @param accountId - The account ID to fetch connection data for\n * @returns A promise that resolves to an array of Connection objects\n */\n fetchConnectionData(accountId: string): Promise<Connection[]>;\n\n /**\n * Process outbound messages to track connection requests and confirmations\n * @param messages - The messages to process\n * @param accountId - The account ID that sent the messages\n * @returns Array of connections after processing\n */\n processOutboundMessages(\n messages: HCSMessage[],\n accountId: string\n ): Connection[];\n\n /**\n * Process inbound messages to track connection requests and confirmations\n * @param messages - The messages to process\n * @returns Array of connections after processing\n */\n processInboundMessages(messages: HCSMessage[]): Connection[];\n\n /**\n * Process connection topic messages to update last activity time\n * @param connectionTopicId - The topic ID of the connection\n * @param messages - The messages to process\n * @returns The updated connection or undefined if not found\n */\n processConnectionMessages(\n connectionTopicId: string,\n messages: HCSMessage[]\n ): Connection | undefined;\n\n /**\n * Adds or updates profile information for a connection\n * @param accountId - The account ID to add profile info for\n * @param profile - The profile information\n */\n addProfileInfo(accountId: string, profile: AIAgentProfile): void;\n\n /**\n * Gets all connections\n * @returns Array of all connections that should be visible\n */\n getAllConnections(): Connection[];\n\n /**\n * Gets all pending connection requests\n * @returns Array of pending connection requests\n */\n getPendingRequests(): Connection[];\n\n /**\n * Gets all active (established) connections\n * @returns Array of active connections\n */\n getActiveConnections(): Connection[];\n\n /**\n * Gets all connections needing confirmation\n * @returns Array of connections needing confirmation\n */\n getConnectionsNeedingConfirmation(): Connection[];\n\n /**\n * Gets a connection by its topic ID\n * @param connectionTopicId - The topic ID to look up\n * @returns The connection with the given topic ID, or undefined if not found\n */\n getConnectionByTopicId(connectionTopicId: string): Connection | undefined;\n\n /**\n * Gets a connection by account ID\n * @param accountId - The account ID to look up\n * @returns The connection with the given account ID, or undefined if not found\n */\n getConnectionByAccountId(accountId: string): Connection | undefined;\n\n /**\n * Gets all connections for a specific account ID\n * @param accountId - The account ID to look up\n * @returns Array of connections for the given account ID\n */\n getConnectionsByAccountId(accountId: string): Connection[];\n\n /**\n * Updates or adds a connection\n * @param connection - The connection to update or add\n */\n updateOrAddConnection(connection: Connection): void;\n\n /**\n * Clears all tracked connections and requests\n */\n clearAll(): void;\n\n /**\n * Checks if a given connection request has been processed already\n * This uses a combination of topic ID and request ID to uniquely identify requests\n *\n * @param inboundTopicId - The inbound topic ID where the request was received\n * @param requestId - The sequence number (request ID)\n * @returns True if this specific request has been processed, false otherwise\n */\n isConnectionRequestProcessed(\n inboundTopicId: string,\n requestId: number\n ): boolean;\n\n /**\n * Marks a specific connection request as processed\n *\n * @param inboundTopicId - The inbound topic ID where the request was received\n * @param requestId - The sequence number (request ID)\n * @returns True if a matching connection was found and marked, false otherwise\n */\n markConnectionRequestProcessed(\n inboundTopicId: string,\n requestId: number\n ): boolean;\n}\n\n/**\n * ConnectionsManager provides a unified way to track and manage HCS-10 connections\n * across different applications. It works with both frontend and backend implementations.\n */\nexport class ConnectionsManager implements IConnectionsManager {\n private logger: Logger;\n private connections: Map<string, Connection> = new Map();\n private pendingRequests: Map<string, ConnectionRequest> = new Map();\n private profileCache: Map<string, AIAgentProfile> = new Map();\n private filterPendingAccountIds: Set<string> = new Set();\n private baseClient: HCS10BaseClient;\n\n /**\n * Creates a new ConnectionsManager instance\n */\n constructor(options: ConnectionsManagerOptions) {\n const loggerOptions: LoggerOptions = {\n module: 'ConnectionsManager',\n level: options?.logLevel || 'info',\n prettyPrint: true,\n };\n this.logger = new Logger(loggerOptions);\n\n if (options?.filterPendingAccountIds) {\n this.filterPendingAccountIds = new Set(options.filterPendingAccountIds);\n }\n\n if (!options.baseClient) {\n throw new Error('ConnectionsManager requires a baseClient to operate');\n }\n\n this.baseClient = options.baseClient;\n }\n\n /**\n * Fetches and processes connection data using the configured client\n * @param accountId - The account ID to fetch connection data for\n * @returns A promise that resolves to an array of Connection objects\n */\n async fetchConnectionData(accountId: string): Promise<Connection[]> {\n try {\n const topicInfo = await this.baseClient.retrieveCommunicationTopics(\n accountId\n );\n\n const isValidTopicId = (topicId: string): boolean => {\n return Boolean(topicId) && !topicId.includes(':');\n };\n\n if (\n !isValidTopicId(topicInfo.inboundTopic) ||\n !isValidTopicId(topicInfo.outboundTopic)\n ) {\n this.logger.warn(\n 'Invalid topic IDs detected in retrieved communication topics'\n );\n return this.getAllConnections();\n }\n\n const [outboundMessagesResult, inboundMessagesResult] = await Promise.all(\n [\n this.baseClient.getMessages(topicInfo.outboundTopic),\n this.baseClient.getMessages(topicInfo.inboundTopic),\n ]\n );\n\n this.processOutboundMessages(\n outboundMessagesResult.messages || [],\n accountId\n );\n this.processInboundMessages(inboundMessagesResult.messages || []);\n\n const pendingCount = Array.from(this.connections.values()).filter(\n (conn) => conn.status === 'pending' || conn.isPending\n ).length;\n this.logger.debug(\n `Processed ${\n outboundMessagesResult.messages?.length || 0\n } outbound and ${\n inboundMessagesResult.messages?.length || 0\n } inbound messages. Found ${pendingCount} pending connections.`\n );\n\n await this.checkTargetInboundTopicsForConfirmations();\n await this.checkOutboundRequestsForConfirmations();\n await this.fetchProfilesForConnections();\n await this.fetchConnectionActivity();\n\n return this.getAllConnections();\n } catch (error) {\n this.logger.error('Error fetching connection data:', error);\n return this.getAllConnections();\n }\n }\n\n /**\n * Checks target agent inbound topics to find confirmations for pending requests\n * that might not be visible in our local messages\n */\n private async checkTargetInboundTopicsForConfirmations(): Promise<void> {\n const pendingConnections = Array.from(this.connections.values()).filter(\n (conn) =>\n (conn.isPending || conn.status === 'pending') &&\n conn.targetInboundTopicId\n );\n\n if (pendingConnections.length === 0) {\n return;\n }\n\n const pendingRequestsByTarget = new Map<string, Connection[]>();\n\n pendingConnections.forEach((conn) => {\n if (conn.targetInboundTopicId) {\n const requests =\n pendingRequestsByTarget.get(conn.targetInboundTopicId) || [];\n requests.push(conn);\n pendingRequestsByTarget.set(conn.targetInboundTopicId, requests);\n }\n });\n\n const MAX_FETCH_ATTEMPTS = 2;\n const FETCH_DELAY_MS = 500;\n\n for (const [\n targetInboundTopicId,\n requests,\n ] of pendingRequestsByTarget.entries()) {\n for (let attempt = 1; attempt <= MAX_FETCH_ATTEMPTS; attempt++) {\n try {\n const targetMessagesResult = await this.baseClient.getMessages(\n targetInboundTopicId\n );\n const targetMessages = targetMessagesResult.messages || [];\n\n let confirmedAny = false;\n\n for (const conn of requests) {\n const requestId = conn.connectionRequestId;\n if (!requestId) {\n continue;\n }\n\n const confirmationMsg = targetMessages.find((msg) => {\n if (msg.op !== 'connection_created' || !msg.connection_topic_id) {\n return false;\n }\n\n if (msg.connection_id !== requestId) {\n return false;\n }\n\n if (conn.uniqueRequestKey) {\n const keyParts = conn.uniqueRequestKey.split(':');\n if (keyParts.length > 1) {\n const operatorIdPart = keyParts[1];\n\n if (msg.operator_id && msg.operator_id === operatorIdPart) {\n return true;\n }\n\n if (msg.connected_account_id === conn.targetAccountId) {\n return true;\n }\n }\n }\n\n return true;\n });\n\n if (confirmationMsg?.connection_topic_id) {\n confirmedAny = true;\n\n const connectionTopicId = confirmationMsg.connection_topic_id;\n\n let pendingKey = conn.uniqueRequestKey;\n\n const newConnection: Connection = {\n connectionTopicId,\n targetAccountId: conn.targetAccountId,\n targetAgentName: conn.targetAgentName,\n targetInboundTopicId: conn.targetInboundTopicId,\n status: 'established',\n isPending: false,\n needsConfirmation: false,\n created: new Date(confirmationMsg.created || conn.created),\n profileInfo: conn.profileInfo,\n connectionRequestId: requestId,\n uniqueRequestKey: conn.uniqueRequestKey,\n originTopicId: conn.originTopicId,\n processed: conn.processed,\n memo: conn.memo,\n };\n\n this.connections.set(connectionTopicId, newConnection);\n\n if (pendingKey) {\n this.connections.delete(pendingKey);\n }\n\n this.logger.debug(\n `Confirmed connection in target inbound topic: ${connectionTopicId}`\n );\n }\n }\n\n if (confirmedAny || attempt === MAX_FETCH_ATTEMPTS) {\n break;\n }\n\n await new Promise((resolve) => setTimeout(resolve, FETCH_DELAY_MS));\n } catch (error) {\n this.logger.debug(\n `Error fetching target inbound topic ${targetInboundTopicId}:`,\n error\n );\n if (attempt === MAX_FETCH_ATTEMPTS) {\n break;\n }\n await new Promise((resolve) => setTimeout(resolve, FETCH_DELAY_MS));\n }\n }\n }\n }\n\n /**\n * Checks target agents' inbound topics for confirmations of our outbound connection requests\n * This complements checkTargetInboundTopicsForConfirmations by looking for confirmations\n * that might have been sent to the target agent's inbound topic rather than our own\n */\n private async checkOutboundRequestsForConfirmations(): Promise<void> {\n const allConnections = Array.from(this.connections.values());\n this.logger.info(`Total connections in map: ${allConnections.length}`);\n\n const pendingByStatus = allConnections.filter(\n (conn) => conn.status === 'pending'\n );\n this.logger.info(\n `Connections with status='pending': ${pendingByStatus.length}`\n );\n\n const pendingConnections = allConnections.filter(\n (conn) => conn.status === 'pending'\n );\n\n if (!Boolean(pendingConnections?.length)) {\n this.logger.info('No pending connections found');\n return;\n }\n\n for (const conn of pendingConnections) {\n this.logger.debug(\n `Processing pending connection: ${conn.connectionTopicId}`\n );\n\n if (!conn.targetAccountId) {\n this.logger.debug(\n `Skipping connection ${conn.connectionTopicId} - no targetAccountId`\n );\n continue;\n }\n\n let targetInboundTopicId = conn.targetInboundTopicId;\n if (!targetInboundTopicId) {\n try {\n const profileResponse = await this.baseClient.retrieveProfile(\n conn.targetAccountId\n );\n if (profileResponse?.profile?.inboundTopicId) {\n targetInboundTopicId = profileResponse.profile.inboundTopicId;\n this.connections.set(conn.connectionTopicId, {\n ...conn,\n targetInboundTopicId,\n });\n this.logger.debug(\n `Updated connection ${conn.connectionTopicId} with inbound topic ID: ${targetInboundTopicId}`\n );\n } else {\n this.logger.debug(\n `Couldn't get inbound topic ID for account ${conn.targetAccountId}`\n );\n continue;\n }\n } catch (error) {\n this.logger.debug(\n `Error fetching profile for ${conn.targetAccountId}: ${error}`\n );\n continue;\n }\n }\n\n if (!targetInboundTopicId || targetInboundTopicId.includes(':')) {\n this.logger.debug(\n `Skipping invalid inbound topic format: ${targetInboundTopicId}`\n );\n continue;\n }\n\n const requestId = conn.connectionRequestId || conn.inboundRequestId;\n if (!requestId) {\n this.logger.debug(\n `Skipping connection ${conn.connectionTopicId} - no request ID`\n );\n continue;\n }\n\n try {\n this.logger.debug(\n `Checking for confirmations on topic ${targetInboundTopicId} for request ID ${requestId}`\n );\n const targetMessagesResult = await this.baseClient.getMessages(\n targetInboundTopicId\n );\n const targetMessages = targetMessagesResult.messages || [];\n\n const confirmationMsg = targetMessages.find(\n (msg) =>\n msg.op === 'connection_created' &&\n msg.connection_id === requestId &&\n msg.connection_topic_id\n );\n\n if (confirmationMsg?.connection_topic_id) {\n const connectionTopicId = confirmationMsg.connection_topic_id;\n this.logger.info(\n `Found confirmation for request #${requestId} to ${conn.targetAccountId} on their inbound topic`\n );\n\n this.connections.set(conn.connectionTopicId, {\n ...conn,\n connectionTopicId,\n status: 'established',\n isPending: false,\n needsConfirmation: false,\n created: new Date(confirmationMsg.created || conn.created),\n lastActivity: new Date(confirmationMsg.created || conn.created),\n });\n } else {\n this.logger.debug(\n `No confirmation found for request ID ${requestId} on topic ${targetInboundTopicId}`\n );\n }\n } catch (error) {\n this.logger.warn(\n `Error checking for confirmations on target inbound topic for ${conn.targetAccountId}: ${error}`\n );\n }\n }\n }\n\n /**\n * Fetches profiles for all connected accounts\n * @param accountId - The account ID making the request\n */\n private async fetchProfilesForConnections(): Promise<void> {\n const targetAccountIds = new Set<string>();\n\n for (const connection of this.connections.values()) {\n if (\n connection.targetAccountId &&\n !this.profileCache.has(connection.targetAccountId)\n ) {\n targetAccountIds.add(connection.targetAccountId);\n }\n }\n\n const accountIdPromises = Array.from(targetAccountIds).map(\n async (targetId) => {\n try {\n const profileResponse = await this.baseClient.retrieveProfile(\n targetId\n );\n if (profileResponse.success && profileResponse.profile) {\n this.addProfileInfo(targetId, profileResponse.profile);\n\n this.updatePendingConnectionsWithProfileInfo(\n targetId,\n profileResponse.profile\n );\n }\n } catch (error) {\n this.logger.debug(`Failed to fetch profile for ${targetId}:`, error);\n }\n }\n );\n\n await Promise.allSettled(accountIdPromises);\n }\n\n /**\n * Updates pending connections with inbound topic IDs from profile info\n * @param accountId - The account ID to update connections for\n * @param profile - The profile containing the inbound topic ID\n */\n private updatePendingConnectionsWithProfileInfo(\n accountId: string,\n profile: AIAgentProfile\n ): void {\n const pendingConnections = Array.from(this.connections.values()).filter(\n (conn) =>\n conn.targetAccountId === accountId &&\n (conn.isPending || conn.needsConfirmation) &&\n !conn.targetInboundTopicId\n );\n\n if (pendingConnections.length > 0 && profile.inboundTopicId) {\n for (const conn of pendingConnections) {\n const updatedConn = {\n ...conn,\n targetInboundTopicId: profile.inboundTopicId,\n };\n this.connections.set(conn.connectionTopicId, updatedConn);\n }\n }\n }\n\n /**\n * Fetches activity from active connection topics\n * Updates the lastActivity timestamp for each connection based on latest messages\n * @returns Promise that resolves when all activity has been fetched\n */\n private async fetchConnectionActivity(): Promise<void> {\n const activeConnections = this.getActiveConnections();\n\n const validConnections = activeConnections.filter((connection) => {\n const topicId = connection.connectionTopicId;\n\n if (!topicId || topicId.includes(':') || !topicId.match(/^0\\.0\\.\\d+$/)) {\n this.logger.debug(\n `Skipping activity fetch for invalid topic ID format: ${topicId}`\n );\n return false;\n }\n return true;\n });\n\n const activityPromises = validConnections.map(async (connection) => {\n try {\n const topicId = connection.connectionTopicId;\n const messagesResult = await this.baseClient.getMessages(topicId);\n\n if (messagesResult?.messages?.length > 0) {\n this.processConnectionMessages(topicId, messagesResult.messages);\n }\n } catch (error) {\n this.logger.debug(\n `Failed to fetch activity for ${connection.connectionTopicId}:`,\n error\n );\n }\n });\n\n await Promise.allSettled(activityPromises);\n }\n\n /**\n * Checks if an account should be filtered, taking into account existing established connections\n * @param accountId - The account ID to check\n * @returns True if the account should be filtered, false otherwise\n */\n private shouldFilterAccount(accountId: string): boolean {\n if (!this.filterPendingAccountIds.has(accountId)) {\n return false;\n }\n\n if (this.hasEstablishedConnectionWithAccount(accountId)) {\n return false;\n }\n\n return true;\n }\n\n /**\n * Process outbound messages to track connection requests and confirmations\n * @param messages - The messages to process\n * @param accountId - The account ID that sent the messages\n * @returns Array of connections after processing\n */\n processOutboundMessages(\n messages: HCSMessage[],\n accountId: string\n ): Connection[] {\n if (!Boolean(messages?.length)) {\n return Array.from(this.connections.values());\n }\n\n const requestMessages = messages.filter(\n (msg) => msg.op === 'connection_request' && msg.connection_request_id\n );\n\n for (const msg of requestMessages) {\n const requestId = msg.connection_request_id!;\n const operatorId = msg.operator_id || '';\n const targetAccountId =\n this.baseClient.extractAccountFromOperatorId(operatorId);\n const targetInboundTopicId =\n this.baseClient.extractTopicFromOperatorId(operatorId);\n\n if (this.shouldFilterAccount(targetAccountId)) {\n this.logger.debug(\n `Filtering out outbound request to account: ${targetAccountId}`\n );\n continue;\n }\n\n const isAlreadyConfirmed = Array.from(this.connections.values()).some(\n (conn) =>\n conn.connectionRequestId === requestId &&\n !conn.isPending &&\n conn.targetAccountId === targetAccountId\n );\n\n const pendingKey = `req-${requestId}:${operatorId}`;\n\n if (!isAlreadyConfirmed && !this.pendingRequests.has(pendingKey)) {\n const pendingRequest = {\n id: requestId,\n requesterId: accountId,\n requesterTopicId: msg.outbound_topic_id || '',\n targetAccountId,\n targetTopicId: targetInboundTopicId,\n operatorId,\n sequenceNumber: msg.sequence_number,\n created: msg.created || new Date(),\n memo: msg.m,\n status: 'pending' as 'pending' | 'confirmed' | 'rejected',\n };\n\n this.pendingRequests.set(pendingKey, pendingRequest);\n\n if (!this.connections.has(pendingKey)) {\n const pendingConnection = {\n connectionTopicId: pendingKey,\n targetAccountId,\n targetInboundTopicId,\n status: 'pending' as\n | 'pending'\n | 'established'\n | 'needs_confirmation'\n | 'closed',\n isPending: true,\n needsConfirmation: false,\n created: msg.created || new Date(),\n connectionRequestId: requestId,\n uniqueRequestKey: pendingKey,\n originTopicId: msg.outbound_topic_id || '',\n processed: false,\n memo: msg.m,\n };\n\n this.connections.set(pendingKey, pendingConnection);\n }\n }\n }\n\n const confirmationMessages = messages.filter(\n (msg) =>\n msg.op === 'connection_created' &&\n msg.connection_topic_id &&\n msg.connection_request_id\n );\n\n for (const msg of confirmationMessages) {\n const requestId = msg.connection_request_id!;\n const connectionTopicId = msg.connection_topic_id!;\n const targetAccountId = this.baseClient.extractAccountFromOperatorId(\n msg.operator_id || ''\n );\n\n if (this.shouldFilterAccount(targetAccountId)) {\n this.logger.debug(\n `Filtering out outbound confirmation to account: ${targetAccountId}`\n );\n continue;\n }\n\n const pendingKey = `req-${requestId}:${msg.operator_id}`;\n\n const pendingRequest = this.pendingRequests.get(pendingKey);\n if (pendingRequest) {\n pendingRequest.status = 'confirmed';\n }\n\n if (this.connections.has(pendingKey)) {\n this.connections.delete(pendingKey);\n }\n\n if (!this.connections.has(connectionTopicId)) {\n this.connections.set(connectionTopicId, {\n connectionTopicId,\n targetAccountId,\n status: 'established',\n isPending: false,\n needsConfirmation: false,\n created: msg.created || new Date(),\n connectionRequestId: requestId,\n confirmedRequestId: msg.confirmed_request_id,\n requesterOutboundTopicId: msg.outbound_topic_id,\n uniqueRequestKey: pendingKey,\n originTopicId: msg.outbound_topic_id || '',\n processed: false,\n memo: msg.m,\n });\n } else {\n const conn = this.connections.get(connectionTopicId)!;\n this.connections.set(connectionTopicId, {\n ...conn,\n status: 'established',\n isPending: false,\n needsConfirmation: false,\n connectionRequestId: requestId,\n confirmedRequestId: msg.confirmed_request_id,\n requesterOutboundTopicId: msg.outbound_topic_id,\n uniqueRequestKey: pendingKey,\n originTopicId: msg.outbound_topic_id || '',\n processed: false,\n memo: msg.m,\n });\n }\n }\n\n const closedMessages = messages.filter(\n (msg) =>\n (msg.op as string) === 'connection_closed' ||\n (msg.op === 'close_connection' && msg.connection_topic_id)\n );\n\n for (const msg of closedMessages) {\n const connectionTopicId = msg.connection_topic_id!;\n\n if (this.connections.has(connectionTopicId)) {\n const conn = this.connections.get(connectionTopicId)!;\n if (\n this.shouldFilterAccount(conn.targetAccountId) &&\n conn.status !== 'established'\n ) {\n continue;\n }\n\n const uniqueKey =\n msg.connection_request_id && msg.operator_id\n ? `req-${msg.connection_request_id}:${msg.operator_id}`\n : undefined;\n\n this.connections.set(connectionTopicId, {\n ...conn,\n status: 'closed',\n isPending: false,\n needsConfirmation: false,\n lastActivity: msg.created || new Date(),\n closedReason: msg.reason,\n closeMethod: msg.close_method,\n uniqueRequestKey: uniqueKey,\n originTopicId: conn.originTopicId,\n processed: false,\n memo: msg.m,\n });\n }\n }\n\n return Array.from(this.connections.values()).filter(\n (conn) =>\n conn.status === 'established' ||\n conn.status === 'closed' ||\n !this.filterPendingAccountIds.has(conn.targetAccountId)\n );\n }\n\n /**\n * Process inbound messages to track connection requests and confirmations\n * @param messages - The messages to process\n * @returns Array of connections after processing\n */\n processInboundMessages(messages: HCSMessage[]): Connection[] {\n if (!Boolean(messages?.length)) {\n return Array.from(this.connections.values());\n }\n\n const requestMessages = messages.filter(\n (msg) => msg.op === 'connection_request' && msg.sequence_number\n );\n\n for (const msg of requestMessages) {\n const sequenceNumber = msg.sequence_number;\n const operatorId = msg.operator_id || '';\n const requestorAccountId =\n this.baseClient.extractAccountFromOperatorId(operatorId);\n const requestorTopicId =\n this.baseClient.extractTopicFromOperatorId(operatorId);\n\n if (this.shouldFilterAccount(requestorAccountId)) {\n this.logger.debug(\n `Filtering out request from account: ${requestorAccountId}`\n );\n continue;\n }\n\n const needsConfirmKey = `inb-${sequenceNumber}:${operatorId}`;\n\n if (!this.connections.has(needsConfirmKey)) {\n this.connections.set(needsConfirmKey, {\n connectionTopicId: needsConfirmKey,\n targetAccountId: requestorAccountId,\n targetInboundTopicId: requestorTopicId,\n status: 'needs_confirmation',\n isPending: false,\n needsConfirmation: true,\n created: msg.created || new Date(),\n inboundRequestId: sequenceNumber,\n uniqueRequestKey: needsConfirmKey,\n originTopicId: requestorTopicId,\n processed: false,\n memo: msg.m,\n });\n }\n }\n\n const confirmationMessages = messages.filter(\n (msg) =>\n msg.op === 'connection_created' &&\n msg.connection_topic_id &&\n msg.connection_id\n );\n\n for (const msg of confirmationMessages) {\n const sequenceNumber = msg.connection_id!;\n const connectionTopicId = msg.connection_topic_id!;\n const connectedAccountId = msg.connected_account_id || '';\n const operatorId = msg.operator_id || '';\n\n if (this.shouldFilterAccount(connectedAccountId)) {\n this.logger.debug(\n `Filtering out confirmation for account: ${connectedAccountId}`\n );\n continue;\n }\n\n const needsConfirmKey = `inb-${sequenceNumber}:${operatorId}`;\n\n if (this.connections.has(needsConfirmKey)) {\n this.connections.delete(needsConfirmKey);\n }\n\n if (!this.connections.has(connectionTopicId)) {\n this.connections.set(connectionTopicId, {\n connectionTopicId,\n targetAccountId: connectedAccountId,\n status: 'established',\n isPending: false,\n needsConfirmation: false,\n created: msg.created || new Date(),\n inboundRequestId: sequenceNumber,\n uniqueRequestKey: needsConfirmKey,\n originTopicId: msg.connection_topic_id,\n processed: false,\n memo: msg.m,\n });\n } else {\n const conn = this.connections.get(connectionTopicId)!;\n this.connections.set(connectionTopicId, {\n ...conn,\n status: 'established',\n isPending: false,\n needsConfirmation: false,\n inboundRequestId: sequenceNumber,\n uniqueRequestKey: needsConfirmKey,\n originTopicId: msg.connection_topic_id,\n processed: false,\n memo: msg.m,\n });\n }\n }\n\n return Array.from(this.connections.values()).filter(\n (conn) =>\n conn.status === 'established' ||\n conn.status === 'closed' ||\n !this.filterPendingAccountIds.has(conn.targetAccountId)\n );\n }\n\n /**\n * Process connection topic messages to update last activity time\n * @param connectionTopicId - The topic ID of the connection\n * @param messages - The messages to process\n * @returns The updated connection or undefined if not found\n */\n processConnectionMessages(\n connectionTopicId: string,\n messages: HCSMessage[]\n ): Connection | undefined {\n if (\n !messages ||\n messages.length === 0 ||\n !this.connections.has(connectionTopicId)\n ) {\n return this.connections.get(connectionTopicId);\n }\n\n const latestMessage = messages\n .filter((m) => m.created)\n .sort((a, b) => {\n const dateA = a.created ? new Date(a.created).getTime() : 0;\n const dateB = b.created ? new Date(b.created).getTime() : 0;\n return dateB - dateA;\n })[0];\n\n if (latestMessage?.created) {\n const conn = this.connections.get(connectionTopicId)!;\n this.connections.set(connectionTopicId, {\n ...conn,\n lastActivity: latestMessage.created,\n });\n }\n\n const closeMessage = messages.find((msg) => msg.op === 'close_connection');\n if (closeMessage) {\n const conn = this.connections.get(connectionTopicId)!;\n this.connections.set(connectionTopicId, {\n ...conn,\n status: 'closed',\n lastActivity: closeMessage.created || new Date(),\n closedReason: closeMessage.reason,\n closeMethod: 'explicit',\n });\n }\n\n return this.connections.get(connectionTopicId);\n }\n\n /**\n * Adds or updates profile information for a connection\n * @param accountId - The account ID to add profile info for\n * @param profile - The profile information\n */\n addProfileInfo(accountId: string, profile: AIAgentProfile): void {\n this.profileCache.set(accountId, profile);\n\n const matchingConnections = Array.from(this.connections.values()).filter(\n (conn) => conn.targetAccountId === accountId\n );\n\n for (const conn of matchingConnections) {\n this.connections.set(conn.connectionTopicId, {\n ...conn,\n profileInfo: profile,\n targetAgentName: profile.display_name,\n targetInboundTopicId: profile.inboundTopicId,\n targetOutboundTopicId: profile.outboundTopicId,\n });\n }\n }\n\n /**\n * Gets all connections\n * @returns Array of all connections that should be visible\n */\n getAllConnections(): Connection[] {\n const connections = Array.from(this.connections.values()).filter(\n (conn) =>\n conn.status === 'established' ||\n conn.status === 'closed' ||\n !this.filterPendingAccountIds.has(conn.targetAccountId) ||\n this.hasEstablishedConnectionWithAccount(conn.targetAccountId)\n );\n return connections;\n }\n\n /**\n * Gets all pending connection requests\n * @returns Array of pending connection requests\n */\n getPendingRequests(): Connection[] {\n const pendingConnections = Array.from(this.connections.values()).filter(\n (conn) => {\n return (\n conn.isPending &&\n (!this.filterPendingAccountIds.has(conn.targetAccountId) ||\n this.hasEstablishedConnectionWithAccount(conn.targetAccountId))\n );\n }\n );\n\n return pendingConnections;\n }\n\n /**\n * Helper method to check if there's an established connection with an account\n * @param accountId - The account ID to check\n * @returns True if there's an established connection, false otherwise\n */\n private hasEstablishedConnectionWithAccount(accountId: string): boolean {\n return Array.from(this.connections.values()).some(\n (conn) =>\n conn.targetAccountId === accountId && conn.status === 'established'\n );\n }\n\n /**\n * Gets all active (established) connections\n * @returns Array of active connections\n */\n getActiveConnections(): Connection[] {\n return Array.from(this.connections.values()).filter(\n (conn) => conn.status === 'established'\n );\n }\n\n /**\n * Gets all connections needing confirmation\n * @returns Array of connections needing confirmation\n */\n getConnectionsNeedingConfirmation(): Connection[] {\n return Array.from(this.connections.values()).filter(\n (conn) =>\n conn.needsConfirmation &&\n (!this.filterPendingAccountIds.has(conn.targetAccountId) ||\n this.hasEstablishedConnectionWithAccount(conn.targetAccountId))\n );\n }\n\n /**\n * Gets a connection by its topic ID\n * @param connectionTopicId - The topic ID to look up\n * @returns The connection with the given topic ID, or undefined if not found\n */\n getConnectionByTopicId(connectionTopicId: string): Connection | undefined {\n return this.connections.get(connectionTopicId);\n }\n\n /**\n * Gets a connection by account ID\n * @param accountId - The account ID to look up\n * @returns The connection with the given account ID, or undefined if not found\n */\n getConnectionByAccountId(accountId: string): Connection | undefined {\n return Array.from(this.connections.values()).find(\n (conn) =>\n conn.targetAccountId === accountId && conn.status === 'established'\n );\n }\n\n /**\n * Gets all connections for a specific account ID\n * @param accountId - The account ID to look up\n * @returns Array of connections for the given account ID\n */\n getConnectionsByAccountId(accountId: string): Connection[] {\n return Array.from(this.connections.values()).filter(\n (conn) => conn.targetAccountId === accountId\n );\n }\n\n /**\n * Updates or adds a connection\n * @param connection - The connection to update or add\n */\n updateOrAddConnection(connection: Connection): void {\n this.connections.set(connection.connectionTopicId, connection);\n }\n\n /**\n * Clears all tracked connections and requests\n */\n clearAll(): void {\n this.connections.clear();\n this.pendingRequests.clear();\n }\n\n /**\n * Checks if a given connection request has been processed already\n * This uses a combination of topic ID and request ID to uniquely identify requests\n *\n * @param inboundTopicId - The inbound topic ID where the request was received\n * @param requestId - The sequence number (request ID)\n * @returns True if this specific request has been processed, false otherwise\n */\n isConnectionRequestProcessed(\n inboundTopicId: string,\n requestId: number\n ): boolean {\n for (const conn of this.connections.values()) {\n if (\n conn.originTopicId === inboundTopicId &&\n conn.inboundRequestId === requestId &&\n conn.processed\n ) {\n return true;\n }\n\n if (\n conn.originTopicId === inboundTopicId &&\n conn.connectionRequestId === requestId &&\n conn.processed\n ) {\n return true;\n }\n }\n\n return false;\n }\n\n /**\n * Marks a specific connection request as processed\n *\n * @param inboundTopicId - The inbound topic ID where the request was received\n * @param requestId - The sequence number (request ID)\n * @returns True if a matching connection was found and marked, false otherwise\n */\n markConnectionRequestProcessed(\n inboundTopicId: string,\n requestId: number\n ): boolean {\n let found = false;\n\n for (const [key, conn] of this.connections.entries()) {\n if (\n conn.originTopicId === inboundTopicId &&\n conn.inboundRequestId === requestId\n ) {\n this.connections.set(key, {\n ...conn,\n processed: true,\n });\n found = true;\n this.logger.debug(\n `Marked inbound connection request #${requestId} on topic ${inboundTopicId} as processed`\n );\n }\n\n if (\n conn.originTopicId === inboundTopicId &&\n conn.connectionRequestId === requestId\n ) {\n this.connections.set(key, {\n ...conn,\n processed: true,\n });\n found = true;\n this.logger.debug(\n `Marked outbound connection request #${requestId} on topic ${inboundTopicId} as processed`\n );\n }\n }\n\n return found;\n }\n}\n"],"names":[],"mappings":";AA8LO,MAAM,m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AAkB,kBACvB,KAAK,qBAAqB,WAC1B;AACK,aAAA,YAAY,IAAI,KAAK;AAAA,UACxB,GAAG;AAAA,UACH,WAAW;AAAA,QAAA,CACZ;AACO,gBAAA;AACR,aAAK,OAAO;AAAA,UACV,sCAAsC,SAAS,aAAa,cAAc;AAAA,QAC5E;AAAA,MAAA;AAGF,UACE,KAAK,kBAAkB,kBACvB,KAAK,wBAAwB,WAC7B;AACK,aAAA,YAAY,IAAI,KAAK;AAAA,UACxB,GAAG;AAAA,UACH,WAAW;AAAA,QAAA,CACZ;AACO,gBAAA;AACR,aAAK,OAAO;AAAA,UACV,uCAAuC,SAAS,aAAa,cAAc;AAAA,QAC7E;AAAA,MAAA;AAAA,IACF;AAGK,WAAA;AAAA,EAAA;AAEX;"}
1
+ {"version":3,"file":"standards-sdk.es10.js","sources":["../../src/hcs-10/connections-manager.ts"],"sourcesContent":["import { Logger, LoggerOptions } from '../utils/logger';\nimport { HCSMessage, HCS10BaseClient } from './base-client';\nimport { AIAgentProfile } from '../hcs-11';\n\n/**\n * Represents a connection request between agents\n */\nexport interface ConnectionRequest {\n id: number;\n requesterId: string;\n requesterTopicId: string;\n targetAccountId: string;\n targetTopicId: string;\n operatorId: string;\n sequenceNumber: number;\n created: Date;\n memo?: string;\n status: 'pending' | 'confirmed' | 'rejected';\n}\n\n/**\n * Represents an active connection between agents\n */\nexport interface Connection {\n connectionTopicId: string;\n targetAccountId: string;\n targetAgentName?: string;\n targetInboundTopicId?: string;\n targetOutboundTopicId?: string;\n status: 'pending' | 'established' | 'needs_confirmation' | 'closed';\n isPending: boolean;\n needsConfirmation: boolean;\n memo?: string;\n created: Date;\n lastActivity?: Date;\n profileInfo?: AIAgentProfile;\n connectionRequestId?: number;\n confirmedRequestId?: number;\n requesterOutboundTopicId?: string;\n inboundRequestId?: number;\n closedReason?: string;\n closeMethod?: string;\n uniqueRequestKey?: string;\n originTopicId?: string;\n processed: boolean;\n}\n\n/**\n * Options for the connections manager\n */\nexport interface ConnectionsManagerOptions {\n logLevel?: 'debug' | 'info' | 'warn' | 'error';\n filterPendingAccountIds?: string[];\n baseClient: HCS10BaseClient;\n}\n\n/**\n * Defines the interface for a connections manager that handles HCS-10 connections\n * This interface represents the public API of ConnectionsManager\n */\nexport interface IConnectionsManager {\n /**\n * Fetches and processes connection data using the configured client\n * @param accountId - The account ID to fetch connection data for\n * @returns A promise that resolves to an array of Connection objects\n */\n fetchConnectionData(accountId: string): Promise<Connection[]>;\n\n /**\n * Process outbound messages to track connection requests and confirmations\n * @param messages - The messages to process\n * @param accountId - The account ID that sent the messages\n * @returns Array of connections after processing\n */\n processOutboundMessages(\n messages: HCSMessage[],\n accountId: string\n ): Connection[];\n\n /**\n * Process inbound messages to track connection requests and confirmations\n * @param messages - The messages to process\n * @returns Array of connections after processing\n */\n processInboundMessages(messages: HCSMessage[]): Connection[];\n\n /**\n * Process connection topic messages to update last activity time\n * @param connectionTopicId - The topic ID of the connection\n * @param messages - The messages to process\n * @returns The updated connection or undefined if not found\n */\n processConnectionMessages(\n connectionTopicId: string,\n messages: HCSMessage[]\n ): Connection | undefined;\n\n /**\n * Adds or updates profile information for a connection\n * @param accountId - The account ID to add profile info for\n * @param profile - The profile information\n */\n addProfileInfo(accountId: string, profile: AIAgentProfile): void;\n\n /**\n * Gets all connections\n * @returns Array of all connections that should be visible\n */\n getAllConnections(): Connection[];\n\n /**\n * Gets all pending connection requests\n * @returns Array of pending connection requests\n */\n getPendingRequests(): Connection[];\n\n /**\n * Gets all active (established) connections\n * @returns Array of active connections\n */\n getActiveConnections(): Connection[];\n\n /**\n * Gets all connections needing confirmation\n * @returns Array of connections needing confirmation\n */\n getConnectionsNeedingConfirmation(): Connection[];\n\n /**\n * Gets a connection by its topic ID\n * @param connectionTopicId - The topic ID to look up\n * @returns The connection with the given topic ID, or undefined if not found\n */\n getConnectionByTopicId(connectionTopicId: string): Connection | undefined;\n\n /**\n * Gets a connection by account ID\n * @param accountId - The account ID to look up\n * @returns The connection with the given account ID, or undefined if not found\n */\n getConnectionByAccountId(accountId: string): Connection | undefined;\n\n /**\n * Gets all connections for a specific account ID\n * @param accountId - The account ID to look up\n * @returns Array of connections for the given account ID\n */\n getConnectionsByAccountId(accountId: string): Connection[];\n\n /**\n * Updates or adds a connection\n * @param connection - The connection to update or add\n */\n updateOrAddConnection(connection: Connection): void;\n\n /**\n * Clears all tracked connections and requests\n */\n clearAll(): void;\n\n /**\n * Checks if a given connection request has been processed already\n * This uses a combination of topic ID and request ID to uniquely identify requests\n *\n * @param inboundTopicId - The inbound topic ID where the request was received\n * @param requestId - The sequence number (request ID)\n * @returns True if this specific request has been processed, false otherwise\n */\n isConnectionRequestProcessed(\n inboundTopicId: string,\n requestId: number\n ): boolean;\n\n /**\n * Marks a specific connection request as processed\n *\n * @param inboundTopicId - The inbound topic ID where the request was received\n * @param requestId - The sequence number (request ID)\n * @returns True if a matching connection was found and marked, false otherwise\n */\n markConnectionRequestProcessed(\n inboundTopicId: string,\n requestId: number\n ): boolean;\n}\n\n/**\n * ConnectionsManager provides a unified way to track and manage HCS-10 connections\n * across different applications. It works with both frontend and backend implementations.\n */\nexport class ConnectionsManager implements IConnectionsManager {\n private logger: Logger;\n private connections: Map<string, Connection> = new Map();\n private pendingRequests: Map<string, ConnectionRequest> = new Map();\n private profileCache: Map<string, AIAgentProfile> = new Map();\n private filterPendingAccountIds: Set<string> = new Set();\n private baseClient: HCS10BaseClient;\n\n /**\n * Creates a new ConnectionsManager instance\n */\n constructor(options: ConnectionsManagerOptions) {\n const loggerOptions: LoggerOptions = {\n module: 'ConnectionsManager',\n level: options?.logLevel || 'info',\n prettyPrint: true,\n };\n this.logger = new Logger(loggerOptions);\n\n if (options?.filterPendingAccountIds) {\n this.filterPendingAccountIds = new Set(options.filterPendingAccountIds);\n }\n\n if (!options.baseClient) {\n throw new Error('ConnectionsManager requires a baseClient to operate');\n }\n\n this.baseClient = options.baseClient;\n }\n\n /**\n * Fetches and processes connection data using the configured client\n * @param accountId - The account ID to fetch connection data for\n * @returns A promise that resolves to an array of Connection objects\n */\n async fetchConnectionData(accountId: string): Promise<Connection[]> {\n try {\n const topicInfo = await this.baseClient.retrieveCommunicationTopics(\n accountId\n );\n\n const isValidTopicId = (topicId: string): boolean => {\n return Boolean(topicId) && !topicId.includes(':');\n };\n\n if (\n !isValidTopicId(topicInfo.inboundTopic) ||\n !isValidTopicId(topicInfo.outboundTopic)\n ) {\n this.logger.warn(\n 'Invalid topic IDs detected in retrieved communication topics'\n );\n return this.getAllConnections();\n }\n\n const [outboundMessagesResult, inboundMessagesResult] = await Promise.all(\n [\n this.baseClient.getMessages(topicInfo.outboundTopic),\n this.baseClient.getMessages(topicInfo.inboundTopic),\n ]\n );\n\n this.processOutboundMessages(\n outboundMessagesResult.messages || [],\n accountId\n );\n this.processInboundMessages(inboundMessagesResult.messages || []);\n\n const pendingCount = Array.from(this.connections.values()).filter(\n (conn) => conn.status === 'pending' || conn.isPending\n ).length;\n this.logger.debug(\n `Processed ${\n outboundMessagesResult.messages?.length || 0\n } outbound and ${\n inboundMessagesResult.messages?.length || 0\n } inbound messages. Found ${pendingCount} pending connections.`\n );\n\n await this.checkTargetInboundTopicsForConfirmations();\n await this.checkOutboundRequestsForConfirmations();\n await this.fetchProfilesForConnections();\n await this.fetchConnectionActivity();\n\n return this.getAllConnections();\n } catch (error) {\n this.logger.error('Error fetching connection data:', error);\n return this.getAllConnections();\n }\n }\n\n /**\n * Checks target agent inbound topics to find confirmations for pending requests\n * that might not be visible in our local messages\n */\n private async checkTargetInboundTopicsForConfirmations(): Promise<void> {\n const pendingConnections = Array.from(this.connections.values()).filter(\n (conn) =>\n (conn.isPending || conn.status === 'pending') &&\n conn.targetInboundTopicId\n );\n\n if (pendingConnections.length === 0) {\n return;\n }\n\n const pendingRequestsByTarget = new Map<string, Connection[]>();\n\n pendingConnections.forEach((conn) => {\n if (conn.targetInboundTopicId) {\n const requests =\n pendingRequestsByTarget.get(conn.targetInboundTopicId) || [];\n requests.push(conn);\n pendingRequestsByTarget.set(conn.targetInboundTopicId, requests);\n }\n });\n\n const MAX_FETCH_ATTEMPTS = 2;\n const FETCH_DELAY_MS = 500;\n\n for (const [\n targetInboundTopicId,\n requests,\n ] of pendingRequestsByTarget.entries()) {\n for (let attempt = 1; attempt <= MAX_FETCH_ATTEMPTS; attempt++) {\n try {\n const targetMessagesResult = await this.baseClient.getMessages(\n targetInboundTopicId\n );\n const targetMessages = targetMessagesResult.messages || [];\n\n let confirmedAny = false;\n\n for (const conn of requests) {\n const requestId = conn.connectionRequestId;\n if (!requestId) {\n continue;\n }\n\n const confirmationMsg = targetMessages.find((msg) => {\n if (msg.op !== 'connection_created' || !msg.connection_topic_id) {\n return false;\n }\n\n if (msg.connection_id !== requestId) {\n return false;\n }\n\n if (conn.uniqueRequestKey) {\n const keyParts = conn.uniqueRequestKey.split(':');\n if (keyParts.length > 1) {\n const operatorIdPart = keyParts[1];\n\n if (msg.operator_id && msg.operator_id === operatorIdPart) {\n return true;\n }\n\n if (msg.connected_account_id === conn.targetAccountId) {\n return true;\n }\n }\n }\n\n return true;\n });\n\n if (confirmationMsg?.connection_topic_id) {\n confirmedAny = true;\n\n const connectionTopicId = confirmationMsg.connection_topic_id;\n\n let pendingKey = conn.uniqueRequestKey;\n\n const newConnection: Connection = {\n connectionTopicId,\n targetAccountId: conn.targetAccountId,\n targetAgentName: conn.targetAgentName,\n targetInboundTopicId: conn.targetInboundTopicId,\n status: 'established',\n isPending: false,\n needsConfirmation: false,\n created: new Date(confirmationMsg.created || conn.created),\n profileInfo: conn.profileInfo,\n connectionRequestId: requestId,\n uniqueRequestKey: conn.uniqueRequestKey,\n originTopicId: conn.originTopicId,\n processed: conn.processed,\n memo: conn.memo,\n };\n\n this.connections.set(connectionTopicId, newConnection);\n\n if (pendingKey) {\n this.connections.delete(pendingKey);\n }\n\n this.logger.debug(\n `Confirmed connection in target inbound topic: ${connectionTopicId}`\n );\n }\n }\n\n if (confirmedAny || attempt === MAX_FETCH_ATTEMPTS) {\n break;\n }\n\n await new Promise((resolve) => setTimeout(resolve, FETCH_DELAY_MS));\n } catch (error) {\n this.logger.debug(\n `Error fetching target inbound topic ${targetInboundTopicId}:`,\n error\n );\n if (attempt === MAX_FETCH_ATTEMPTS) {\n break;\n }\n await new Promise((resolve) => setTimeout(resolve, FETCH_DELAY_MS));\n }\n }\n }\n }\n\n /**\n * Checks target agents' inbound topics for confirmations of our outbound connection requests\n * This complements checkTargetInboundTopicsForConfirmations by looking for confirmations\n * that might have been sent to the target agent's inbound topic rather than our own\n */\n private async checkOutboundRequestsForConfirmations(): Promise<void> {\n const allConnections = Array.from(this.connections.values());\n this.logger.info(`Total connections in map: ${allConnections.length}`);\n\n const pendingByStatus = allConnections.filter(\n (conn) => conn.status === 'pending'\n );\n this.logger.info(\n `Connections with status='pending': ${pendingByStatus.length}`\n );\n\n const pendingConnections = allConnections.filter(\n (conn) => conn.status === 'pending'\n );\n\n if (!Boolean(pendingConnections?.length)) {\n this.logger.info('No pending connections found');\n return;\n }\n\n for (const conn of pendingConnections) {\n this.logger.debug(\n `Processing pending connection: ${conn.connectionTopicId}`\n );\n\n if (!conn.targetAccountId) {\n this.logger.debug(\n `Skipping connection ${conn.connectionTopicId} - no targetAccountId`\n );\n continue;\n }\n\n let targetInboundTopicId = conn.targetInboundTopicId;\n if (!targetInboundTopicId) {\n try {\n const profileResponse = await this.baseClient.retrieveProfile(\n conn.targetAccountId\n );\n if (profileResponse?.profile?.inboundTopicId) {\n targetInboundTopicId = profileResponse.profile.inboundTopicId;\n this.connections.set(conn.connectionTopicId, {\n ...conn,\n targetInboundTopicId,\n });\n this.logger.debug(\n `Updated connection ${conn.connectionTopicId} with inbound topic ID: ${targetInboundTopicId}`\n );\n } else {\n this.logger.debug(\n `Couldn't get inbound topic ID for account ${conn.targetAccountId}`\n );\n continue;\n }\n } catch (error) {\n this.logger.debug(\n `Error fetching profile for ${conn.targetAccountId}: ${error}`\n );\n continue;\n }\n }\n\n if (!targetInboundTopicId || targetInboundTopicId.includes(':')) {\n this.logger.debug(\n `Skipping invalid inbound topic format: ${targetInboundTopicId}`\n );\n continue;\n }\n\n const requestId = conn.connectionRequestId || conn.inboundRequestId;\n if (!requestId) {\n this.logger.debug(\n `Skipping connection ${conn.connectionTopicId} - no request ID`\n );\n continue;\n }\n\n try {\n this.logger.debug(\n `Checking for confirmations on topic ${targetInboundTopicId} for request ID ${requestId}`\n );\n const targetMessagesResult = await this.baseClient.getMessages(\n targetInboundTopicId\n );\n const targetMessages = targetMessagesResult.messages || [];\n\n const confirmationMsg = targetMessages.find(\n (msg) =>\n msg.op === 'connection_created' &&\n msg.connection_id === requestId &&\n msg.connection_topic_id\n );\n\n if (confirmationMsg?.connection_topic_id) {\n const connectionTopicId = confirmationMsg.connection_topic_id;\n this.logger.info(\n `Found confirmation for request #${requestId} to ${conn.targetAccountId} on their inbound topic`\n );\n\n this.connections.set(conn.connectionTopicId, {\n ...conn,\n connectionTopicId,\n status: 'established',\n isPending: false,\n needsConfirmation: false,\n created: new Date(confirmationMsg.created || conn.created),\n lastActivity: new Date(confirmationMsg.created || conn.created),\n });\n } else {\n this.logger.debug(\n `No confirmation found for request ID ${requestId} on topic ${targetInboundTopicId}`\n );\n }\n } catch (error) {\n this.logger.warn(\n `Error checking for confirmations on target inbound topic for ${conn.targetAccountId}: ${error}`\n );\n }\n }\n }\n\n /**\n * Fetches profiles for all connected accounts\n * @param accountId - The account ID making the request\n */\n private async fetchProfilesForConnections(): Promise<void> {\n const targetAccountIds = new Set<string>();\n\n for (const connection of this.connections.values()) {\n if (\n connection.targetAccountId &&\n !this.profileCache.has(connection.targetAccountId)\n ) {\n targetAccountIds.add(connection.targetAccountId);\n }\n }\n\n const accountIdPromises = Array.from(targetAccountIds).map(\n async (targetId) => {\n try {\n const profileResponse = await this.baseClient.retrieveProfile(\n targetId\n );\n if (profileResponse.success && profileResponse.profile) {\n this.addProfileInfo(targetId, profileResponse.profile);\n\n this.updatePendingConnectionsWithProfileInfo(\n targetId,\n profileResponse.profile\n );\n }\n } catch (error) {\n this.logger.debug(`Failed to fetch profile for ${targetId}:`, error);\n }\n }\n );\n\n await Promise.allSettled(accountIdPromises);\n }\n\n /**\n * Updates pending connections with inbound topic IDs from profile info\n * @param accountId - The account ID to update connections for\n * @param profile - The profile containing the inbound topic ID\n */\n private updatePendingConnectionsWithProfileInfo(\n accountId: string,\n profile: AIAgentProfile\n ): void {\n const pendingConnections = Array.from(this.connections.values()).filter(\n (conn) =>\n conn.targetAccountId === accountId &&\n (conn.isPending || conn.needsConfirmation) &&\n !conn.targetInboundTopicId\n );\n\n if (pendingConnections.length > 0 && profile.inboundTopicId) {\n for (const conn of pendingConnections) {\n const updatedConn = {\n ...conn,\n targetInboundTopicId: profile.inboundTopicId,\n };\n this.connections.set(conn.connectionTopicId, updatedConn);\n }\n }\n }\n\n /**\n * Fetches activity from active connection topics\n * Updates the lastActivity timestamp for each connection based on latest messages\n * @returns Promise that resolves when all activity has been fetched\n */\n private async fetchConnectionActivity(): Promise<void> {\n const activeConnections = this.getActiveConnections();\n\n const validConnections = activeConnections.filter((connection) => {\n const topicId = connection.connectionTopicId;\n\n if (!topicId || topicId.includes(':') || !topicId.match(/^0\\.0\\.\\d+$/)) {\n this.logger.debug(\n `Skipping activity fetch for invalid topic ID format: ${topicId}`\n );\n return false;\n }\n return true;\n });\n\n const activityPromises = validConnections.map(async (connection) => {\n try {\n const topicId = connection.connectionTopicId;\n const messagesResult = await this.baseClient.getMessages(topicId);\n\n if (messagesResult?.messages?.length > 0) {\n this.processConnectionMessages(topicId, messagesResult.messages);\n }\n } catch (error) {\n this.logger.debug(\n `Failed to fetch activity for ${connection.connectionTopicId}:`,\n error\n );\n }\n });\n\n await Promise.allSettled(activityPromises);\n }\n\n /**\n * Checks if an account should be filtered, taking into account existing established connections\n * @param accountId - The account ID to check\n * @returns True if the account should be filtered, false otherwise\n */\n private shouldFilterAccount(accountId: string): boolean {\n if (!this.filterPendingAccountIds.has(accountId)) {\n return false;\n }\n\n if (this.hasEstablishedConnectionWithAccount(accountId)) {\n return false;\n }\n\n return true;\n }\n\n /**\n * Process outbound messages to track connection requests and confirmations\n * @param messages - The messages to process\n * @param accountId - The account ID that sent the messages\n * @returns Array of connections after processing\n */\n processOutboundMessages(\n messages: HCSMessage[],\n accountId: string\n ): Connection[] {\n if (!Boolean(messages?.length)) {\n return Array.from(this.connections.values());\n }\n\n const requestMessages = messages.filter(\n (msg) => msg.op === 'connection_request' && msg.connection_request_id\n );\n\n for (const msg of requestMessages) {\n const requestId = msg.connection_request_id!;\n const operatorId = msg.operator_id || '';\n const targetAccountId =\n this.baseClient.extractAccountFromOperatorId(operatorId);\n const targetInboundTopicId =\n this.baseClient.extractTopicFromOperatorId(operatorId);\n\n if (this.shouldFilterAccount(targetAccountId)) {\n this.logger.debug(\n `Filtering out outbound request to account: ${targetAccountId}`\n );\n continue;\n }\n\n const isAlreadyConfirmed = Array.from(this.connections.values()).some(\n (conn) =>\n conn.connectionRequestId === requestId &&\n !conn.isPending &&\n conn.targetAccountId === targetAccountId\n );\n\n const pendingKey = `req-${requestId}:${operatorId}`;\n\n if (!isAlreadyConfirmed && !this.pendingRequests.has(pendingKey)) {\n const pendingRequest = {\n id: requestId,\n requesterId: accountId,\n requesterTopicId: msg.outbound_topic_id || '',\n targetAccountId,\n targetTopicId: targetInboundTopicId,\n operatorId,\n sequenceNumber: msg.sequence_number,\n created: msg.created || new Date(),\n memo: msg.m,\n status: 'pending' as 'pending' | 'confirmed' | 'rejected',\n };\n\n this.pendingRequests.set(pendingKey, pendingRequest);\n\n if (!this.connections.has(pendingKey)) {\n const pendingConnection = {\n connectionTopicId: pendingKey,\n targetAccountId,\n targetInboundTopicId,\n status: 'pending' as\n | 'pending'\n | 'established'\n | 'needs_confirmation'\n | 'closed',\n isPending: true,\n needsConfirmation: false,\n created: msg.created || new Date(),\n connectionRequestId: requestId,\n uniqueRequestKey: pendingKey,\n originTopicId: msg.outbound_topic_id || '',\n processed: false,\n memo: msg.m,\n };\n\n this.connections.set(pendingKey, pendingConnection);\n }\n }\n }\n\n const confirmationMessages = messages.filter(\n (msg) =>\n msg.op === 'connection_created' &&\n msg.connection_topic_id &&\n msg.connection_request_id\n );\n\n for (const msg of confirmationMessages) {\n const requestId = msg.connection_request_id!;\n const connectionTopicId = msg.connection_topic_id!;\n const targetAccountId = this.baseClient.extractAccountFromOperatorId(\n msg.operator_id || ''\n );\n\n if (this.shouldFilterAccount(targetAccountId)) {\n this.logger.debug(\n `Filtering out outbound confirmation to account: ${targetAccountId}`\n );\n continue;\n }\n\n const pendingKey = `req-${requestId}:${msg.operator_id}`;\n\n const pendingRequest = this.pendingRequests.get(pendingKey);\n if (pendingRequest) {\n pendingRequest.status = 'confirmed';\n }\n\n if (this.connections.has(pendingKey)) {\n this.connections.delete(pendingKey);\n }\n\n if (!this.connections.has(connectionTopicId)) {\n this.connections.set(connectionTopicId, {\n connectionTopicId,\n targetAccountId,\n status: 'established',\n isPending: false,\n needsConfirmation: false,\n created: msg.created || new Date(),\n connectionRequestId: requestId,\n confirmedRequestId: msg.confirmed_request_id,\n requesterOutboundTopicId: msg.outbound_topic_id,\n uniqueRequestKey: pendingKey,\n originTopicId: msg.outbound_topic_id || '',\n processed: false,\n memo: msg.m,\n });\n } else {\n const conn = this.connections.get(connectionTopicId)!;\n this.connections.set(connectionTopicId, {\n ...conn,\n status: 'established',\n isPending: false,\n needsConfirmation: false,\n connectionRequestId: requestId,\n confirmedRequestId: msg.confirmed_request_id,\n requesterOutboundTopicId: msg.outbound_topic_id,\n uniqueRequestKey: pendingKey,\n originTopicId: msg.outbound_topic_id || '',\n processed: false,\n memo: msg.m,\n });\n }\n }\n\n const closedMessages = messages.filter(\n (msg) =>\n (msg.op as string) === 'connection_closed' ||\n (msg.op === 'close_connection' && msg.connection_topic_id)\n );\n\n for (const msg of closedMessages) {\n const connectionTopicId = msg.connection_topic_id!;\n\n if (this.connections.has(connectionTopicId)) {\n const conn = this.connections.get(connectionTopicId)!;\n if (\n this.shouldFilterAccount(conn.targetAccountId) &&\n conn.status !== 'established'\n ) {\n continue;\n }\n\n const uniqueKey =\n msg.connection_request_id && msg.operator_id\n ? `req-${msg.connection_request_id}:${msg.operator_id}`\n : undefined;\n\n this.connections.set(connectionTopicId, {\n ...conn,\n status: 'closed',\n isPending: false,\n needsConfirmation: false,\n lastActivity: msg.created || new Date(),\n closedReason: msg.reason,\n closeMethod: msg.close_method,\n uniqueRequestKey: uniqueKey,\n originTopicId: conn.originTopicId,\n processed: false,\n memo: msg.m,\n });\n }\n }\n\n return Array.from(this.connections.values()).filter(\n (conn) =>\n conn.status === 'established' ||\n conn.status === 'closed' ||\n !this.filterPendingAccountIds.has(conn.targetAccountId)\n );\n }\n\n /**\n * Process inbound messages to track connection requests and confirmations\n * @param messages - The messages to process\n * @returns Array of connections after processing\n */\n processInboundMessages(messages: HCSMessage[]): Connection[] {\n if (!Boolean(messages?.length)) {\n return Array.from(this.connections.values());\n }\n\n const requestMessages = messages.filter(\n (msg) => msg.op === 'connection_request' && msg.sequence_number\n );\n\n for (const msg of requestMessages) {\n const sequenceNumber = msg.sequence_number;\n const operatorId = msg.operator_id || '';\n const requestorAccountId =\n this.baseClient.extractAccountFromOperatorId(operatorId);\n const requestorTopicId =\n this.baseClient.extractTopicFromOperatorId(operatorId);\n\n if (this.shouldFilterAccount(requestorAccountId)) {\n this.logger.debug(\n `Filtering out request from account: ${requestorAccountId}`\n );\n continue;\n }\n\n const needsConfirmKey = `inb-${sequenceNumber}:${operatorId}`;\n\n if (!this.connections.has(needsConfirmKey)) {\n this.connections.set(needsConfirmKey, {\n connectionTopicId: needsConfirmKey,\n targetAccountId: requestorAccountId,\n targetInboundTopicId: requestorTopicId,\n status: 'needs_confirmation',\n isPending: false,\n needsConfirmation: true,\n created: msg.created || new Date(),\n inboundRequestId: sequenceNumber,\n uniqueRequestKey: needsConfirmKey,\n originTopicId: requestorTopicId,\n processed: false,\n memo: msg.m,\n });\n }\n }\n\n const confirmationMessages = messages.filter(\n (msg) =>\n msg.op === 'connection_created' &&\n msg.connection_topic_id &&\n msg.connection_id\n );\n\n for (const msg of confirmationMessages) {\n const sequenceNumber = msg.connection_id!;\n const connectionTopicId = msg.connection_topic_id!;\n const connectedAccountId = msg.connected_account_id || '';\n const operatorId = msg.operator_id || '';\n\n if (this.shouldFilterAccount(connectedAccountId)) {\n this.logger.debug(\n `Filtering out confirmation for account: ${connectedAccountId}`\n );\n continue;\n }\n\n const needsConfirmKey = `inb-${sequenceNumber}:${operatorId}`;\n\n if (this.connections.has(needsConfirmKey)) {\n this.connections.delete(needsConfirmKey);\n }\n\n if (!this.connections.has(connectionTopicId)) {\n this.connections.set(connectionTopicId, {\n connectionTopicId,\n targetAccountId: connectedAccountId,\n status: 'established',\n isPending: false,\n needsConfirmation: false,\n created: msg.created || new Date(),\n inboundRequestId: sequenceNumber,\n uniqueRequestKey: needsConfirmKey,\n originTopicId: msg.connection_topic_id,\n processed: false,\n memo: msg.m,\n });\n } else {\n const conn = this.connections.get(connectionTopicId)!;\n this.connections.set(connectionTopicId, {\n ...conn,\n status: 'established',\n isPending: false,\n needsConfirmation: false,\n inboundRequestId: sequenceNumber,\n uniqueRequestKey: needsConfirmKey,\n originTopicId: msg.connection_topic_id,\n processed: false,\n memo: msg.m,\n });\n }\n }\n\n return Array.from(this.connections.values()).filter(\n (conn) =>\n conn.status === 'established' ||\n conn.status === 'closed' ||\n !this.filterPendingAccountIds.has(conn.targetAccountId)\n );\n }\n\n /**\n * Process connection topic messages to update last activity time\n * @param connectionTopicId - The topic ID of the connection\n * @param messages - The messages to process\n * @returns The updated connection or undefined if not found\n */\n processConnectionMessages(\n connectionTopicId: string,\n messages: HCSMessage[]\n ): Connection | undefined {\n if (\n !messages ||\n messages.length === 0 ||\n !this.connections.has(connectionTopicId)\n ) {\n return this.connections.get(connectionTopicId);\n }\n\n const latestMessage = messages\n .filter((m) => m.created)\n .sort((a, b) => {\n const dateA = a.created ? new Date(a.created).getTime() : 0;\n const dateB = b.created ? new Date(b.created).getTime() : 0;\n return dateB - dateA;\n })[0];\n\n if (latestMessage?.created) {\n const conn = this.connections.get(connectionTopicId)!;\n this.connections.set(connectionTopicId, {\n ...conn,\n lastActivity: latestMessage.created,\n });\n }\n\n const closeMessage = messages.find((msg) => msg.op === 'close_connection');\n if (closeMessage) {\n const conn = this.connections.get(connectionTopicId)!;\n this.connections.set(connectionTopicId, {\n ...conn,\n status: 'closed',\n lastActivity: closeMessage.created || new Date(),\n closedReason: closeMessage.reason,\n closeMethod: 'explicit',\n });\n }\n\n return this.connections.get(connectionTopicId);\n }\n\n /**\n * Adds or updates profile information for a connection\n * @param accountId - The account ID to add profile info for\n * @param profile - The profile information\n */\n addProfileInfo(accountId: string, profile: AIAgentProfile): void {\n this.profileCache.set(accountId, profile);\n\n const matchingConnections = Array.from(this.connections.values()).filter(\n (conn) => conn.targetAccountId === accountId\n );\n\n for (const conn of matchingConnections) {\n this.connections.set(conn.connectionTopicId, {\n ...conn,\n profileInfo: profile,\n targetAgentName: profile.display_name,\n targetInboundTopicId: profile.inboundTopicId,\n targetOutboundTopicId: profile.outboundTopicId,\n });\n }\n }\n\n /**\n * Gets all connections\n * @returns Array of all connections that should be visible\n */\n getAllConnections(): Connection[] {\n const connections = Array.from(this.connections.values()).filter(\n (conn) =>\n conn.status === 'established' ||\n conn.status === 'closed' ||\n !this.filterPendingAccountIds.has(conn.targetAccountId) ||\n this.hasEstablishedConnectionWithAccount(conn.targetAccountId)\n );\n return connections;\n }\n\n /**\n * Gets all pending connection requests\n * @returns Array of pending connection requests\n */\n getPendingRequests(): Connection[] {\n const pendingConnections = Array.from(this.connections.values()).filter(\n (conn) => {\n return (\n conn.isPending &&\n (!this.filterPendingAccountIds.has(conn.targetAccountId))\n );\n }\n );\n\n return pendingConnections;\n }\n\n /**\n * Helper method to check if there's an established connection with an account\n * @param accountId - The account ID to check\n * @returns True if there's an established connection, false otherwise\n */\n private hasEstablishedConnectionWithAccount(accountId: string): boolean {\n return Array.from(this.connections.values()).some(\n (conn) =>\n conn.targetAccountId === accountId && conn.status === 'established'\n );\n }\n\n /**\n * Gets all active (established) connections\n * @returns Array of active connections\n */\n getActiveConnections(): Connection[] {\n return Array.from(this.connections.values()).filter(\n (conn) => conn.status === 'established'\n );\n }\n\n /**\n * Gets all connections needing confirmation\n * @returns Array of connections needing confirmation\n */\n getConnectionsNeedingConfirmation(): Connection[] {\n return Array.from(this.connections.values()).filter(\n (conn) =>\n conn.needsConfirmation &&\n (!this.filterPendingAccountIds.has(conn.targetAccountId))\n );\n }\n\n /**\n * Gets a connection by its topic ID\n * @param connectionTopicId - The topic ID to look up\n * @returns The connection with the given topic ID, or undefined if not found\n */\n getConnectionByTopicId(connectionTopicId: string): Connection | undefined {\n return this.connections.get(connectionTopicId);\n }\n\n /**\n * Gets a connection by account ID\n * @param accountId - The account ID to look up\n * @returns The connection with the given account ID, or undefined if not found\n */\n getConnectionByAccountId(accountId: string): Connection | undefined {\n return Array.from(this.connections.values()).find(\n (conn) =>\n conn.targetAccountId === accountId && conn.status === 'established'\n );\n }\n\n /**\n * Gets all connections for a specific account ID\n * @param accountId - The account ID to look up\n * @returns Array of connections for the given account ID\n */\n getConnectionsByAccountId(accountId: string): Connection[] {\n return Array.from(this.connections.values()).filter(\n (conn) => conn.targetAccountId === accountId\n );\n }\n\n /**\n * Updates or adds a connection\n * @param connection - The connection to update or add\n */\n updateOrAddConnection(connection: Connection): void {\n this.connections.set(connection.connectionTopicId, connection);\n }\n\n /**\n * Clears all tracked connections and requests\n */\n clearAll(): void {\n this.connections.clear();\n this.pendingRequests.clear();\n }\n\n /**\n * Checks if a given connection request has been processed already\n * This uses a combination of topic ID and request ID to uniquely identify requests\n *\n * @param inboundTopicId - The inbound topic ID where the request was received\n * @param requestId - The sequence number (request ID)\n * @returns True if this specific request has been processed, false otherwise\n */\n isConnectionRequestProcessed(\n inboundTopicId: string,\n requestId: number\n ): boolean {\n for (const conn of this.connections.values()) {\n if (\n conn.originTopicId === inboundTopicId &&\n conn.inboundRequestId === requestId &&\n conn.processed\n ) {\n return true;\n }\n\n if (\n conn.originTopicId === inboundTopicId &&\n conn.connectionRequestId === requestId &&\n conn.processed\n ) {\n return true;\n }\n }\n\n return false;\n }\n\n /**\n * Marks a specific connection request as processed\n *\n * @param inboundTopicId - The inbound topic ID where the request was received\n * @param requestId - The sequence number (request ID)\n * @returns True if a matching connection was found and marked, false otherwise\n */\n markConnectionRequestProcessed(\n inboundTopicId: string,\n requestId: number\n ): boolean {\n let found = false;\n\n for (const [key, conn] of this.connections.entries()) {\n if (\n conn.originTopicId === inboundTopicId &&\n conn.inboundRequestId === requestId\n ) {\n this.connections.set(key, {\n ...conn,\n processed: true,\n });\n found = true;\n this.logger.debug(\n `Marked inbound connection request #${requestId} on topic ${inboundTopicId} as processed`\n );\n }\n\n if (\n conn.originTopicId === inboundTopicId &&\n conn.connectionRequestId === requestId\n ) {\n this.connections.set(key, {\n ...conn,\n processed: true,\n });\n found = true;\n this.logger.debug(\n `Marked outbound connection request #${requestId} on topic ${inboundTopicId} as processed`\n );\n }\n }\n\n return found;\n }\n}\n"],"names":[],"mappings":";AA8LO,MAAM,mBAAkD;AAAA;AAAA;AAAA;AAAA,EAW7D,YAAY,SAAoC;AATxC,SAAA,kCAA2C,IAAI;AAC/C,SAAA,sCAAsD,IAAI;AAC1D,SAAA,mCAAgD,IAAI;AACpD,SAAA,8CAA2C,IAAI;AAOrD,UAAM,gBAA+B;AAAA,MACnC,QAAQ;AAAA,MACR,OAAO,SAAS,YAAY;AAAA,MAC5B,aAAa;AAAA,IACf;AACK,SAAA,SAAS,IAAI,OAAO,aAAa;AAEtC,QAAI,SAAS,yBAAyB;AACpC,WAAK,0BAA0B,IAAI,IAAI,QAAQ,uBAAuB;AAAA,IAAA;AAGpE,QAAA,CAAC,QAAQ,YAAY;AACjB,YAAA,IAAI,MAAM,qDAAqD;AAAA,IAAA;AAGvE,SAAK,aAAa,QAAQ;AAAA,EAAA;AAAA;AAAA;AAAA;A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AClD,SAAK,YAAY,IAAI,WAAW,mBAAmB,UAAU;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA,EAM/D,WAAiB;AACf,SAAK,YAAY,MAAM;AACvB,SAAK,gBAAgB,MAAM;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAW7B,6BACE,gBACA,WACS;AACT,eAAW,QAAQ,KAAK,YAAY,OAAA,GAAU;AAC5C,UACE,KAAK,kBAAkB,kBACvB,KAAK,qBAAqB,aAC1B,KAAK,WACL;AACO,eAAA;AAAA,MAAA;AAGT,UACE,KAAK,kBAAkB,kBACvB,KAAK,wBAAwB,aAC7B,KAAK,WACL;AACO,eAAA;AAAA,MAAA;AAAA,IACT;AAGK,WAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUT,+BACE,gBACA,WACS;AACT,QAAI,QAAQ;AAEZ,eAAW,CAAC,KAAK,IAAI,KAAK,KAAK,YAAY,WAAW;AACpD,UACE,KAAK,kBAAkB,kBACvB,KAAK,qBAAqB,WAC1B;AACK,aAAA,YAAY,IAAI,KAAK;AAAA,UACxB,GAAG;AAAA,UACH,WAAW;AAAA,QAAA,CACZ;AACO,gBAAA;AACR,aAAK,OAAO;AAAA,UACV,sCAAsC,SAAS,aAAa,cAAc;AAAA,QAC5E;AAAA,MAAA;AAGF,UACE,KAAK,kBAAkB,kBACvB,KAAK,wBAAwB,WAC7B;AACK,aAAA,YAAY,IAAI,KAAK;AAAA,UACxB,GAAG;AAAA,UACH,WAAW;AAAA,QAAA,CACZ;AACO,gBAAA;AACR,aAAK,OAAO;AAAA,UACV,uCAAuC,SAAS,aAAa,cAAc;AAAA,QAC7E;AAAA,MAAA;AAAA,IACF;AAGK,WAAA;AAAA,EAAA;AAEX;"}
@@ -1,7 +1,19 @@
1
- function getDefaultExportFromCjs(x) {
2
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
1
+ import AxiosError from "./standards-sdk.es49.js";
2
+ function settle(resolve, reject, response) {
3
+ const validateStatus = response.config.validateStatus;
4
+ if (!response.status || !validateStatus || validateStatus(response.status)) {
5
+ resolve(response);
6
+ } else {
7
+ reject(new AxiosError(
8
+ "Request failed with status code " + response.status,
9
+ [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
10
+ response.config,
11
+ response.request,
12
+ response
13
+ ));
14
+ }
3
15
  }
4
16
  export {
5
- getDefaultExportFromCjs
17
+ settle as default
6
18
  };
7
19
  //# sourceMappingURL=standards-sdk.es104.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"standards-sdk.es104.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
1
+ {"version":3,"file":"standards-sdk.es104.js","sources":["../../node_modules/axios/lib/core/settle.js"],"sourcesContent":["'use strict';\n\nimport AxiosError from './AxiosError.js';\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nexport default function settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n}\n"],"names":[],"mappings":";AAae,SAAS,OAAO,SAAS,QAAQ,UAAU;AACxD,QAAM,iBAAiB,SAAS,OAAO;AACvC,MAAI,CAAC,SAAS,UAAU,CAAC,kBAAkB,eAAe,SAAS,MAAM,GAAG;AAC1E,YAAQ,QAAQ;AAAA,EACpB,OAAS;AACL,WAAO,IAAI;AAAA,MACT,qCAAqC,SAAS;AAAA,MAC9C,CAAC,WAAW,iBAAiB,WAAW,gBAAgB,EAAE,KAAK,MAAM,SAAS,SAAS,GAAG,IAAI,CAAC;AAAA,MAC/F,SAAS;AAAA,MACT,SAAS;AAAA,MACT;AAAA,IACN,CAAK;AAAA,EACL;AACA;","x_google_ignoreList":[0]}
@@ -1,19 +1,8 @@
1
- import AxiosError from "./standards-sdk.es49.js";
2
- function settle(resolve, reject, response) {
3
- const validateStatus = response.config.validateStatus;
4
- if (!response.status || !validateStatus || validateStatus(response.status)) {
5
- resolve(response);
6
- } else {
7
- reject(new AxiosError(
8
- "Request failed with status code " + response.status,
9
- [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
10
- response.config,
11
- response.request,
12
- response
13
- ));
14
- }
1
+ function parseProtocol(url) {
2
+ const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
3
+ return match && match[1] || "";
15
4
  }
16
5
  export {
17
- settle as default
6
+ parseProtocol as default
18
7
  };
19
8
  //# sourceMappingURL=standards-sdk.es105.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"standards-sdk.es105.js","sources":["../../node_modules/axios/lib/core/settle.js"],"sourcesContent":["'use strict';\n\nimport AxiosError from './AxiosError.js';\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nexport default function settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n}\n"],"names":[],"mappings":";AAae,SAAS,OAAO,SAAS,QAAQ,UAAU;AACxD,QAAM,iBAAiB,SAAS,OAAO;AACvC,MAAI,CAAC,SAAS,UAAU,CAAC,kBAAkB,eAAe,SAAS,MAAM,GAAG;AAC1E,YAAQ,QAAQ;AAAA,EACpB,OAAS;AACL,WAAO,IAAI;AAAA,MACT,qCAAqC,SAAS;AAAA,MAC9C,CAAC,WAAW,iBAAiB,WAAW,gBAAgB,EAAE,KAAK,MAAM,SAAS,SAAS,GAAG,IAAI,CAAC;AAAA,MAC/F,SAAS;AAAA,MACT,SAAS;AAAA,MACT;AAAA,IACN,CAAK;AAAA,EACL;AACA;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"standards-sdk.es105.js","sources":["../../node_modules/axios/lib/helpers/parseProtocol.js"],"sourcesContent":["'use strict';\n\nexport default function parseProtocol(url) {\n const match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n}\n"],"names":[],"mappings":"AAEe,SAAS,cAAc,KAAK;AACzC,QAAM,QAAQ,4BAA4B,KAAK,GAAG;AAClD,SAAO,SAAS,MAAM,CAAC,KAAK;AAC9B;","x_google_ignoreList":[0]}
@@ -1,8 +1,42 @@
1
- function parseProtocol(url) {
2
- const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
3
- return match && match[1] || "";
4
- }
1
+ import speedometer from "./standards-sdk.es111.js";
2
+ import throttle from "./standards-sdk.es112.js";
3
+ import utils from "./standards-sdk.es38.js";
4
+ const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
5
+ let bytesNotified = 0;
6
+ const _speedometer = speedometer(50, 250);
7
+ return throttle((e) => {
8
+ const loaded = e.loaded;
9
+ const total = e.lengthComputable ? e.total : void 0;
10
+ const progressBytes = loaded - bytesNotified;
11
+ const rate = _speedometer(progressBytes);
12
+ const inRange = loaded <= total;
13
+ bytesNotified = loaded;
14
+ const data = {
15
+ loaded,
16
+ total,
17
+ progress: total ? loaded / total : void 0,
18
+ bytes: progressBytes,
19
+ rate: rate ? rate : void 0,
20
+ estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
21
+ event: e,
22
+ lengthComputable: total != null,
23
+ [isDownloadStream ? "download" : "upload"]: true
24
+ };
25
+ listener(data);
26
+ }, freq);
27
+ };
28
+ const progressEventDecorator = (total, throttled) => {
29
+ const lengthComputable = total != null;
30
+ return [(loaded) => throttled[0]({
31
+ lengthComputable,
32
+ total,
33
+ loaded
34
+ }), throttled[1]];
35
+ };
36
+ const asyncDecorator = (fn) => (...args) => utils.asap(() => fn(...args));
5
37
  export {
6
- parseProtocol as default
38
+ asyncDecorator,
39
+ progressEventDecorator,
40
+ progressEventReducer
7
41
  };
8
42
  //# sourceMappingURL=standards-sdk.es106.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"standards-sdk.es106.js","sources":["../../node_modules/axios/lib/helpers/parseProtocol.js"],"sourcesContent":["'use strict';\n\nexport default function parseProtocol(url) {\n const match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n}\n"],"names":[],"mappings":"AAEe,SAAS,cAAc,KAAK;AACzC,QAAM,QAAQ,4BAA4B,KAAK,GAAG;AAClD,SAAO,SAAS,MAAM,CAAC,KAAK;AAC9B;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"standards-sdk.es106.js","sources":["../../node_modules/axios/lib/helpers/progressEventReducer.js"],"sourcesContent":["import speedometer from \"./speedometer.js\";\nimport throttle from \"./throttle.js\";\nimport utils from \"../utils.js\";\n\nexport const progressEventReducer = (listener, isDownloadStream, freq = 3) => {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return throttle(e => {\n const loaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const progressBytes = loaded - bytesNotified;\n const rate = _speedometer(progressBytes);\n const inRange = loaded <= total;\n\n bytesNotified = loaded;\n\n const data = {\n loaded,\n total,\n progress: total ? (loaded / total) : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total && inRange ? (total - loaded) / rate : undefined,\n event: e,\n lengthComputable: total != null,\n [isDownloadStream ? 'download' : 'upload']: true\n };\n\n listener(data);\n }, freq);\n}\n\nexport const progressEventDecorator = (total, throttled) => {\n const lengthComputable = total != null;\n\n return [(loaded) => throttled[0]({\n lengthComputable,\n total,\n loaded\n }), throttled[1]];\n}\n\nexport const asyncDecorator = (fn) => (...args) => utils.asap(() => fn(...args));\n"],"names":[],"mappings":";;;AAIY,MAAC,uBAAuB,CAAC,UAAU,kBAAkB,OAAO,MAAM;AAC5E,MAAI,gBAAgB;AACpB,QAAM,eAAe,YAAY,IAAI,GAAG;AAExC,SAAO,SAAS,OAAK;AACnB,UAAM,SAAS,EAAE;AACjB,UAAM,QAAQ,EAAE,mBAAmB,EAAE,QAAQ;AAC7C,UAAM,gBAAgB,SAAS;AAC/B,UAAM,OAAO,aAAa,aAAa;AACvC,UAAM,UAAU,UAAU;AAE1B,oBAAgB;AAEhB,UAAM,OAAO;AAAA,MACX;AAAA,MACA;AAAA,MACA,UAAU,QAAS,SAAS,QAAS;AAAA,MACrC,OAAO;AAAA,MACP,MAAM,OAAO,OAAO;AAAA,MACpB,WAAW,QAAQ,SAAS,WAAW,QAAQ,UAAU,OAAO;AAAA,MAChE,OAAO;AAAA,MACP,kBAAkB,SAAS;AAAA,MAC3B,CAAC,mBAAmB,aAAa,QAAQ,GAAG;AAAA,IAC7C;AAED,aAAS,IAAI;AAAA,EACd,GAAE,IAAI;AACT;AAEY,MAAC,yBAAyB,CAAC,OAAO,cAAc;AAC1D,QAAM,mBAAmB,SAAS;AAElC,SAAO,CAAC,CAAC,WAAW,UAAU,CAAC,EAAE;AAAA,IAC/B;AAAA,IACA;AAAA,IACA;AAAA,EACJ,CAAG,GAAG,UAAU,CAAC,CAAC;AAClB;AAEY,MAAC,iBAAiB,CAAC,OAAO,IAAI,SAAS,MAAM,KAAK,MAAM,GAAG,GAAG,IAAI,CAAC;","x_google_ignoreList":[0]}
@@ -1,42 +1,43 @@
1
- import speedometer from "./standards-sdk.es114.js";
2
- import throttle from "./standards-sdk.es115.js";
1
+ import platform from "./standards-sdk.es86.js";
3
2
  import utils from "./standards-sdk.es38.js";
4
- const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
5
- let bytesNotified = 0;
6
- const _speedometer = speedometer(50, 250);
7
- return throttle((e) => {
8
- const loaded = e.loaded;
9
- const total = e.lengthComputable ? e.total : void 0;
10
- const progressBytes = loaded - bytesNotified;
11
- const rate = _speedometer(progressBytes);
12
- const inRange = loaded <= total;
13
- bytesNotified = loaded;
14
- const data = {
15
- loaded,
16
- total,
17
- progress: total ? loaded / total : void 0,
18
- bytes: progressBytes,
19
- rate: rate ? rate : void 0,
20
- estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
21
- event: e,
22
- lengthComputable: total != null,
23
- [isDownloadStream ? "download" : "upload"]: true
24
- };
25
- listener(data);
26
- }, freq);
3
+ import isURLSameOrigin from "./standards-sdk.es113.js";
4
+ import cookies from "./standards-sdk.es114.js";
5
+ import buildFullPath from "./standards-sdk.es82.js";
6
+ import mergeConfig from "./standards-sdk.es41.js";
7
+ import AxiosHeaders from "./standards-sdk.es52.js";
8
+ import buildURL from "./standards-sdk.es79.js";
9
+ const resolveConfig = (config) => {
10
+ const newConfig = mergeConfig({}, config);
11
+ let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
12
+ newConfig.headers = headers = AxiosHeaders.from(headers);
13
+ newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
14
+ if (auth) {
15
+ headers.set(
16
+ "Authorization",
17
+ "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : ""))
18
+ );
19
+ }
20
+ let contentType;
21
+ if (utils.isFormData(data)) {
22
+ if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
23
+ headers.setContentType(void 0);
24
+ } else if ((contentType = headers.getContentType()) !== false) {
25
+ const [type, ...tokens] = contentType ? contentType.split(";").map((token) => token.trim()).filter(Boolean) : [];
26
+ headers.setContentType([type || "multipart/form-data", ...tokens].join("; "));
27
+ }
28
+ }
29
+ if (platform.hasStandardBrowserEnv) {
30
+ withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
31
+ if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(newConfig.url)) {
32
+ const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
33
+ if (xsrfValue) {
34
+ headers.set(xsrfHeaderName, xsrfValue);
35
+ }
36
+ }
37
+ }
38
+ return newConfig;
27
39
  };
28
- const progressEventDecorator = (total, throttled) => {
29
- const lengthComputable = total != null;
30
- return [(loaded) => throttled[0]({
31
- lengthComputable,
32
- total,
33
- loaded
34
- }), throttled[1]];
35
- };
36
- const asyncDecorator = (fn) => (...args) => utils.asap(() => fn(...args));
37
40
  export {
38
- asyncDecorator,
39
- progressEventDecorator,
40
- progressEventReducer
41
+ resolveConfig as default
41
42
  };
42
43
  //# sourceMappingURL=standards-sdk.es107.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"standards-sdk.es107.js","sources":["../../node_modules/axios/lib/helpers/progressEventReducer.js"],"sourcesContent":["import speedometer from \"./speedometer.js\";\nimport throttle from \"./throttle.js\";\nimport utils from \"../utils.js\";\n\nexport const progressEventReducer = (listener, isDownloadStream, freq = 3) => {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return throttle(e => {\n const loaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const progressBytes = loaded - bytesNotified;\n const rate = _speedometer(progressBytes);\n const inRange = loaded <= total;\n\n bytesNotified = loaded;\n\n const data = {\n loaded,\n total,\n progress: total ? (loaded / total) : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total && inRange ? (total - loaded) / rate : undefined,\n event: e,\n lengthComputable: total != null,\n [isDownloadStream ? 'download' : 'upload']: true\n };\n\n listener(data);\n }, freq);\n}\n\nexport const progressEventDecorator = (total, throttled) => {\n const lengthComputable = total != null;\n\n return [(loaded) => throttled[0]({\n lengthComputable,\n total,\n loaded\n }), throttled[1]];\n}\n\nexport const asyncDecorator = (fn) => (...args) => utils.asap(() => fn(...args));\n"],"names":[],"mappings":";;;AAIY,MAAC,uBAAuB,CAAC,UAAU,kBAAkB,OAAO,MAAM;AAC5E,MAAI,gBAAgB;AACpB,QAAM,eAAe,YAAY,IAAI,GAAG;AAExC,SAAO,SAAS,OAAK;AACnB,UAAM,SAAS,EAAE;AACjB,UAAM,QAAQ,EAAE,mBAAmB,EAAE,QAAQ;AAC7C,UAAM,gBAAgB,SAAS;AAC/B,UAAM,OAAO,aAAa,aAAa;AACvC,UAAM,UAAU,UAAU;AAE1B,oBAAgB;AAEhB,UAAM,OAAO;AAAA,MACX;AAAA,MACA;AAAA,MACA,UAAU,QAAS,SAAS,QAAS;AAAA,MACrC,OAAO;AAAA,MACP,MAAM,OAAO,OAAO;AAAA,MACpB,WAAW,QAAQ,SAAS,WAAW,QAAQ,UAAU,OAAO;AAAA,MAChE,OAAO;AAAA,MACP,kBAAkB,SAAS;AAAA,MAC3B,CAAC,mBAAmB,aAAa,QAAQ,GAAG;AAAA,IAC7C;AAED,aAAS,IAAI;AAAA,EACd,GAAE,IAAI;AACT;AAEY,MAAC,yBAAyB,CAAC,OAAO,cAAc;AAC1D,QAAM,mBAAmB,SAAS;AAElC,SAAO,CAAC,CAAC,WAAW,UAAU,CAAC,EAAE;AAAA,IAC/B;AAAA,IACA;AAAA,IACA;AAAA,EACJ,CAAG,GAAG,UAAU,CAAC,CAAC;AAClB;AAEY,MAAC,iBAAiB,CAAC,OAAO,IAAI,SAAS,MAAM,KAAK,MAAM,GAAG,GAAG,IAAI,CAAC;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"standards-sdk.es107.js","sources":["../../node_modules/axios/lib/helpers/resolveConfig.js"],"sourcesContent":["import platform from \"../platform/index.js\";\nimport utils from \"../utils.js\";\nimport isURLSameOrigin from \"./isURLSameOrigin.js\";\nimport cookies from \"./cookies.js\";\nimport buildFullPath from \"../core/buildFullPath.js\";\nimport mergeConfig from \"../core/mergeConfig.js\";\nimport AxiosHeaders from \"../core/AxiosHeaders.js\";\nimport buildURL from \"./buildURL.js\";\n\nexport default (config) => {\n const newConfig = mergeConfig({}, config);\n\n let {data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth} = newConfig;\n\n newConfig.headers = headers = AxiosHeaders.from(headers);\n\n newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);\n\n // HTTP basic authentication\n if (auth) {\n headers.set('Authorization', 'Basic ' +\n btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))\n );\n }\n\n let contentType;\n\n if (utils.isFormData(data)) {\n if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {\n headers.setContentType(undefined); // Let the browser set it\n } else if ((contentType = headers.getContentType()) !== false) {\n // fix semicolon duplication issue for ReactNative FormData implementation\n const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];\n headers.setContentType([type || 'multipart/form-data', ...tokens].join('; '));\n }\n }\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n\n if (platform.hasStandardBrowserEnv) {\n withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));\n\n if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) {\n // Add xsrf header\n const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);\n\n if (xsrfValue) {\n headers.set(xsrfHeaderName, xsrfValue);\n }\n }\n }\n\n return newConfig;\n}\n\n"],"names":[],"mappings":";;;;;;;;AASA,MAAe,gBAAA,CAAC,WAAW;AACzB,QAAM,YAAY,YAAY,CAAE,GAAE,MAAM;AAExC,MAAI,EAAC,MAAM,eAAe,gBAAgB,gBAAgB,SAAS,KAAI,IAAI;AAE3E,YAA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