holosphere 2.0.0-alpha1 → 2.0.0-alpha10

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 (418) hide show
  1. package/CHANGELOG.md +473 -0
  2. package/FEATURES.md +431 -0
  3. package/LICENSE +29 -166
  4. package/LICENSE-AGPL.md +180 -0
  5. package/README.md +97 -16
  6. package/dist/2019-D2OG2idw.js +6680 -0
  7. package/dist/2019-D2OG2idw.js.map +1 -0
  8. package/dist/2019-EION3wKo.cjs +8 -0
  9. package/dist/2019-EION3wKo.cjs.map +1 -0
  10. package/dist/_commonjsHelpers-C37NGDzP.cjs +2 -0
  11. package/dist/_commonjsHelpers-C37NGDzP.cjs.map +1 -0
  12. package/dist/_commonjsHelpers-CUmg6egw.js +7 -0
  13. package/dist/_commonjsHelpers-CUmg6egw.js.map +1 -0
  14. package/dist/browser-BSniCNqO.js +3058 -0
  15. package/dist/browser-BSniCNqO.js.map +1 -0
  16. package/dist/browser-Cq59Ij19.cjs +2 -0
  17. package/dist/browser-Cq59Ij19.cjs.map +1 -0
  18. package/dist/cdn/holosphere.min.js +55 -0
  19. package/dist/cdn/holosphere.min.js.map +1 -0
  20. package/dist/cjs/holosphere.cjs +2 -0
  21. package/dist/cjs/holosphere.cjs.map +1 -0
  22. package/dist/esm/holosphere.js +53 -0
  23. package/dist/esm/holosphere.js.map +1 -0
  24. package/dist/index-DDGt_V9o.cjs +12 -0
  25. package/dist/index-DDGt_V9o.cjs.map +1 -0
  26. package/dist/index-DJXftyvB.js +39841 -0
  27. package/dist/index-DJXftyvB.js.map +1 -0
  28. package/dist/index-DMbdcMtK.cjs +18 -0
  29. package/dist/index-DMbdcMtK.cjs.map +1 -0
  30. package/dist/index-DeZ1xz_s.js +15104 -0
  31. package/dist/index-DeZ1xz_s.js.map +1 -0
  32. package/dist/indexeddb-storage-BFt6hMeF.js +176 -0
  33. package/dist/indexeddb-storage-BFt6hMeF.js.map +1 -0
  34. package/dist/indexeddb-storage-BK5tv4Sh.cjs +2 -0
  35. package/dist/indexeddb-storage-BK5tv4Sh.cjs.map +1 -0
  36. package/dist/memory-storage-C9HuoL2E.js +91 -0
  37. package/dist/memory-storage-C9HuoL2E.js.map +1 -0
  38. package/dist/memory-storage-Dao7jfYG.cjs +2 -0
  39. package/dist/memory-storage-Dao7jfYG.cjs.map +1 -0
  40. package/dist/secp256k1-BbKzbLtD.cjs +12 -0
  41. package/dist/secp256k1-BbKzbLtD.cjs.map +1 -0
  42. package/dist/secp256k1-CreY7Pcl.js +1890 -0
  43. package/dist/secp256k1-CreY7Pcl.js.map +1 -0
  44. package/docs/CONTRACTS.md +797 -0
  45. package/docs/FOSDEM_PROPOSAL.md +388 -0
  46. package/docs/LOCALFIRST.md +266 -0
  47. package/docs/api/ai_aggregation.js.html +333 -0
  48. package/docs/api/ai_breakdown.js.html +524 -0
  49. package/docs/api/ai_classifier.js.html +231 -0
  50. package/docs/api/ai_council.js.html +246 -0
  51. package/docs/api/ai_embeddings.js.html +304 -0
  52. package/docs/api/ai_federation-ai.js.html +338 -0
  53. package/docs/api/ai_h3-ai.js.html +970 -0
  54. package/docs/api/ai_index.js.html +124 -0
  55. package/docs/api/ai_json-ops.js.html +241 -0
  56. package/docs/api/ai_llm-service.js.html +239 -0
  57. package/docs/api/ai_nl-query.js.html +236 -0
  58. package/docs/api/ai_relationships.js.html +367 -0
  59. package/docs/api/ai_schema-extractor.js.html +235 -0
  60. package/docs/api/ai_spatial.js.html +307 -0
  61. package/docs/api/ai_tts.js.html +214 -0
  62. package/docs/api/content_social-protocols.js.html +180 -0
  63. package/docs/api/core_holosphere.js.html +757 -0
  64. package/docs/api/crypto_nostr-utils.js.html +306 -0
  65. package/docs/api/crypto_secp256k1.js.html +267 -0
  66. package/docs/api/data/search.json +1 -0
  67. package/docs/api/federation_discovery.js.html +337 -0
  68. package/docs/api/federation_handshake.js.html +478 -0
  69. package/docs/api/federation_hologram.js.html +1053 -0
  70. package/docs/api/federation_registry.js.html +389 -0
  71. package/docs/api/fonts/Inconsolata-Regular.ttf +0 -0
  72. package/docs/api/fonts/OpenSans-Regular.ttf +0 -0
  73. package/docs/api/fonts/WorkSans-Bold.ttf +0 -0
  74. package/docs/api/global.html +3 -0
  75. package/docs/api/hierarchical_upcast.js.html +128 -0
  76. package/docs/api/index.html +265 -0
  77. package/docs/api/index.js.html +1868 -0
  78. package/docs/api/lib_ai-methods.js.html +660 -0
  79. package/docs/api/lib_contract-methods.js.html +445 -0
  80. package/docs/api/lib_errors.js.html +56 -0
  81. package/docs/api/lib_federation-methods.js.html +348 -0
  82. package/docs/api/lib_index.js.html +33 -0
  83. package/docs/api/module-ai.html +5 -0
  84. package/docs/api/module-ai_aggregation-SmartAggregation.html +6 -0
  85. package/docs/api/module-ai_aggregation.SmartAggregation.html +3 -0
  86. package/docs/api/module-ai_aggregation.html +3 -0
  87. package/docs/api/module-ai_breakdown-TaskBreakdown.html +5 -0
  88. package/docs/api/module-ai_breakdown.TaskBreakdown.html +3 -0
  89. package/docs/api/module-ai_breakdown.html +3 -0
  90. package/docs/api/module-ai_classifier-Classifier.html +6 -0
  91. package/docs/api/module-ai_classifier.Classifier.html +3 -0
  92. package/docs/api/module-ai_classifier.html +3 -0
  93. package/docs/api/module-ai_council-Council.html +6 -0
  94. package/docs/api/module-ai_council.Council.html +3 -0
  95. package/docs/api/module-ai_council.html +3 -0
  96. package/docs/api/module-ai_embeddings-Embeddings.html +5 -0
  97. package/docs/api/module-ai_embeddings.Embeddings.html +3 -0
  98. package/docs/api/module-ai_embeddings.html +3 -0
  99. package/docs/api/module-ai_federation-ai-FederationAdvisor.html +6 -0
  100. package/docs/api/module-ai_federation-ai.FederationAdvisor.html +3 -0
  101. package/docs/api/module-ai_federation-ai.html +3 -0
  102. package/docs/api/module-ai_h3-ai-H3AI.html +6 -0
  103. package/docs/api/module-ai_h3-ai.H3AI.html +3 -0
  104. package/docs/api/module-ai_h3-ai.html +3 -0
  105. package/docs/api/module-ai_json-ops-JSONOps.html +5 -0
  106. package/docs/api/module-ai_json-ops.JSONOps.html +3 -0
  107. package/docs/api/module-ai_json-ops.html +3 -0
  108. package/docs/api/module-ai_llm-service-LLMService.html +5 -0
  109. package/docs/api/module-ai_llm-service.LLMService.html +3 -0
  110. package/docs/api/module-ai_llm-service.html +3 -0
  111. package/docs/api/module-ai_nl-query-NLQuery.html +5 -0
  112. package/docs/api/module-ai_nl-query.NLQuery.html +3 -0
  113. package/docs/api/module-ai_nl-query.html +3 -0
  114. package/docs/api/module-ai_relationships-RelationshipDiscovery.html +6 -0
  115. package/docs/api/module-ai_relationships.RelationshipDiscovery.html +3 -0
  116. package/docs/api/module-ai_relationships.html +3 -0
  117. package/docs/api/module-ai_schema-extractor-SchemaExtractor.html +5 -0
  118. package/docs/api/module-ai_schema-extractor.SchemaExtractor.html +3 -0
  119. package/docs/api/module-ai_schema-extractor.html +3 -0
  120. package/docs/api/module-ai_spatial-SpatialAnalysis.html +6 -0
  121. package/docs/api/module-ai_spatial.SpatialAnalysis.html +3 -0
  122. package/docs/api/module-ai_spatial.html +3 -0
  123. package/docs/api/module-ai_tts-TTS.html +5 -0
  124. package/docs/api/module-ai_tts.TTS.html +3 -0
  125. package/docs/api/module-ai_tts.html +3 -0
  126. package/docs/api/module-content_social-protocols.html +3 -0
  127. package/docs/api/module-core_holosphere-HoloSphere.html +6 -0
  128. package/docs/api/module-core_holosphere.HoloSphere.html +3 -0
  129. package/docs/api/module-core_holosphere.html +3 -0
  130. package/docs/api/module-crypto_nostr-utils.html +3 -0
  131. package/docs/api/module-crypto_secp256k1.html +3 -0
  132. package/docs/api/module-federation_hologram.html +3 -0
  133. package/docs/api/module-hierarchical_upcast.html +3 -0
  134. package/docs/api/module-holosphere-HoloSphereBase.html +3 -0
  135. package/docs/api/module-holosphere.html +3 -0
  136. package/docs/api/module-lib_ai-methods.html +3 -0
  137. package/docs/api/module-lib_contract-methods.html +3 -0
  138. package/docs/api/module-lib_errors-AuthorizationError.html +3 -0
  139. package/docs/api/module-lib_errors-ValidationError.html +3 -0
  140. package/docs/api/module-lib_errors.AuthorizationError.html +3 -0
  141. package/docs/api/module-lib_errors.ValidationError.html +3 -0
  142. package/docs/api/module-lib_errors.html +3 -0
  143. package/docs/api/module-lib_federation-methods.html +3 -0
  144. package/docs/api/module-lib_index.html +3 -0
  145. package/docs/api/module-schema_validator-ValidationError.html +3 -0
  146. package/docs/api/module-schema_validator.ValidationError.html +3 -0
  147. package/docs/api/module-schema_validator.html +3 -0
  148. package/docs/api/module-spatial_h3-operations.html +4 -0
  149. package/docs/api/module-storage_backend-factory.BackendFactory.html +3 -0
  150. package/docs/api/module-storage_backend-factory.html +3 -0
  151. package/docs/api/module-storage_backend-interface-StorageBackend.html +3 -0
  152. package/docs/api/module-storage_backend-interface.StorageBackend.html +3 -0
  153. package/docs/api/module-storage_backend-interface.html +3 -0
  154. package/docs/api/module-storage_backends_activitypub-backend-ActivityPubBackend.html +7 -0
  155. package/docs/api/module-storage_backends_activitypub-backend.ActivityPubBackend.html +3 -0
  156. package/docs/api/module-storage_backends_activitypub-backend.html +3 -0
  157. package/docs/api/module-storage_backends_activitypub_server-ActivityPubServer.html +8 -0
  158. package/docs/api/module-storage_backends_activitypub_server.ActivityPubServer.html +3 -0
  159. package/docs/api/module-storage_backends_activitypub_server.html +3 -0
  160. package/docs/api/module-storage_backends_gundb-backend-GunDBBackend.html +7 -0
  161. package/docs/api/module-storage_backends_gundb-backend.GunDBBackend.html +3 -0
  162. package/docs/api/module-storage_backends_gundb-backend.html +3 -0
  163. package/docs/api/module-storage_backends_nostr-backend-NostrBackend.html +8 -0
  164. package/docs/api/module-storage_backends_nostr-backend.NostrBackend.html +3 -0
  165. package/docs/api/module-storage_backends_nostr-backend.html +3 -0
  166. package/docs/api/module-storage_filesystem-storage-FileSystemStorage.html +5 -0
  167. package/docs/api/module-storage_filesystem-storage-browser-FileSystemStorage.html +3 -0
  168. package/docs/api/module-storage_filesystem-storage-browser.FileSystemStorage.html +3 -0
  169. package/docs/api/module-storage_filesystem-storage-browser.html +3 -0
  170. package/docs/api/module-storage_filesystem-storage.FileSystemStorage.html +3 -0
  171. package/docs/api/module-storage_filesystem-storage.html +3 -0
  172. package/docs/api/module-storage_global-tables.html +3 -0
  173. package/docs/api/module-storage_gun-async.html +3 -0
  174. package/docs/api/module-storage_gun-auth-GunAuth.html +5 -0
  175. package/docs/api/module-storage_gun-auth.GunAuth.html +3 -0
  176. package/docs/api/module-storage_gun-auth.html +3 -0
  177. package/docs/api/module-storage_gun-federation.html +3 -0
  178. package/docs/api/module-storage_gun-references-GunReferenceHandler.html +5 -0
  179. package/docs/api/module-storage_gun-references.GunReferenceHandler.html +3 -0
  180. package/docs/api/module-storage_gun-references.html +3 -0
  181. package/docs/api/module-storage_gun-schema-GunSchemaValidator.html +5 -0
  182. package/docs/api/module-storage_gun-schema.GunSchemaValidator.html +3 -0
  183. package/docs/api/module-storage_gun-schema.html +3 -0
  184. package/docs/api/module-storage_gun-wrapper.html +11 -0
  185. package/docs/api/module-storage_indexeddb-storage-IndexedDBStorage.html +5 -0
  186. package/docs/api/module-storage_indexeddb-storage.IndexedDBStorage.html +3 -0
  187. package/docs/api/module-storage_indexeddb-storage.html +3 -0
  188. package/docs/api/module-storage_key-storage-simple.html +3 -0
  189. package/docs/api/module-storage_key-storage.html +4 -0
  190. package/docs/api/module-storage_memory-storage-MemoryStorage.html +5 -0
  191. package/docs/api/module-storage_memory-storage.MemoryStorage.html +3 -0
  192. package/docs/api/module-storage_memory-storage.html +3 -0
  193. package/docs/api/module-storage_migration-MigrationTool.html +6 -0
  194. package/docs/api/module-storage_migration.MigrationTool.html +3 -0
  195. package/docs/api/module-storage_migration.html +3 -0
  196. package/docs/api/module-storage_nostr-async.html +18 -0
  197. package/docs/api/module-storage_nostr-client-LRUCache.html +3 -0
  198. package/docs/api/module-storage_nostr-client-NostrClient.html +7 -0
  199. package/docs/api/module-storage_nostr-client.NostrClient.html +15 -0
  200. package/docs/api/module-storage_nostr-client.html +6 -0
  201. package/docs/api/module-storage_nostr-wrapper.html +3 -0
  202. package/docs/api/module-storage_outbox-queue-OutboxQueue.html +4 -0
  203. package/docs/api/module-storage_outbox-queue.OutboxQueue.html +3 -0
  204. package/docs/api/module-storage_outbox-queue.html +3 -0
  205. package/docs/api/module-storage_persistent-storage-PersistentStorage.html +3 -0
  206. package/docs/api/module-storage_persistent-storage.html +4 -0
  207. package/docs/api/module-storage_sync-service-SyncService.html +5 -0
  208. package/docs/api/module-storage_sync-service.SyncService.html +3 -0
  209. package/docs/api/module-storage_sync-service.html +3 -0
  210. package/docs/api/module-storage_unified-storage.html +3 -0
  211. package/docs/api/module-subscriptions_manager.SubscriptionRegistry.html +3 -0
  212. package/docs/api/module-subscriptions_manager.html +3 -0
  213. package/docs/api/schema_validator.js.html +113 -0
  214. package/docs/api/scripts/core.js +726 -0
  215. package/docs/api/scripts/core.min.js +23 -0
  216. package/docs/api/scripts/resize.js +90 -0
  217. package/docs/api/scripts/search.js +265 -0
  218. package/docs/api/scripts/search.min.js +6 -0
  219. package/docs/api/scripts/third-party/Apache-License-2.0.txt +202 -0
  220. package/docs/api/scripts/third-party/fuse.js +9 -0
  221. package/docs/api/scripts/third-party/hljs-line-num-original.js +369 -0
  222. package/docs/api/scripts/third-party/hljs-line-num.js +1 -0
  223. package/docs/api/scripts/third-party/hljs-original.js +5171 -0
  224. package/docs/api/scripts/third-party/hljs.js +1 -0
  225. package/docs/api/scripts/third-party/popper.js +5 -0
  226. package/docs/api/scripts/third-party/tippy.js +1 -0
  227. package/docs/api/scripts/third-party/tocbot.js +672 -0
  228. package/docs/api/scripts/third-party/tocbot.min.js +1 -0
  229. package/docs/api/spatial_h3-operations.js.html +129 -0
  230. package/docs/api/storage_backend-factory.js.html +133 -0
  231. package/docs/api/storage_backend-interface.js.html +164 -0
  232. package/docs/api/storage_backends_activitypub-backend.js.html +298 -0
  233. package/docs/api/storage_backends_activitypub_server.js.html +678 -0
  234. package/docs/api/storage_backends_gundb-backend.js.html +878 -0
  235. package/docs/api/storage_backends_nostr-backend.js.html +254 -0
  236. package/docs/api/storage_filesystem-storage-browser.js.html +83 -0
  237. package/docs/api/storage_filesystem-storage.js.html +207 -0
  238. package/docs/api/storage_global-tables.js.html +116 -0
  239. package/docs/api/storage_gun-async.js.html +344 -0
  240. package/docs/api/storage_gun-auth.js.html +376 -0
  241. package/docs/api/storage_gun-federation.js.html +788 -0
  242. package/docs/api/storage_gun-references.js.html +212 -0
  243. package/docs/api/storage_gun-schema.js.html +309 -0
  244. package/docs/api/storage_gun-wrapper.js.html +645 -0
  245. package/docs/api/storage_indexeddb-storage.js.html +224 -0
  246. package/docs/api/storage_key-storage-simple.js.html +102 -0
  247. package/docs/api/storage_key-storage.js.html +171 -0
  248. package/docs/api/storage_memory-storage.js.html +128 -0
  249. package/docs/api/storage_migration.js.html +354 -0
  250. package/docs/api/storage_nostr-async.js.html +1076 -0
  251. package/docs/api/storage_nostr-client.js.html +1598 -0
  252. package/docs/api/storage_nostr-wrapper.js.html +218 -0
  253. package/docs/api/storage_outbox-queue.js.html +248 -0
  254. package/docs/api/storage_persistent-storage.js.html +160 -0
  255. package/docs/api/storage_sync-service.js.html +201 -0
  256. package/docs/api/storage_unified-storage.js.html +157 -0
  257. package/docs/api/styles/clean-jsdoc-theme-base.css +1159 -0
  258. package/docs/api/styles/clean-jsdoc-theme-dark.css +412 -0
  259. package/docs/api/styles/clean-jsdoc-theme-light.css +482 -0
  260. package/docs/api/styles/clean-jsdoc-theme-scrollbar.css +30 -0
  261. package/docs/api/styles/clean-jsdoc-theme-without-scrollbar.min.css +1 -0
  262. package/docs/api/styles/clean-jsdoc-theme.min.css +1 -0
  263. package/docs/api/subscriptions_manager.js.html +162 -0
  264. package/docs/contracts/api-interface.md +793 -0
  265. package/docs/data-model.md +476 -0
  266. package/docs/gun-async-usage.md +338 -0
  267. package/docs/plan.md +349 -0
  268. package/docs/quickstart.md +674 -0
  269. package/docs/research.md +362 -0
  270. package/docs/spec.md +244 -0
  271. package/docs/storage-backends.md +326 -0
  272. package/docs/tasks.md +947 -0
  273. package/examples/demo.html +47 -0
  274. package/examples/holosphere-widget.js +1242 -0
  275. package/examples/widget-demo.html +274 -0
  276. package/examples/widget.html +703 -0
  277. package/jsdoc.json +26 -0
  278. package/package.json +25 -7
  279. package/src/ai/aggregation.js +13 -2
  280. package/src/ai/breakdown.js +12 -2
  281. package/src/ai/classifier.js +14 -3
  282. package/src/ai/council.js +22 -7
  283. package/src/ai/embeddings.js +37 -15
  284. package/src/ai/federation-ai.js +13 -2
  285. package/src/ai/h3-ai.js +14 -2
  286. package/src/ai/index.js +16 -7
  287. package/src/ai/json-ops.js +18 -5
  288. package/src/ai/llm-service.js +62 -31
  289. package/src/ai/nl-query.js +12 -2
  290. package/src/ai/relationships.js +13 -2
  291. package/src/ai/schema-extractor.js +24 -10
  292. package/src/ai/spatial.js +13 -2
  293. package/src/ai/tts.js +25 -8
  294. package/src/cdn-entry.js +22 -0
  295. package/src/content/social-protocols.js +34 -25
  296. package/src/contracts/abis/Appreciative.json +1280 -0
  297. package/src/contracts/abis/AppreciativeFactory.json +101 -0
  298. package/src/contracts/abis/Bundle.json +1438 -0
  299. package/src/contracts/abis/BundleFactory.json +106 -0
  300. package/src/contracts/abis/Holon.json +881 -0
  301. package/src/contracts/abis/Holons.json +330 -0
  302. package/src/contracts/abis/Managed.json +1262 -0
  303. package/src/contracts/abis/ManagedFactory.json +149 -0
  304. package/src/contracts/abis/Membrane.json +261 -0
  305. package/src/contracts/abis/Splitter.json +1624 -0
  306. package/src/contracts/abis/SplitterFactory.json +220 -0
  307. package/src/contracts/abis/TestToken.json +321 -0
  308. package/src/contracts/abis/Zoned.json +1461 -0
  309. package/src/contracts/abis/ZonedFactory.json +154 -0
  310. package/src/contracts/chain-manager.js +403 -0
  311. package/src/contracts/deployer.js +500 -0
  312. package/src/contracts/event-listener.js +539 -0
  313. package/src/contracts/holon-contracts.js +359 -0
  314. package/src/contracts/index.js +82 -0
  315. package/src/contracts/networks.js +229 -0
  316. package/src/contracts/operations.js +687 -0
  317. package/src/contracts/queries.js +638 -0
  318. package/src/core/holosphere.js +487 -6
  319. package/src/crypto/nostr-utils.js +303 -0
  320. package/src/crypto/secp256k1.js +7 -2
  321. package/src/federation/handshake.js +475 -0
  322. package/src/federation/hologram.js +117 -3
  323. package/src/hierarchical/upcast.js +40 -25
  324. package/src/index.js +1501 -1909
  325. package/src/lib/ai-methods.js +657 -0
  326. package/src/lib/contract-methods.js +442 -0
  327. package/src/lib/errors.js +53 -0
  328. package/src/lib/federation-methods.js +345 -0
  329. package/src/lib/index.js +30 -0
  330. package/src/schema/validator.js +22 -3
  331. package/src/spatial/h3-operations.js +19 -3
  332. package/src/storage/backend-factory.js +7 -2
  333. package/src/storage/backend-interface.js +21 -2
  334. package/src/storage/backends/activitypub/server.js +25 -3
  335. package/src/storage/backends/activitypub-backend.js +25 -2
  336. package/src/storage/backends/gundb-backend.js +692 -50
  337. package/src/storage/backends/nostr-backend.js +116 -1
  338. package/src/storage/filesystem-storage-browser.js +42 -2
  339. package/src/storage/filesystem-storage.js +72 -5
  340. package/src/storage/global-tables.js +35 -3
  341. package/src/storage/gun-async.js +75 -15
  342. package/src/storage/gun-auth.js +373 -0
  343. package/src/storage/gun-federation.js +785 -0
  344. package/src/storage/gun-references.js +209 -0
  345. package/src/storage/gun-schema.js +306 -0
  346. package/src/storage/gun-wrapper.js +475 -54
  347. package/src/storage/indexeddb-storage.js +112 -13
  348. package/src/storage/key-storage-simple.js +32 -9
  349. package/src/storage/key-storage.js +45 -13
  350. package/src/storage/memory-storage.js +68 -2
  351. package/src/storage/migration.js +20 -7
  352. package/src/storage/nostr-async.js +412 -122
  353. package/src/storage/nostr-client.js +749 -76
  354. package/src/storage/nostr-wrapper.js +6 -2
  355. package/src/storage/outbox-queue.js +55 -18
  356. package/src/storage/persistent-storage.js +62 -14
  357. package/src/storage/sync-service.js +51 -17
  358. package/src/storage/unified-storage.js +154 -0
  359. package/src/subscriptions/manager.js +34 -17
  360. package/types/index.d.ts +133 -0
  361. package/vite.config.cdn.js +60 -0
  362. package/tests/unit/ai/aggregation.test.js +0 -295
  363. package/tests/unit/ai/breakdown.test.js +0 -446
  364. package/tests/unit/ai/classifier.test.js +0 -294
  365. package/tests/unit/ai/council.test.js +0 -262
  366. package/tests/unit/ai/embeddings.test.js +0 -384
  367. package/tests/unit/ai/federation-ai.test.js +0 -344
  368. package/tests/unit/ai/h3-ai.test.js +0 -458
  369. package/tests/unit/ai/index.test.js +0 -304
  370. package/tests/unit/ai/json-ops.test.js +0 -307
  371. package/tests/unit/ai/llm-service.test.js +0 -390
  372. package/tests/unit/ai/nl-query.test.js +0 -383
  373. package/tests/unit/ai/relationships.test.js +0 -311
  374. package/tests/unit/ai/schema-extractor.test.js +0 -384
  375. package/tests/unit/ai/spatial.test.js +0 -279
  376. package/tests/unit/ai/tts.test.js +0 -279
  377. package/tests/unit/content.test.js +0 -332
  378. package/tests/unit/contract/core.test.js +0 -88
  379. package/tests/unit/contract/crypto.test.js +0 -198
  380. package/tests/unit/contract/data.test.js +0 -223
  381. package/tests/unit/contract/federation.test.js +0 -181
  382. package/tests/unit/contract/hierarchical.test.js +0 -113
  383. package/tests/unit/contract/schema.test.js +0 -114
  384. package/tests/unit/contract/social.test.js +0 -217
  385. package/tests/unit/contract/spatial.test.js +0 -110
  386. package/tests/unit/contract/subscriptions.test.js +0 -128
  387. package/tests/unit/contract/utils.test.js +0 -159
  388. package/tests/unit/core.test.js +0 -152
  389. package/tests/unit/crypto.test.js +0 -328
  390. package/tests/unit/federation.test.js +0 -234
  391. package/tests/unit/gun-async.test.js +0 -252
  392. package/tests/unit/hierarchical.test.js +0 -399
  393. package/tests/unit/integration/scenario-01-geographic-storage.test.js +0 -74
  394. package/tests/unit/integration/scenario-02-federation.test.js +0 -76
  395. package/tests/unit/integration/scenario-03-subscriptions.test.js +0 -102
  396. package/tests/unit/integration/scenario-04-validation.test.js +0 -129
  397. package/tests/unit/integration/scenario-05-hierarchy.test.js +0 -125
  398. package/tests/unit/integration/scenario-06-social.test.js +0 -135
  399. package/tests/unit/integration/scenario-07-persistence.test.js +0 -130
  400. package/tests/unit/integration/scenario-08-authorization.test.js +0 -161
  401. package/tests/unit/integration/scenario-09-cross-dimensional.test.js +0 -139
  402. package/tests/unit/integration/scenario-10-cross-holosphere-capabilities.test.js +0 -357
  403. package/tests/unit/integration/scenario-11-cross-holosphere-federation.test.js +0 -410
  404. package/tests/unit/integration/scenario-12-capability-federated-read.test.js +0 -719
  405. package/tests/unit/performance/benchmark.test.js +0 -85
  406. package/tests/unit/schema.test.js +0 -213
  407. package/tests/unit/spatial.test.js +0 -158
  408. package/tests/unit/storage.test.js +0 -195
  409. package/tests/unit/subscriptions.test.js +0 -328
  410. package/tests/unit/test-data-permanence-debug.js +0 -197
  411. package/tests/unit/test-data-permanence.js +0 -340
  412. package/tests/unit/test-key-persistence-fixed.js +0 -148
  413. package/tests/unit/test-key-persistence.js +0 -172
  414. package/tests/unit/test-relay-permanence.js +0 -376
  415. package/tests/unit/test-second-node.js +0 -95
  416. package/tests/unit/test-simple-write.js +0 -89
  417. /package/{cleanup-test-data.js → scripts/cleanup-test-data.js} +0 -0
  418. /package/{test-ai-real-api.js → scripts/test-ai-real-api.js} +0 -0
@@ -0,0 +1,970 @@
1
+ <!DOCTYPE html><html lang="en" style="font-size:16px"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Source: ai/h3-ai.js</title><!--[if lt IE 9]>
2
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
3
+ <![endif]--><script src="scripts/third-party/hljs.js" defer="defer"></script><script src="scripts/third-party/hljs-line-num.js" defer="defer"></script><script src="scripts/third-party/popper.js" defer="defer"></script><script src="scripts/third-party/tippy.js" defer="defer"></script><script src="scripts/third-party/tocbot.min.js"></script><script>var baseURL="/",locationPathname="";baseURL=(locationPathname=document.location.pathname).substr(0,locationPathname.lastIndexOf("/")+1)</script><link rel="stylesheet" href="styles/clean-jsdoc-theme.min.css"><svg aria-hidden="true" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="display:none"><defs><symbol id="copy-icon" viewbox="0 0 488.3 488.3"><g><path d="M314.25,85.4h-227c-21.3,0-38.6,17.3-38.6,38.6v325.7c0,21.3,17.3,38.6,38.6,38.6h227c21.3,0,38.6-17.3,38.6-38.6V124 C352.75,102.7,335.45,85.4,314.25,85.4z M325.75,449.6c0,6.4-5.2,11.6-11.6,11.6h-227c-6.4,0-11.6-5.2-11.6-11.6V124 c0-6.4,5.2-11.6,11.6-11.6h227c6.4,0,11.6,5.2,11.6,11.6V449.6z"/><path d="M401.05,0h-227c-21.3,0-38.6,17.3-38.6,38.6c0,7.5,6,13.5,13.5,13.5s13.5-6,13.5-13.5c0-6.4,5.2-11.6,11.6-11.6h227 c6.4,0,11.6,5.2,11.6,11.6v325.7c0,6.4-5.2,11.6-11.6,11.6c-7.5,0-13.5,6-13.5,13.5s6,13.5,13.5,13.5c21.3,0,38.6-17.3,38.6-38.6 V38.6C439.65,17.3,422.35,0,401.05,0z"/></g></symbol><symbol id="search-icon" viewBox="0 0 512 512"><g><g><path d="M225.474,0C101.151,0,0,101.151,0,225.474c0,124.33,101.151,225.474,225.474,225.474 c124.33,0,225.474-101.144,225.474-225.474C450.948,101.151,349.804,0,225.474,0z M225.474,409.323 c-101.373,0-183.848-82.475-183.848-183.848S124.101,41.626,225.474,41.626s183.848,82.475,183.848,183.848 S326.847,409.323,225.474,409.323z"/></g></g><g><g><path d="M505.902,476.472L386.574,357.144c-8.131-8.131-21.299-8.131-29.43,0c-8.131,8.124-8.131,21.306,0,29.43l119.328,119.328 c4.065,4.065,9.387,6.098,14.715,6.098c5.321,0,10.649-2.033,14.715-6.098C514.033,497.778,514.033,484.596,505.902,476.472z"/></g></g></symbol><symbol id="font-size-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M11.246 15H4.754l-2 5H.6L7 4h2l6.4 16h-2.154l-2-5zm-.8-2L8 6.885 5.554 13h4.892zM21 12.535V12h2v8h-2v-.535a4 4 0 1 1 0-6.93zM19 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"/></symbol><symbol id="add-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"/></symbol><symbol id="minus-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M5 11h14v2H5z"/></symbol><symbol id="dark-theme-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M10 7a7 7 0 0 0 12 4.9v.1c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2h.1A6.979 6.979 0 0 0 10 7zm-6 5a8 8 0 0 0 15.062 3.762A9 9 0 0 1 8.238 4.938 7.999 7.999 0 0 0 4 12z"/></symbol><symbol id="light-theme-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 18a6 6 0 1 1 0-12 6 6 0 0 1 0 12zm0-2a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM11 1h2v3h-2V1zm0 19h2v3h-2v-3zM3.515 4.929l1.414-1.414L7.05 5.636 5.636 7.05 3.515 4.93zM16.95 18.364l1.414-1.414 2.121 2.121-1.414 1.414-2.121-2.121zm2.121-14.85l1.414 1.415-2.121 2.121-1.414-1.414 2.121-2.121zM5.636 16.95l1.414 1.414-2.121 2.121-1.414-1.414 2.121-2.121zM23 11v2h-3v-2h3zM4 11v2H1v-2h3z"/></symbol><symbol id="reset-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M18.537 19.567A9.961 9.961 0 0 1 12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10c0 2.136-.67 4.116-1.81 5.74L17 12h3a8 8 0 1 0-2.46 5.772l.997 1.795z"/></symbol><symbol id="down-icon" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.7803 6.21967C13.0732 6.51256 13.0732 6.98744 12.7803 7.28033L8.53033 11.5303C8.23744 11.8232 7.76256 11.8232 7.46967 11.5303L3.21967 7.28033C2.92678 6.98744 2.92678 6.51256 3.21967 6.21967C3.51256 5.92678 3.98744 5.92678 4.28033 6.21967L8 9.93934L11.7197 6.21967C12.0126 5.92678 12.4874 5.92678 12.7803 6.21967Z"></path></symbol><symbol id="codepen-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M16.5 13.202L13 15.535v3.596L19.197 15 16.5 13.202zM14.697 12L12 10.202 9.303 12 12 13.798 14.697 12zM20 10.869L18.303 12 20 13.131V10.87zM19.197 9L13 4.869v3.596l3.5 2.333L19.197 9zM7.5 10.798L11 8.465V4.869L4.803 9 7.5 10.798zM4.803 15L11 19.131v-3.596l-3.5-2.333L4.803 15zM4 13.131L5.697 12 4 10.869v2.262zM2 9a1 1 0 0 1 .445-.832l9-6a1 1 0 0 1 1.11 0l9 6A1 1 0 0 1 22 9v6a1 1 0 0 1-.445.832l-9 6a1 1 0 0 1-1.11 0l-9-6A1 1 0 0 1 2 15V9z"/></symbol><symbol id="close-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z"/></symbol><symbol id="menu-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M3 4h18v2H3V4zm0 7h18v2H3v-2zm0 7h18v2H3v-2z"/></symbol></defs></svg></head><body data-theme="dark"><div class="sidebar-container"><div class="sidebar" id="sidebar"><div class="sidebar-items-container"><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-modules"><div>Modules</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="module-ai.html">ai</a></div><div class="sidebar-section-children"><a href="module-ai_aggregation.html">ai/aggregation</a></div><div class="sidebar-section-children"><a href="module-ai_breakdown.html">ai/breakdown</a></div><div class="sidebar-section-children"><a href="module-ai_classifier.html">ai/classifier</a></div><div class="sidebar-section-children"><a href="module-ai_council.html">ai/council</a></div><div class="sidebar-section-children"><a href="module-ai_embeddings.html">ai/embeddings</a></div><div class="sidebar-section-children"><a href="module-ai_federation-ai.html">ai/federation-ai</a></div><div class="sidebar-section-children"><a href="module-ai_h3-ai.html">ai/h3-ai</a></div><div class="sidebar-section-children"><a href="module-ai_json-ops.html">ai/json-ops</a></div><div class="sidebar-section-children"><a href="module-ai_llm-service.html">ai/llm-service</a></div><div class="sidebar-section-children"><a href="module-ai_nl-query.html">ai/nl-query</a></div><div class="sidebar-section-children"><a href="module-ai_relationships.html">ai/relationships</a></div><div class="sidebar-section-children"><a href="module-ai_schema-extractor.html">ai/schema-extractor</a></div><div class="sidebar-section-children"><a href="module-ai_spatial.html">ai/spatial</a></div><div class="sidebar-section-children"><a href="module-ai_tts.html">ai/tts</a></div><div class="sidebar-section-children"><a href="module-content_social-protocols.html">content/social-protocols</a></div><div class="sidebar-section-children"><a href="module-core_holosphere.html">core/holosphere</a></div><div class="sidebar-section-children"><a href="module-crypto_nostr-utils.html">crypto/nostr-utils</a></div><div class="sidebar-section-children"><a href="module-crypto_secp256k1.html">crypto/secp256k1</a></div><div class="sidebar-section-children"><a href="module-federation_hologram.html">federation/hologram</a></div><div class="sidebar-section-children"><a href="module-hierarchical_upcast.html">hierarchical/upcast</a></div><div class="sidebar-section-children"><a href="module-holosphere.html">holosphere</a></div><div class="sidebar-section-children"><a href="module-lib_ai-methods.html">lib/ai-methods</a></div><div class="sidebar-section-children"><a href="module-lib_contract-methods.html">lib/contract-methods</a></div><div class="sidebar-section-children"><a href="module-lib_errors.html">lib/errors</a></div><div class="sidebar-section-children"><a href="module-lib_federation-methods.html">lib/federation-methods</a></div><div class="sidebar-section-children"><a href="module-lib_index.html">lib/index</a></div><div class="sidebar-section-children"><a href="module-schema_validator.html">schema/validator</a></div><div class="sidebar-section-children"><a href="module-spatial_h3-operations.html">spatial/h3-operations</a></div><div class="sidebar-section-children"><a href="module-storage_backend-factory.html">storage/backend-factory</a></div><div class="sidebar-section-children"><a href="module-storage_backend-interface.html">storage/backend-interface</a></div><div class="sidebar-section-children"><a href="module-storage_backends_activitypub-backend.html">storage/backends/activitypub-backend</a></div><div class="sidebar-section-children"><a href="module-storage_backends_activitypub_server.html">storage/backends/activitypub/server</a></div><div class="sidebar-section-children"><a href="module-storage_backends_gundb-backend.html">storage/backends/gundb-backend</a></div><div class="sidebar-section-children"><a href="module-storage_backends_nostr-backend.html">storage/backends/nostr-backend</a></div><div class="sidebar-section-children"><a href="module-storage_filesystem-storage.html">storage/filesystem-storage</a></div><div class="sidebar-section-children"><a href="module-storage_filesystem-storage-browser.html">storage/filesystem-storage-browser</a></div><div class="sidebar-section-children"><a href="module-storage_global-tables.html">storage/global-tables</a></div><div class="sidebar-section-children"><a href="module-storage_gun-async.html">storage/gun-async</a></div><div class="sidebar-section-children"><a href="module-storage_gun-auth.html">storage/gun-auth</a></div><div class="sidebar-section-children"><a href="module-storage_gun-federation.html">storage/gun-federation</a></div><div class="sidebar-section-children"><a href="module-storage_gun-references.html">storage/gun-references</a></div><div class="sidebar-section-children"><a href="module-storage_gun-schema.html">storage/gun-schema</a></div><div class="sidebar-section-children"><a href="module-storage_gun-wrapper.html">storage/gun-wrapper</a></div><div class="sidebar-section-children"><a href="module-storage_indexeddb-storage.html">storage/indexeddb-storage</a></div><div class="sidebar-section-children"><a href="module-storage_key-storage.html">storage/key-storage</a></div><div class="sidebar-section-children"><a href="module-storage_key-storage-simple.html">storage/key-storage-simple</a></div><div class="sidebar-section-children"><a href="module-storage_memory-storage.html">storage/memory-storage</a></div><div class="sidebar-section-children"><a href="module-storage_migration.html">storage/migration</a></div><div class="sidebar-section-children"><a href="module-storage_nostr-async.html">storage/nostr-async</a></div><div class="sidebar-section-children"><a href="module-storage_nostr-client.html">storage/nostr-client</a></div><div class="sidebar-section-children"><a href="module-storage_nostr-wrapper.html">storage/nostr-wrapper</a></div><div class="sidebar-section-children"><a href="module-storage_outbox-queue.html">storage/outbox-queue</a></div><div class="sidebar-section-children"><a href="module-storage_persistent-storage.html">storage/persistent-storage</a></div><div class="sidebar-section-children"><a href="module-storage_sync-service.html">storage/sync-service</a></div><div class="sidebar-section-children"><a href="module-storage_unified-storage.html">storage/unified-storage</a></div><div class="sidebar-section-children"><a href="module-subscriptions_manager.html">subscriptions/manager</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-classes"><div>Classes</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="module-ai_aggregation.SmartAggregation.html">SmartAggregation</a></div><div class="sidebar-section-children"><a href="module-ai_aggregation-SmartAggregation.html">SmartAggregation</a></div><div class="sidebar-section-children"><a href="module-ai_breakdown.TaskBreakdown.html">TaskBreakdown</a></div><div class="sidebar-section-children"><a href="module-ai_breakdown-TaskBreakdown.html">TaskBreakdown</a></div><div class="sidebar-section-children"><a href="module-ai_classifier.Classifier.html">Classifier</a></div><div class="sidebar-section-children"><a href="module-ai_classifier-Classifier.html">Classifier</a></div><div class="sidebar-section-children"><a href="module-ai_council.Council.html">Council</a></div><div class="sidebar-section-children"><a href="module-ai_council-Council.html">Council</a></div><div class="sidebar-section-children"><a href="module-ai_embeddings.Embeddings.html">Embeddings</a></div><div class="sidebar-section-children"><a href="module-ai_embeddings-Embeddings.html">Embeddings</a></div><div class="sidebar-section-children"><a href="module-ai_federation-ai.FederationAdvisor.html">FederationAdvisor</a></div><div class="sidebar-section-children"><a href="module-ai_federation-ai-FederationAdvisor.html">FederationAdvisor</a></div><div class="sidebar-section-children"><a href="module-ai_h3-ai.H3AI.html">H3AI</a></div><div class="sidebar-section-children"><a href="module-ai_h3-ai-H3AI.html">H3AI</a></div><div class="sidebar-section-children"><a href="module-ai_json-ops.JSONOps.html">JSONOps</a></div><div class="sidebar-section-children"><a href="module-ai_json-ops-JSONOps.html">JSONOps</a></div><div class="sidebar-section-children"><a href="module-ai_llm-service.LLMService.html">LLMService</a></div><div class="sidebar-section-children"><a href="module-ai_llm-service-LLMService.html">LLMService</a></div><div class="sidebar-section-children"><a href="module-ai_nl-query.NLQuery.html">NLQuery</a></div><div class="sidebar-section-children"><a href="module-ai_nl-query-NLQuery.html">NLQuery</a></div><div class="sidebar-section-children"><a href="module-ai_relationships.RelationshipDiscovery.html">RelationshipDiscovery</a></div><div class="sidebar-section-children"><a href="module-ai_relationships-RelationshipDiscovery.html">RelationshipDiscovery</a></div><div class="sidebar-section-children"><a href="module-ai_schema-extractor.SchemaExtractor.html">SchemaExtractor</a></div><div class="sidebar-section-children"><a href="module-ai_schema-extractor-SchemaExtractor.html">SchemaExtractor</a></div><div class="sidebar-section-children"><a href="module-ai_spatial.SpatialAnalysis.html">SpatialAnalysis</a></div><div class="sidebar-section-children"><a href="module-ai_spatial-SpatialAnalysis.html">SpatialAnalysis</a></div><div class="sidebar-section-children"><a href="module-ai_tts.TTS.html">TTS</a></div><div class="sidebar-section-children"><a href="module-ai_tts-TTS.html">TTS</a></div><div class="sidebar-section-children"><a href="module-core_holosphere.HoloSphere.html">HoloSphere</a></div><div class="sidebar-section-children"><a href="module-core_holosphere-HoloSphere.html">HoloSphere</a></div><div class="sidebar-section-children"><a href="module-holosphere-HoloSphereBase.html">HoloSphereBase</a></div><div class="sidebar-section-children"><a href="module-holosphere-HoloSphereBase.html">HoloSphereBase</a></div><div class="sidebar-section-children"><a href="module-lib_errors.AuthorizationError.html">AuthorizationError</a></div><div class="sidebar-section-children"><a href="module-lib_errors.ValidationError.html">ValidationError</a></div><div class="sidebar-section-children"><a href="module-lib_errors-AuthorizationError.html">AuthorizationError</a></div><div class="sidebar-section-children"><a href="module-lib_errors-ValidationError.html">ValidationError</a></div><div class="sidebar-section-children"><a href="module-schema_validator.ValidationError.html">ValidationError</a></div><div class="sidebar-section-children"><a href="module-schema_validator-ValidationError.html">ValidationError</a></div><div class="sidebar-section-children"><a href="module-storage_backend-factory.BackendFactory.html">BackendFactory</a></div><div class="sidebar-section-children"><a href="module-storage_backend-interface.StorageBackend.html">StorageBackend</a></div><div class="sidebar-section-children"><a href="module-storage_backend-interface-StorageBackend.html">StorageBackend</a></div><div class="sidebar-section-children"><a href="module-storage_backends_activitypub-backend.ActivityPubBackend.html">ActivityPubBackend</a></div><div class="sidebar-section-children"><a href="module-storage_backends_activitypub-backend-ActivityPubBackend.html">ActivityPubBackend</a></div><div class="sidebar-section-children"><a href="module-storage_backends_activitypub_server.ActivityPubServer.html">ActivityPubServer</a></div><div class="sidebar-section-children"><a href="module-storage_backends_activitypub_server-ActivityPubServer.html">ActivityPubServer</a></div><div class="sidebar-section-children"><a href="module-storage_backends_gundb-backend.GunDBBackend.html">GunDBBackend</a></div><div class="sidebar-section-children"><a href="module-storage_backends_gundb-backend-GunDBBackend.html">GunDBBackend</a></div><div class="sidebar-section-children"><a href="module-storage_backends_nostr-backend.NostrBackend.html">NostrBackend</a></div><div class="sidebar-section-children"><a href="module-storage_backends_nostr-backend-NostrBackend.html">NostrBackend</a></div><div class="sidebar-section-children"><a href="module-storage_filesystem-storage-browser.FileSystemStorage.html">FileSystemStorage</a></div><div class="sidebar-section-children"><a href="module-storage_filesystem-storage-browser-FileSystemStorage.html">FileSystemStorage</a></div><div class="sidebar-section-children"><a href="module-storage_filesystem-storage.FileSystemStorage.html">FileSystemStorage</a></div><div class="sidebar-section-children"><a href="module-storage_filesystem-storage-FileSystemStorage.html">FileSystemStorage</a></div><div class="sidebar-section-children"><a href="module-storage_gun-auth.GunAuth.html">GunAuth</a></div><div class="sidebar-section-children"><a href="module-storage_gun-auth-GunAuth.html">GunAuth</a></div><div class="sidebar-section-children"><a href="module-storage_gun-references.GunReferenceHandler.html">GunReferenceHandler</a></div><div class="sidebar-section-children"><a href="module-storage_gun-references-GunReferenceHandler.html">GunReferenceHandler</a></div><div class="sidebar-section-children"><a href="module-storage_gun-schema.GunSchemaValidator.html">GunSchemaValidator</a></div><div class="sidebar-section-children"><a href="module-storage_gun-schema-GunSchemaValidator.html">GunSchemaValidator</a></div><div class="sidebar-section-children"><a href="module-storage_indexeddb-storage.IndexedDBStorage.html">IndexedDBStorage</a></div><div class="sidebar-section-children"><a href="module-storage_indexeddb-storage-IndexedDBStorage.html">IndexedDBStorage</a></div><div class="sidebar-section-children"><a href="module-storage_memory-storage.MemoryStorage.html">MemoryStorage</a></div><div class="sidebar-section-children"><a href="module-storage_memory-storage-MemoryStorage.html">MemoryStorage</a></div><div class="sidebar-section-children"><a href="module-storage_migration.MigrationTool.html">MigrationTool</a></div><div class="sidebar-section-children"><a href="module-storage_migration-MigrationTool.html">MigrationTool</a></div><div class="sidebar-section-children"><a href="module-storage_nostr-client.NostrClient.html">NostrClient</a></div><div class="sidebar-section-children"><a href="module-storage_nostr-client-LRUCache.html">LRUCache</a></div><div class="sidebar-section-children"><a href="module-storage_nostr-client-NostrClient.html">NostrClient</a></div><div class="sidebar-section-children"><a href="module-storage_outbox-queue.OutboxQueue.html">OutboxQueue</a></div><div class="sidebar-section-children"><a href="module-storage_outbox-queue-OutboxQueue.html">OutboxQueue</a></div><div class="sidebar-section-children"><a href="module-storage_persistent-storage-PersistentStorage.html">PersistentStorage</a></div><div class="sidebar-section-children"><a href="module-storage_sync-service.SyncService.html">SyncService</a></div><div class="sidebar-section-children"><a href="module-storage_sync-service-SyncService.html">SyncService</a></div><div class="sidebar-section-children"><a href="module-subscriptions_manager.SubscriptionRegistry.html">SubscriptionRegistry</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-global"><div>Global</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="global.html#FederationRequestPayload">FederationRequestPayload</a></div><div class="sidebar-section-children"><a href="global.html#FederationResponsePayload">FederationResponsePayload</a></div><div class="sidebar-section-children"><a href="global.html#acceptFederationRequest">acceptFederationRequest</a></div><div class="sidebar-section-children"><a href="global.html#acceptFederationRequest">acceptFederationRequest</a></div><div class="sidebar-section-children"><a href="global.html#addFederatedPartner">addFederatedPartner</a></div><div class="sidebar-section-children"><a href="global.html#cleanupExpiredCapabilities">cleanupExpiredCapabilities</a></div><div class="sidebar-section-children"><a href="global.html#createFederationRequest">createFederationRequest</a></div><div class="sidebar-section-children"><a href="global.html#createFederationResponse">createFederationResponse</a></div><div class="sidebar-section-children"><a href="global.html#declineFederationRequest">declineFederationRequest</a></div><div class="sidebar-section-children"><a href="global.html#getCapabilityForAuthor">getCapabilityForAuthor</a></div><div class="sidebar-section-children"><a href="global.html#getFederatedAuthors">getFederatedAuthors</a></div><div class="sidebar-section-children"><a href="global.html#getFederatedAuthorsForScope">getFederatedAuthorsForScope</a></div><div class="sidebar-section-children"><a href="global.html#getFederatedPartner">getFederatedPartner</a></div><div class="sidebar-section-children"><a href="global.html#getFederationRegistry">getFederationRegistry</a></div><div class="sidebar-section-children"><a href="global.html#getPendingFederationRequests">getPendingFederationRequests</a></div><div class="sidebar-section-children"><a href="global.html#initiateFederationHandshake">initiateFederationHandshake</a></div><div class="sidebar-section-children"><a href="global.html#isFederationRequest">isFederationRequest</a></div><div class="sidebar-section-children"><a href="global.html#isFederationResponse">isFederationResponse</a></div><div class="sidebar-section-children"><a href="global.html#rejectFederationRequest">rejectFederationRequest</a></div><div class="sidebar-section-children"><a href="global.html#removeFederatedPartner">removeFederatedPartner</a></div><div class="sidebar-section-children"><a href="global.html#revokeOutboundCapability">revokeOutboundCapability</a></div><div class="sidebar-section-children"><a href="global.html#saveFederationRegistry">saveFederationRegistry</a></div><div class="sidebar-section-children"><a href="global.html#sendFederationRequest">sendFederationRequest</a></div><div class="sidebar-section-children"><a href="global.html#sendFederationRequest">sendFederationRequest</a></div><div class="sidebar-section-children"><a href="global.html#sendFederationResponse">sendFederationResponse</a></div><div class="sidebar-section-children"><a href="global.html#storeInboundCapability">storeInboundCapability</a></div><div class="sidebar-section-children"><a href="global.html#storeOutboundCapability">storeOutboundCapability</a></div><div class="sidebar-section-children"><a href="global.html#subscribeFederationAcceptances">subscribeFederationAcceptances</a></div><div class="sidebar-section-children"><a href="global.html#subscribeFederationDeclines">subscribeFederationDeclines</a></div><div class="sidebar-section-children"><a href="global.html#subscribeFederationRequests">subscribeFederationRequests</a></div><div class="sidebar-section-children"><a href="global.html#subscribeToFederationDMs">subscribeToFederationDMs</a></div><div class="sidebar-section-children"><a href="global.html#updateDiscoverySettings">updateDiscoverySettings</a></div></div></div></div></div><div class="navbar-container" id="VuAckcnZhf"><nav class="navbar"><div class="navbar-left-items"></div><div class="navbar-right-items"><div class="navbar-right-item"><button class="icon-button search-button" aria-label="open-search"><svg><use xlink:href="#search-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button theme-toggle" aria-label="toggle-theme"><svg><use class="theme-svg-use" xlink:href="#light-theme-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button font-size" aria-label="change-font-size"><svg><use xlink:href="#font-size-icon"></use></svg></button></div></div><nav></nav></nav></div><div class="toc-container"><div class="toc-content"><span class="bold">On this page</span><div id="eed4d2a0bfd64539bb9df78095dec881"></div></div></div><div class="body-wrapper"><div class="main-content"><div class="main-wrapper"><section id="source-page" class="source-page"><header><h1 id="title" class="has-anchor">ai_h3-ai.js</h1></header><article><pre class="prettyprint source lang-js"><code>/**
4
+ * @fileoverview Geospatial intelligence for H3 hexagonal hierarchies.
5
+ * Provides AI-powered analysis of geographic data distribution, resolution suggestions,
6
+ * coverage analysis, and cross-resolution insights using the H3 geospatial indexing system.
7
+ * @module ai/h3-ai
8
+ */
9
+
10
+ import * as h3 from 'h3-js';
11
+
12
+ /**
13
+ * Service class for geospatial intelligence using H3 hexagonal hierarchies.
14
+ * Analyzes geographic data patterns, suggests optimal resolutions, identifies coverage gaps,
15
+ * and provides multi-scale geographic insights across H3's hierarchical grid system.
16
+ *
17
+ * @class H3AI
18
+ * @example
19
+ * const h3ai = new H3AI(llmService, holosphere);
20
+ * const resolution = await h3ai.suggestResolution(project);
21
+ * const coverage = await h3ai.analyzeCoverage(holonId, 'projects');
22
+ * const distribution = await h3ai.analyzeDistribution(holonId, 'events');
23
+ */
24
+ export class H3AI {
25
+ /**
26
+ * @param {LLMService} llmService - LLM service instance
27
+ * @param {Object} holosphere - HoloSphere instance
28
+ */
29
+ constructor(llmService, holosphere = null) {
30
+ this.llm = llmService;
31
+ this.holosphere = holosphere;
32
+ }
33
+
34
+ /**
35
+ * Set HoloSphere instance
36
+ * @param {Object} holosphere - HoloSphere instance
37
+ */
38
+ setHoloSphere(holosphere) {
39
+ this.holosphere = holosphere;
40
+ }
41
+
42
+ /**
43
+ * Suggest optimal H3 resolution for a task/project based on its scope
44
+ * @param {Object} item - Item to analyze (task, project, quest)
45
+ * @param {Object} options - Options
46
+ * @returns {Promise&lt;Object>} Resolution recommendation
47
+ */
48
+ async suggestResolution(item, options = {}) {
49
+ const { currentResolution = null, context = null } = options;
50
+
51
+ const systemPrompt = `You are a geospatial planning expert. Analyze this item and suggest the optimal H3 hexagonal resolution (0-15) for organizing it.
52
+
53
+ H3 Resolution Guide:
54
+ - Resolution 0-2: Continental/country scale (thousands of km)
55
+ - Resolution 3-4: Regional/state scale (hundreds of km)
56
+ - Resolution 5-6: Metropolitan/city scale (tens of km)
57
+ - Resolution 7-8: District/neighborhood scale (km)
58
+ - Resolution 9-10: Block/street scale (hundreds of meters)
59
+ - Resolution 11-12: Building/lot scale (tens of meters)
60
+ - Resolution 13-15: Room/precise scale (meters)
61
+
62
+ Consider:
63
+ 1. Geographic scope mentioned in the item
64
+ 2. Number of potential participants/stakeholders
65
+ 3. Type of activity (local vs regional)
66
+ 4. Resource requirements and logistics
67
+ 5. Similar projects' typical scale
68
+
69
+ ${currentResolution !== null ? `Current resolution: ${currentResolution}` : ''}
70
+ ${context ? `Context:\n${JSON.stringify(context, null, 2)}` : ''}
71
+
72
+ Return JSON:
73
+ {
74
+ "recommendedResolution": n,
75
+ "reasoning": "why this resolution",
76
+ "alternativeResolutions": [{"resolution": n, "useCase": "when to use"}],
77
+ "geographicScope": "description of area covered",
78
+ "scaleSuggestions": {
79
+ "expansion": {"resolution": n, "reason": "when to expand"},
80
+ "contraction": {"resolution": n, "reason": "when to focus"}
81
+ }
82
+ }`;
83
+
84
+ return this.llm.getJSON(
85
+ systemPrompt,
86
+ JSON.stringify(item, null, 2),
87
+ { temperature: 0.3 }
88
+ );
89
+ }
90
+
91
+ /**
92
+ * Analyze geographic distribution of data across H3 cells
93
+ * @param {string} holonId - Parent holon to analyze
94
+ * @param {string} lensName - Lens to analyze
95
+ * @param {Object} options - Options
96
+ * @returns {Promise&lt;Object>} Distribution analysis
97
+ */
98
+ async analyzeDistribution(holonId, lensName, options = {}) {
99
+ if (!this.holosphere) {
100
+ throw new Error('HoloSphere instance required');
101
+ }
102
+
103
+ const { includeChildren = true, maxChildren = 20 } = options;
104
+
105
+ // Get data from the holon
106
+ const parentData = await this.holosphere.getAll(holonId, lensName);
107
+
108
+ // Get data from children if requested
109
+ const childrenData = {};
110
+ if (includeChildren &amp;&amp; h3.isValidCell(holonId)) {
111
+ const resolution = h3.getResolution(holonId);
112
+ if (resolution &lt; 15) {
113
+ const children = h3.cellToChildren(holonId, resolution + 1);
114
+ for (const child of children.slice(0, maxChildren)) {
115
+ try {
116
+ const data = await this.holosphere.getAll(child, lensName);
117
+ if (data.length > 0) {
118
+ childrenData[child] = {
119
+ count: data.length,
120
+ sample: data.slice(0, 3),
121
+ };
122
+ }
123
+ } catch {
124
+ // Skip unavailable children
125
+ }
126
+ }
127
+ }
128
+ }
129
+
130
+ const systemPrompt = `You are a geospatial analyst. Analyze the distribution of data across this H3 hexagonal region.
131
+
132
+ Parent holon: ${holonId}
133
+ Resolution: ${h3.isValidCell(holonId) ? h3.getResolution(holonId) : 'N/A'}
134
+ Parent data count: ${parentData.length}
135
+ Children with data: ${Object.keys(childrenData).length}
136
+
137
+ Analyze:
138
+ 1. Data density and distribution patterns
139
+ 2. Geographic hotspots and cold spots
140
+ 3. Coverage gaps
141
+ 4. Clustering patterns
142
+ 5. Recommendations for better coverage
143
+
144
+ Return JSON:
145
+ {
146
+ "distribution": {
147
+ "pattern": "clustered|uniform|sparse|concentrated",
148
+ "density": "high|medium|low",
149
+ "coverage": 0.0-1.0
150
+ },
151
+ "hotspots": [{"holonId": "id", "reason": "why"}],
152
+ "gaps": [{"description": "gap description", "suggestedAction": "what to do"}],
153
+ "clusters": [{"theme": "cluster theme", "holons": ["id1"]}],
154
+ "recommendations": ["rec1"],
155
+ "summary": "overview"
156
+ }`;
157
+
158
+ const userMessage = `Parent data sample:
159
+ ${JSON.stringify(parentData.slice(0, 10), null, 2)}
160
+
161
+ Children distribution:
162
+ ${JSON.stringify(childrenData, null, 2)}`;
163
+
164
+ const analysis = await this.llm.getJSON(systemPrompt, userMessage, { temperature: 0.3 });
165
+
166
+ return {
167
+ holonId,
168
+ lensName,
169
+ resolution: h3.isValidCell(holonId) ? h3.getResolution(holonId) : null,
170
+ parentDataCount: parentData.length,
171
+ childrenAnalyzed: Object.keys(childrenData).length,
172
+ analysis,
173
+ timestamp: Date.now(),
174
+ };
175
+ }
176
+
177
+ /**
178
+ * Find relevant data from neighboring H3 cells
179
+ * @param {string} holonId - Center holon
180
+ * @param {string} lensName - Lens to search
181
+ * @param {Object} options - Options
182
+ * @returns {Promise&lt;Object>} Neighbor recommendations
183
+ */
184
+ async findNeighborRelevance(holonId, lensName, options = {}) {
185
+ if (!this.holosphere) {
186
+ throw new Error('HoloSphere instance required');
187
+ }
188
+
189
+ if (!h3.isValidCell(holonId)) {
190
+ throw new Error('Invalid H3 cell');
191
+ }
192
+
193
+ const { ringSize = 1, relevanceThreshold = 0.5 } = options;
194
+
195
+ // Get center data
196
+ const centerData = await this.holosphere.getAll(holonId, lensName);
197
+
198
+ // Get neighbor data
199
+ const neighbors = h3.gridDisk(holonId, ringSize).filter(n => n !== holonId);
200
+ const neighborData = {};
201
+
202
+ for (const neighbor of neighbors) {
203
+ try {
204
+ const data = await this.holosphere.getAll(neighbor, lensName);
205
+ if (data.length > 0) {
206
+ neighborData[neighbor] = data.slice(0, 5);
207
+ }
208
+ } catch {
209
+ // Skip
210
+ }
211
+ }
212
+
213
+ if (Object.keys(neighborData).length === 0) {
214
+ return {
215
+ holonId,
216
+ neighbors: [],
217
+ message: 'No data found in neighboring cells',
218
+ };
219
+ }
220
+
221
+ const systemPrompt = `You are a geospatial relevance analyst. Find items in neighboring H3 cells that are relevant to the center cell's data.
222
+
223
+ Center cell: ${holonId}
224
+ Ring size: ${ringSize} (immediate neighbors)
225
+
226
+ Consider:
227
+ 1. Thematic overlap
228
+ 2. Potential collaborations
229
+ 3. Shared resources
230
+ 4. Cross-boundary projects
231
+ 5. Geographic continuity of activities
232
+
233
+ Return JSON:
234
+ {
235
+ "relevantNeighbors": [
236
+ {
237
+ "holonId": "neighbor_id",
238
+ "relevanceScore": 0.0-1.0,
239
+ "relevantItems": [{"id": "item_id", "reason": "why relevant"}],
240
+ "collaborationPotential": "description"
241
+ }
242
+ ],
243
+ "crossBoundaryOpportunities": [
244
+ {
245
+ "description": "opportunity",
246
+ "involvedHolons": ["id1", "id2"],
247
+ "suggestedAction": "what to do"
248
+ }
249
+ ],
250
+ "geographicPatterns": ["pattern1"],
251
+ "summary": "overview"
252
+ }`;
253
+
254
+ const userMessage = `Center cell data:
255
+ ${JSON.stringify(centerData.slice(0, 10), null, 2)}
256
+
257
+ Neighbor data:
258
+ ${JSON.stringify(neighborData, null, 2)}`;
259
+
260
+ const analysis = await this.llm.getJSON(systemPrompt, userMessage, { temperature: 0.4 });
261
+
262
+ // Filter by threshold
263
+ if (analysis.relevantNeighbors) {
264
+ analysis.relevantNeighbors = analysis.relevantNeighbors
265
+ .filter(n => n.relevanceScore >= relevanceThreshold);
266
+ }
267
+
268
+ return {
269
+ holonId,
270
+ lensName,
271
+ ringSize,
272
+ neighborsAnalyzed: Object.keys(neighborData).length,
273
+ analysis,
274
+ timestamp: Date.now(),
275
+ };
276
+ }
277
+
278
+ /**
279
+ * Suggest geographic expansion or contraction for an item
280
+ * @param {Object} item - Item to analyze
281
+ * @param {string} currentHolonId - Current holon
282
+ * @param {string} lensName - Lens name
283
+ * @param {Object} options - Options
284
+ * @returns {Promise&lt;Object>} Expansion/contraction suggestions
285
+ */
286
+ async suggestGeographicScope(item, currentHolonId, lensName, options = {}) {
287
+ if (!this.holosphere) {
288
+ throw new Error('HoloSphere instance required');
289
+ }
290
+
291
+ if (!h3.isValidCell(currentHolonId)) {
292
+ throw new Error('Invalid H3 cell');
293
+ }
294
+
295
+ const currentResolution = h3.getResolution(currentHolonId);
296
+
297
+ // Get parent data
298
+ let parentData = [];
299
+ if (currentResolution > 0) {
300
+ const parent = h3.cellToParent(currentHolonId, currentResolution - 1);
301
+ try {
302
+ parentData = await this.holosphere.getAll(parent, lensName);
303
+ } catch {
304
+ // No parent data
305
+ }
306
+ }
307
+
308
+ // Get sample children data
309
+ let childrenData = [];
310
+ if (currentResolution &lt; 15) {
311
+ const children = h3.cellToChildren(currentHolonId, currentResolution + 1);
312
+ for (const child of children.slice(0, 7)) {
313
+ try {
314
+ const data = await this.holosphere.getAll(child, lensName);
315
+ childrenData.push(...data.slice(0, 2));
316
+ } catch {
317
+ // Skip
318
+ }
319
+ }
320
+ }
321
+
322
+ const systemPrompt = `You are a geographic scope advisor. Analyze whether this item should expand to a larger region (parent holon) or focus on smaller sub-regions (children holons).
323
+
324
+ Current holon: ${currentHolonId}
325
+ Current resolution: ${currentResolution}
326
+
327
+ Factors to consider:
328
+ 1. Item's stated scope and goals
329
+ 2. Current participation/activity level
330
+ 3. Resource requirements
331
+ 4. Similar activities in parent/children
332
+ 5. Natural geographic boundaries
333
+
334
+ Return JSON:
335
+ {
336
+ "currentScopeAssessment": {
337
+ "appropriate": true/false,
338
+ "reasoning": "why"
339
+ },
340
+ "expansionRecommendation": {
341
+ "recommended": true/false,
342
+ "targetResolution": n,
343
+ "reasoning": "why expand",
344
+ "benefits": ["benefit1"],
345
+ "risks": ["risk1"]
346
+ },
347
+ "contractionRecommendation": {
348
+ "recommended": true/false,
349
+ "targetResolution": n,
350
+ "reasoning": "why contract",
351
+ "suggestedFocusAreas": ["description"],
352
+ "benefits": ["benefit1"],
353
+ "risks": ["risk1"]
354
+ },
355
+ "optimalAction": "expand|contract|maintain",
356
+ "summary": "recommendation summary"
357
+ }`;
358
+
359
+ const userMessage = `Item to analyze:
360
+ ${JSON.stringify(item, null, 2)}
361
+
362
+ Parent region data (${parentData.length} items):
363
+ ${JSON.stringify(parentData.slice(0, 5), null, 2)}
364
+
365
+ Children regions data (${childrenData.length} items):
366
+ ${JSON.stringify(childrenData.slice(0, 5), null, 2)}`;
367
+
368
+ return this.llm.getJSON(systemPrompt, userMessage, { temperature: 0.3 });
369
+ }
370
+
371
+ /**
372
+ * Analyze coverage gaps in a region
373
+ * @param {string} holonId - Region to analyze
374
+ * @param {string} lensName - Lens
375
+ * @param {Object} options - Options
376
+ * @returns {Promise&lt;Object>} Coverage analysis
377
+ */
378
+ async analyzeCoverage(holonId, lensName, options = {}) {
379
+ if (!this.holosphere) {
380
+ throw new Error('HoloSphere instance required');
381
+ }
382
+
383
+ if (!h3.isValidCell(holonId)) {
384
+ throw new Error('Invalid H3 cell');
385
+ }
386
+
387
+ const { targetResolution = null } = options;
388
+ const currentResolution = h3.getResolution(holonId);
389
+ const childResolution = targetResolution || Math.min(currentResolution + 1, 15);
390
+
391
+ // Get all children at target resolution
392
+ const children = h3.cellToChildren(holonId, childResolution);
393
+
394
+ // Check which children have data
395
+ const coverage = {
396
+ total: children.length,
397
+ withData: 0,
398
+ withoutData: 0,
399
+ dataDistribution: {},
400
+ };
401
+
402
+ const childrenWithData = [];
403
+ const childrenWithoutData = [];
404
+
405
+ for (const child of children) {
406
+ try {
407
+ const data = await this.holosphere.getAll(child, lensName);
408
+ if (data.length > 0) {
409
+ coverage.withData++;
410
+ coverage.dataDistribution[child] = data.length;
411
+ childrenWithData.push({ holon: child, count: data.length });
412
+ } else {
413
+ coverage.withoutData++;
414
+ childrenWithoutData.push(child);
415
+ }
416
+ } catch {
417
+ coverage.withoutData++;
418
+ childrenWithoutData.push(child);
419
+ }
420
+ }
421
+
422
+ const systemPrompt = `You are a geographic coverage analyst. Analyze the data coverage in this H3 region.
423
+
424
+ Region: ${holonId}
425
+ Resolution: ${currentResolution}
426
+ Child resolution analyzed: ${childResolution}
427
+ Total children: ${coverage.total}
428
+ Children with data: ${coverage.withData}
429
+ Children without data: ${coverage.withoutData}
430
+ Coverage ratio: ${(coverage.withData / coverage.total * 100).toFixed(1)}%
431
+
432
+ Analyze:
433
+ 1. Coverage patterns
434
+ 2. Potential reasons for gaps
435
+ 3. Priority areas for expansion
436
+ 4. Whether gaps are concerning or expected
437
+
438
+ Return JSON:
439
+ {
440
+ "coverageScore": 0.0-1.0,
441
+ "coverageQuality": "excellent|good|moderate|poor|minimal",
442
+ "patterns": {
443
+ "type": "clustered|scattered|peripheral|central|uniform",
444
+ "description": "pattern description"
445
+ },
446
+ "gaps": {
447
+ "count": n,
448
+ "significance": "high|medium|low",
449
+ "likelyReasons": ["reason1"],
450
+ "priorityAreas": ["description of areas to focus"]
451
+ },
452
+ "recommendations": [
453
+ {
454
+ "action": "what to do",
455
+ "priority": "high|medium|low",
456
+ "targetArea": "description"
457
+ }
458
+ ],
459
+ "summary": "overview"
460
+ }`;
461
+
462
+ const analysis = await this.llm.getJSON(systemPrompt, '', { temperature: 0.3 });
463
+
464
+ return {
465
+ holonId,
466
+ lensName,
467
+ resolution: currentResolution,
468
+ childResolution,
469
+ coverage: {
470
+ ...coverage,
471
+ ratio: coverage.withData / coverage.total,
472
+ },
473
+ childrenWithData: childrenWithData.slice(0, 10),
474
+ gapCount: childrenWithoutData.length,
475
+ analysis,
476
+ timestamp: Date.now(),
477
+ };
478
+ }
479
+
480
+ /**
481
+ * Find patterns across multiple H3 resolutions
482
+ * @param {string} holonId - Starting holon
483
+ * @param {string} lensName - Lens
484
+ * @param {Object} options - Options
485
+ * @returns {Promise&lt;Object>} Cross-resolution insights
486
+ */
487
+ async crossResolutionInsights(holonId, lensName, options = {}) {
488
+ if (!this.holosphere) {
489
+ throw new Error('HoloSphere instance required');
490
+ }
491
+
492
+ if (!h3.isValidCell(holonId)) {
493
+ throw new Error('Invalid H3 cell');
494
+ }
495
+
496
+ const { levels = 3 } = options;
497
+ const currentResolution = h3.getResolution(holonId);
498
+
499
+ // Collect data at multiple resolutions
500
+ const resolutionData = {};
501
+
502
+ // Current level
503
+ const currentData = await this.holosphere.getAll(holonId, lensName);
504
+ resolutionData[currentResolution] = {
505
+ holon: holonId,
506
+ count: currentData.length,
507
+ sample: currentData.slice(0, 5),
508
+ };
509
+
510
+ // Parent levels
511
+ let parentHolon = holonId;
512
+ for (let i = 0; i &lt; levels &amp;&amp; h3.getResolution(parentHolon) > 0; i++) {
513
+ const res = h3.getResolution(parentHolon) - 1;
514
+ parentHolon = h3.cellToParent(parentHolon, res);
515
+ try {
516
+ const data = await this.holosphere.getAll(parentHolon, lensName);
517
+ resolutionData[res] = {
518
+ holon: parentHolon,
519
+ count: data.length,
520
+ sample: data.slice(0, 5),
521
+ };
522
+ } catch {
523
+ // Skip
524
+ }
525
+ }
526
+
527
+ // Child level (one level down)
528
+ if (currentResolution &lt; 15) {
529
+ const childRes = currentResolution + 1;
530
+ const children = h3.cellToChildren(holonId, childRes);
531
+ let childTotal = 0;
532
+ const childSamples = [];
533
+
534
+ for (const child of children.slice(0, 7)) {
535
+ try {
536
+ const data = await this.holosphere.getAll(child, lensName);
537
+ childTotal += data.length;
538
+ if (data.length > 0) {
539
+ childSamples.push(...data.slice(0, 2));
540
+ }
541
+ } catch {
542
+ // Skip
543
+ }
544
+ }
545
+
546
+ resolutionData[childRes] = {
547
+ holon: `${children.length} children`,
548
+ count: childTotal,
549
+ sample: childSamples.slice(0, 5),
550
+ };
551
+ }
552
+
553
+ const systemPrompt = `You are a multi-scale geographic analyst. Find patterns that emerge across different H3 resolutions.
554
+
555
+ Starting holon: ${holonId}
556
+ Resolutions analyzed: ${Object.keys(resolutionData).sort().join(', ')}
557
+
558
+ Data at each resolution:
559
+ ${JSON.stringify(resolutionData, null, 2)}
560
+
561
+ Analyze:
562
+ 1. How themes evolve across scales
563
+ 2. What appears only at certain resolutions
564
+ 3. Aggregation patterns (local vs regional)
565
+ 4. Scale-dependent opportunities
566
+ 5. Optimal resolution for different activities
567
+
568
+ Return JSON:
569
+ {
570
+ "scalePatterns": [
571
+ {
572
+ "pattern": "description",
573
+ "visibleAt": [resolution_numbers],
574
+ "significance": "why this matters"
575
+ }
576
+ ],
577
+ "themeEvolution": {
578
+ "localThemes": ["themes at fine resolution"],
579
+ "regionalThemes": ["themes at coarse resolution"],
580
+ "consistentThemes": ["themes across all scales"]
581
+ },
582
+ "optimalResolutions": {
583
+ "forCollaboration": n,
584
+ "forResources": n,
585
+ "forCommunity": n,
586
+ "reasoning": "why"
587
+ },
588
+ "insights": ["insight1"],
589
+ "recommendations": ["rec1"],
590
+ "summary": "overview"
591
+ }`;
592
+
593
+ return this.llm.getJSON(systemPrompt, '', { temperature: 0.4 });
594
+ }
595
+
596
+ /**
597
+ * Suggest item migration between holons based on geographic fit
598
+ * @param {Object} item - Item to analyze
599
+ * @param {string} currentHolonId - Current location
600
+ * @param {string} lensName - Lens
601
+ * @param {Object} options - Options
602
+ * @returns {Promise&lt;Object>} Migration suggestions
603
+ */
604
+ async suggestMigration(item, currentHolonId, lensName, options = {}) {
605
+ if (!this.holosphere) {
606
+ throw new Error('HoloSphere instance required');
607
+ }
608
+
609
+ if (!h3.isValidCell(currentHolonId)) {
610
+ throw new Error('Invalid H3 cell');
611
+ }
612
+
613
+ const { searchRadius = 2 } = options;
614
+
615
+ // Get data from nearby cells
616
+ const nearby = h3.gridDisk(currentHolonId, searchRadius);
617
+ const nearbyData = {};
618
+
619
+ for (const cell of nearby) {
620
+ if (cell === currentHolonId) continue;
621
+ try {
622
+ const data = await this.holosphere.getAll(cell, lensName);
623
+ if (data.length > 0) {
624
+ nearbyData[cell] = {
625
+ count: data.length,
626
+ sample: data.slice(0, 3),
627
+ };
628
+ }
629
+ } catch {
630
+ // Skip
631
+ }
632
+ }
633
+
634
+ // Also check parent
635
+ const currentRes = h3.getResolution(currentHolonId);
636
+ let parentData = null;
637
+ if (currentRes > 0) {
638
+ const parent = h3.cellToParent(currentHolonId, currentRes - 1);
639
+ try {
640
+ const data = await this.holosphere.getAll(parent, lensName);
641
+ parentData = { holon: parent, count: data.length, sample: data.slice(0, 3) };
642
+ } catch {
643
+ // Skip
644
+ }
645
+ }
646
+
647
+ const systemPrompt = `You are a geographic placement advisor. Determine if this item would be better suited in a different H3 cell.
648
+
649
+ Current location: ${currentHolonId}
650
+ Current resolution: ${currentRes}
651
+
652
+ Consider:
653
+ 1. Thematic fit with existing data in each cell
654
+ 2. Geographic scope of the item
655
+ 3. Collaboration opportunities
656
+ 4. Resource proximity
657
+ 5. Community alignment
658
+
659
+ Return JSON:
660
+ {
661
+ "currentFit": {
662
+ "score": 0.0-1.0,
663
+ "reasoning": "why current location is/isn't appropriate"
664
+ },
665
+ "migrationRecommended": true/false,
666
+ "suggestedDestinations": [
667
+ {
668
+ "holonId": "cell_id",
669
+ "fitScore": 0.0-1.0,
670
+ "reasoning": "why this location",
671
+ "benefits": ["benefit1"],
672
+ "drawbacks": ["drawback1"]
673
+ }
674
+ ],
675
+ "stayReasons": ["reason to stay if applicable"],
676
+ "moveReasons": ["reason to move if applicable"],
677
+ "recommendation": "stay|move|duplicate",
678
+ "summary": "final recommendation"
679
+ }`;
680
+
681
+ const userMessage = `Item to place:
682
+ ${JSON.stringify(item, null, 2)}
683
+
684
+ Nearby cells with data:
685
+ ${JSON.stringify(nearbyData, null, 2)}
686
+
687
+ ${parentData ? `Parent cell data:\n${JSON.stringify(parentData, null, 2)}` : ''}`;
688
+
689
+ return this.llm.getJSON(systemPrompt, userMessage, { temperature: 0.3 });
690
+ }
691
+
692
+ /**
693
+ * Generate a geographic activity report for a region
694
+ * @param {string} holonId - Region to report on
695
+ * @param {Object} options - Options
696
+ * @returns {Promise&lt;Object>} Geographic report
697
+ */
698
+ async generateGeographicReport(holonId, options = {}) {
699
+ if (!this.holosphere) {
700
+ throw new Error('HoloSphere instance required');
701
+ }
702
+
703
+ const { lenses = ['projects', 'quests', 'events', 'resources', 'default'] } = options;
704
+
705
+ // Collect data from all lenses
706
+ const lensData = {};
707
+ for (const lens of lenses) {
708
+ try {
709
+ const data = await this.holosphere.getAll(holonId, lens);
710
+ if (data.length > 0) {
711
+ lensData[lens] = {
712
+ count: data.length,
713
+ sample: data.slice(0, 5),
714
+ };
715
+ }
716
+ } catch {
717
+ // Skip
718
+ }
719
+ }
720
+
721
+ // Get geographic context
722
+ let geoContext = {};
723
+ if (h3.isValidCell(holonId)) {
724
+ const res = h3.getResolution(holonId);
725
+ const [lat, lng] = h3.cellToLatLng(holonId);
726
+ const boundary = h3.cellToBoundary(holonId);
727
+ const area = h3.cellArea(holonId, 'km2');
728
+
729
+ geoContext = {
730
+ resolution: res,
731
+ center: { lat, lng },
732
+ areaKm2: area,
733
+ vertexCount: boundary.length,
734
+ };
735
+ }
736
+
737
+ const systemPrompt = `You are a regional activity reporter. Generate a comprehensive report on geographic activity in this H3 region.
738
+
739
+ Region: ${holonId}
740
+ Geographic context: ${JSON.stringify(geoContext, null, 2)}
741
+ Data available in ${Object.keys(lensData).length} categories
742
+
743
+ Generate a report covering:
744
+ 1. Executive summary
745
+ 2. Activity overview by category
746
+ 3. Key highlights and achievements
747
+ 4. Geographic patterns
748
+ 5. Opportunities and challenges
749
+ 6. Recommendations
750
+
751
+ Return JSON:
752
+ {
753
+ "title": "Region Report Title",
754
+ "executiveSummary": "2-3 sentence overview",
755
+ "activityOverview": {
756
+ "totalItems": n,
757
+ "categorySummaries": {"lens": "summary"}
758
+ },
759
+ "highlights": [
760
+ {"title": "highlight", "description": "details", "category": "lens"}
761
+ ],
762
+ "geographicPatterns": ["pattern1"],
763
+ "strengths": ["strength1"],
764
+ "challenges": ["challenge1"],
765
+ "opportunities": ["opportunity1"],
766
+ "recommendations": [
767
+ {"priority": "high|medium|low", "action": "what to do", "rationale": "why"}
768
+ ],
769
+ "metrics": {
770
+ "activityLevel": "high|medium|low",
771
+ "diversity": "high|medium|low",
772
+ "growth": "growing|stable|declining"
773
+ }
774
+ }`;
775
+
776
+ const report = await this.llm.getJSON(
777
+ systemPrompt,
778
+ JSON.stringify(lensData, null, 2),
779
+ { temperature: 0.4, maxTokens: 2000 }
780
+ );
781
+
782
+ return {
783
+ holonId,
784
+ geoContext,
785
+ lensesAnalyzed: Object.keys(lensData),
786
+ totalItems: Object.values(lensData).reduce((sum, l) => sum + l.count, 0),
787
+ report,
788
+ timestamp: Date.now(),
789
+ };
790
+ }
791
+
792
+ /**
793
+ * Find geographic clusters of related items
794
+ * @param {string} holonId - Region to analyze
795
+ * @param {string} lensName - Lens
796
+ * @param {Object} options - Options
797
+ * @returns {Promise&lt;Object>} Geographic clusters
798
+ */
799
+ async findGeographicClusters(holonId, lensName, options = {}) {
800
+ if (!this.holosphere) {
801
+ throw new Error('HoloSphere instance required');
802
+ }
803
+
804
+ if (!h3.isValidCell(holonId)) {
805
+ throw new Error('Invalid H3 cell');
806
+ }
807
+
808
+ const { clusterResolution = null } = options;
809
+ const currentRes = h3.getResolution(holonId);
810
+ const targetRes = clusterResolution || Math.min(currentRes + 1, 15);
811
+
812
+ // Get data from children at cluster resolution
813
+ const children = h3.cellToChildren(holonId, targetRes);
814
+ const cellData = {};
815
+
816
+ for (const child of children) {
817
+ try {
818
+ const data = await this.holosphere.getAll(child, lensName);
819
+ if (data.length > 0) {
820
+ cellData[child] = data;
821
+ }
822
+ } catch {
823
+ // Skip
824
+ }
825
+ }
826
+
827
+ if (Object.keys(cellData).length &lt; 2) {
828
+ return {
829
+ holonId,
830
+ clusters: [],
831
+ message: 'Not enough data for clustering',
832
+ };
833
+ }
834
+
835
+ const systemPrompt = `You are a geographic clustering expert. Find thematic clusters in this spatial data.
836
+
837
+ Region: ${holonId}
838
+ Resolution analyzed: ${targetRes}
839
+ Cells with data: ${Object.keys(cellData).length}
840
+
841
+ Identify:
842
+ 1. Thematic clusters (cells with similar content)
843
+ 2. Activity clusters (cells with related activities)
844
+ 3. Isolated cells (unique content)
845
+ 4. Potential connections between clusters
846
+
847
+ Return JSON:
848
+ {
849
+ "clusters": [
850
+ {
851
+ "name": "cluster name",
852
+ "theme": "what unifies this cluster",
853
+ "cells": ["cell_id1", "cell_id2"],
854
+ "strength": 0.0-1.0,
855
+ "characteristics": ["char1"]
856
+ }
857
+ ],
858
+ "isolatedCells": [
859
+ {"cellId": "id", "uniqueAspect": "what makes it unique"}
860
+ ],
861
+ "interClusterConnections": [
862
+ {"cluster1": "name", "cluster2": "name", "connection": "how related"}
863
+ ],
864
+ "spatialPatterns": ["pattern1"],
865
+ "recommendations": ["rec1"]
866
+ }`;
867
+
868
+ const analysis = await this.llm.getJSON(
869
+ systemPrompt,
870
+ JSON.stringify(cellData, null, 2),
871
+ { temperature: 0.4 }
872
+ );
873
+
874
+ return {
875
+ holonId,
876
+ lensName,
877
+ clusterResolution: targetRes,
878
+ cellsAnalyzed: Object.keys(cellData).length,
879
+ analysis,
880
+ timestamp: Date.now(),
881
+ };
882
+ }
883
+
884
+ /**
885
+ * Calculate and explain geographic impact of an item
886
+ * @param {Object} item - Item to analyze
887
+ * @param {string} holonId - Item's holon
888
+ * @param {string} lensName - Lens
889
+ * @param {Object} options - Options
890
+ * @returns {Promise&lt;Object>} Impact analysis
891
+ */
892
+ async analyzeGeographicImpact(item, holonId, lensName, options = {}) {
893
+ if (!h3.isValidCell(holonId)) {
894
+ throw new Error('Invalid H3 cell');
895
+ }
896
+
897
+ const res = h3.getResolution(holonId);
898
+ const [lat, lng] = h3.cellToLatLng(holonId);
899
+ const area = h3.cellArea(holonId, 'km2');
900
+
901
+ // Get parent info for context
902
+ let parentContext = null;
903
+ if (res > 0) {
904
+ const parent = h3.cellToParent(holonId, Math.max(0, res - 2));
905
+ const parentArea = h3.cellArea(parent, 'km2');
906
+ parentContext = {
907
+ holon: parent,
908
+ resolution: res - 2,
909
+ areaKm2: parentArea,
910
+ };
911
+ }
912
+
913
+ const systemPrompt = `You are a geographic impact analyst. Analyze the geographic reach and impact of this item.
914
+
915
+ Item location: ${holonId}
916
+ Resolution: ${res}
917
+ Center: ${lat.toFixed(4)}, ${lng.toFixed(4)}
918
+ Area: ${area.toFixed(2)} km²
919
+
920
+ ${parentContext ? `Broader region: ${parentContext.areaKm2.toFixed(2)} km²` : ''}
921
+
922
+ Analyze:
923
+ 1. Direct impact area (immediate cell)
924
+ 2. Indirect impact area (spillover effects)
925
+ 3. Potential reach (if expanded)
926
+ 4. Geographic barriers/enablers
927
+ 5. Network effects
928
+
929
+ Return JSON:
930
+ {
931
+ "directImpact": {
932
+ "areaKm2": n,
933
+ "description": "direct impact area",
934
+ "affectedPopulation": "estimate or N/A"
935
+ },
936
+ "indirectImpact": {
937
+ "estimatedReach": n,
938
+ "mechanisms": ["how impact spreads"],
939
+ "neighboringAreas": ["affected areas"]
940
+ },
941
+ "potentialReach": {
942
+ "ifExpanded": {
943
+ "maxAreaKm2": n,
944
+ "optimalResolution": n,
945
+ "limitingFactors": ["factor1"]
946
+ }
947
+ },
948
+ "geographicFactors": {
949
+ "enablers": ["what helps geographic spread"],
950
+ "barriers": ["what limits spread"]
951
+ },
952
+ "impactScore": {
953
+ "local": 0.0-1.0,
954
+ "regional": 0.0-1.0,
955
+ "network": 0.0-1.0
956
+ },
957
+ "recommendations": ["how to increase impact"],
958
+ "summary": "impact overview"
959
+ }`;
960
+
961
+ return this.llm.getJSON(
962
+ systemPrompt,
963
+ JSON.stringify(item, null, 2),
964
+ { temperature: 0.3 }
965
+ );
966
+ }
967
+ }
968
+
969
+ export default H3AI;
970
+ </code></pre></article></section></div></div></div><div class="search-container" id="PkfLWpAbet" style="display:none"><div class="wrapper" id="iCxFxjkHbP"><button class="icon-button search-close-button" id="VjLlGakifb" aria-label="close search"><svg><use xlink:href="#close-icon"></use></svg></button><div class="search-box-c"><svg><use xlink:href="#search-icon"></use></svg> <input type="text" id="vpcKVYIppa" class="search-input" placeholder="Search..." autofocus></div><div class="search-result-c" id="fWwVHRuDuN"><span class="search-result-c-text">Type anything to view search result</span></div></div></div><div class="mobile-menu-icon-container"><button class="icon-button" id="mobile-menu" data-isopen="false" aria-label="menu"><svg><use xlink:href="#menu-icon"></use></svg></button></div><div id="mobile-sidebar" class="mobile-sidebar-container"><div class="mobile-sidebar-wrapper"><div class="mobile-nav-links"></div><div class="mobile-sidebar-items-c"><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-modules"><div>Modules</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="module-ai.html">ai</a></div><div class="sidebar-section-children"><a href="module-ai_aggregation.html">ai/aggregation</a></div><div class="sidebar-section-children"><a href="module-ai_breakdown.html">ai/breakdown</a></div><div class="sidebar-section-children"><a href="module-ai_classifier.html">ai/classifier</a></div><div class="sidebar-section-children"><a href="module-ai_council.html">ai/council</a></div><div class="sidebar-section-children"><a href="module-ai_embeddings.html">ai/embeddings</a></div><div class="sidebar-section-children"><a href="module-ai_federation-ai.html">ai/federation-ai</a></div><div class="sidebar-section-children"><a href="module-ai_h3-ai.html">ai/h3-ai</a></div><div class="sidebar-section-children"><a href="module-ai_json-ops.html">ai/json-ops</a></div><div class="sidebar-section-children"><a href="module-ai_llm-service.html">ai/llm-service</a></div><div class="sidebar-section-children"><a href="module-ai_nl-query.html">ai/nl-query</a></div><div class="sidebar-section-children"><a href="module-ai_relationships.html">ai/relationships</a></div><div class="sidebar-section-children"><a href="module-ai_schema-extractor.html">ai/schema-extractor</a></div><div class="sidebar-section-children"><a href="module-ai_spatial.html">ai/spatial</a></div><div class="sidebar-section-children"><a href="module-ai_tts.html">ai/tts</a></div><div class="sidebar-section-children"><a href="module-content_social-protocols.html">content/social-protocols</a></div><div class="sidebar-section-children"><a href="module-core_holosphere.html">core/holosphere</a></div><div class="sidebar-section-children"><a href="module-crypto_nostr-utils.html">crypto/nostr-utils</a></div><div class="sidebar-section-children"><a href="module-crypto_secp256k1.html">crypto/secp256k1</a></div><div class="sidebar-section-children"><a href="module-federation_hologram.html">federation/hologram</a></div><div class="sidebar-section-children"><a href="module-hierarchical_upcast.html">hierarchical/upcast</a></div><div class="sidebar-section-children"><a href="module-holosphere.html">holosphere</a></div><div class="sidebar-section-children"><a href="module-lib_ai-methods.html">lib/ai-methods</a></div><div class="sidebar-section-children"><a href="module-lib_contract-methods.html">lib/contract-methods</a></div><div class="sidebar-section-children"><a href="module-lib_errors.html">lib/errors</a></div><div class="sidebar-section-children"><a href="module-lib_federation-methods.html">lib/federation-methods</a></div><div class="sidebar-section-children"><a href="module-lib_index.html">lib/index</a></div><div class="sidebar-section-children"><a href="module-schema_validator.html">schema/validator</a></div><div class="sidebar-section-children"><a href="module-spatial_h3-operations.html">spatial/h3-operations</a></div><div class="sidebar-section-children"><a href="module-storage_backend-factory.html">storage/backend-factory</a></div><div class="sidebar-section-children"><a href="module-storage_backend-interface.html">storage/backend-interface</a></div><div class="sidebar-section-children"><a href="module-storage_backends_activitypub-backend.html">storage/backends/activitypub-backend</a></div><div class="sidebar-section-children"><a href="module-storage_backends_activitypub_server.html">storage/backends/activitypub/server</a></div><div class="sidebar-section-children"><a href="module-storage_backends_gundb-backend.html">storage/backends/gundb-backend</a></div><div class="sidebar-section-children"><a href="module-storage_backends_nostr-backend.html">storage/backends/nostr-backend</a></div><div class="sidebar-section-children"><a href="module-storage_filesystem-storage.html">storage/filesystem-storage</a></div><div class="sidebar-section-children"><a href="module-storage_filesystem-storage-browser.html">storage/filesystem-storage-browser</a></div><div class="sidebar-section-children"><a href="module-storage_global-tables.html">storage/global-tables</a></div><div class="sidebar-section-children"><a href="module-storage_gun-async.html">storage/gun-async</a></div><div class="sidebar-section-children"><a href="module-storage_gun-auth.html">storage/gun-auth</a></div><div class="sidebar-section-children"><a href="module-storage_gun-federation.html">storage/gun-federation</a></div><div class="sidebar-section-children"><a href="module-storage_gun-references.html">storage/gun-references</a></div><div class="sidebar-section-children"><a href="module-storage_gun-schema.html">storage/gun-schema</a></div><div class="sidebar-section-children"><a href="module-storage_gun-wrapper.html">storage/gun-wrapper</a></div><div class="sidebar-section-children"><a href="module-storage_indexeddb-storage.html">storage/indexeddb-storage</a></div><div class="sidebar-section-children"><a href="module-storage_key-storage.html">storage/key-storage</a></div><div class="sidebar-section-children"><a href="module-storage_key-storage-simple.html">storage/key-storage-simple</a></div><div class="sidebar-section-children"><a href="module-storage_memory-storage.html">storage/memory-storage</a></div><div class="sidebar-section-children"><a href="module-storage_migration.html">storage/migration</a></div><div class="sidebar-section-children"><a href="module-storage_nostr-async.html">storage/nostr-async</a></div><div class="sidebar-section-children"><a href="module-storage_nostr-client.html">storage/nostr-client</a></div><div class="sidebar-section-children"><a href="module-storage_nostr-wrapper.html">storage/nostr-wrapper</a></div><div class="sidebar-section-children"><a href="module-storage_outbox-queue.html">storage/outbox-queue</a></div><div class="sidebar-section-children"><a href="module-storage_persistent-storage.html">storage/persistent-storage</a></div><div class="sidebar-section-children"><a href="module-storage_sync-service.html">storage/sync-service</a></div><div class="sidebar-section-children"><a href="module-storage_unified-storage.html">storage/unified-storage</a></div><div class="sidebar-section-children"><a href="module-subscriptions_manager.html">subscriptions/manager</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-classes"><div>Classes</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="module-ai_aggregation.SmartAggregation.html">SmartAggregation</a></div><div class="sidebar-section-children"><a href="module-ai_aggregation-SmartAggregation.html">SmartAggregation</a></div><div class="sidebar-section-children"><a href="module-ai_breakdown.TaskBreakdown.html">TaskBreakdown</a></div><div class="sidebar-section-children"><a href="module-ai_breakdown-TaskBreakdown.html">TaskBreakdown</a></div><div class="sidebar-section-children"><a href="module-ai_classifier.Classifier.html">Classifier</a></div><div class="sidebar-section-children"><a href="module-ai_classifier-Classifier.html">Classifier</a></div><div class="sidebar-section-children"><a href="module-ai_council.Council.html">Council</a></div><div class="sidebar-section-children"><a href="module-ai_council-Council.html">Council</a></div><div class="sidebar-section-children"><a href="module-ai_embeddings.Embeddings.html">Embeddings</a></div><div class="sidebar-section-children"><a href="module-ai_embeddings-Embeddings.html">Embeddings</a></div><div class="sidebar-section-children"><a href="module-ai_federation-ai.FederationAdvisor.html">FederationAdvisor</a></div><div class="sidebar-section-children"><a href="module-ai_federation-ai-FederationAdvisor.html">FederationAdvisor</a></div><div class="sidebar-section-children"><a href="module-ai_h3-ai.H3AI.html">H3AI</a></div><div class="sidebar-section-children"><a href="module-ai_h3-ai-H3AI.html">H3AI</a></div><div class="sidebar-section-children"><a href="module-ai_json-ops.JSONOps.html">JSONOps</a></div><div class="sidebar-section-children"><a href="module-ai_json-ops-JSONOps.html">JSONOps</a></div><div class="sidebar-section-children"><a href="module-ai_llm-service.LLMService.html">LLMService</a></div><div class="sidebar-section-children"><a href="module-ai_llm-service-LLMService.html">LLMService</a></div><div class="sidebar-section-children"><a href="module-ai_nl-query.NLQuery.html">NLQuery</a></div><div class="sidebar-section-children"><a href="module-ai_nl-query-NLQuery.html">NLQuery</a></div><div class="sidebar-section-children"><a href="module-ai_relationships.RelationshipDiscovery.html">RelationshipDiscovery</a></div><div class="sidebar-section-children"><a href="module-ai_relationships-RelationshipDiscovery.html">RelationshipDiscovery</a></div><div class="sidebar-section-children"><a href="module-ai_schema-extractor.SchemaExtractor.html">SchemaExtractor</a></div><div class="sidebar-section-children"><a href="module-ai_schema-extractor-SchemaExtractor.html">SchemaExtractor</a></div><div class="sidebar-section-children"><a href="module-ai_spatial.SpatialAnalysis.html">SpatialAnalysis</a></div><div class="sidebar-section-children"><a href="module-ai_spatial-SpatialAnalysis.html">SpatialAnalysis</a></div><div class="sidebar-section-children"><a href="module-ai_tts.TTS.html">TTS</a></div><div class="sidebar-section-children"><a href="module-ai_tts-TTS.html">TTS</a></div><div class="sidebar-section-children"><a href="module-core_holosphere.HoloSphere.html">HoloSphere</a></div><div class="sidebar-section-children"><a href="module-core_holosphere-HoloSphere.html">HoloSphere</a></div><div class="sidebar-section-children"><a href="module-holosphere-HoloSphereBase.html">HoloSphereBase</a></div><div class="sidebar-section-children"><a href="module-holosphere-HoloSphereBase.html">HoloSphereBase</a></div><div class="sidebar-section-children"><a href="module-lib_errors.AuthorizationError.html">AuthorizationError</a></div><div class="sidebar-section-children"><a href="module-lib_errors.ValidationError.html">ValidationError</a></div><div class="sidebar-section-children"><a href="module-lib_errors-AuthorizationError.html">AuthorizationError</a></div><div class="sidebar-section-children"><a href="module-lib_errors-ValidationError.html">ValidationError</a></div><div class="sidebar-section-children"><a href="module-schema_validator.ValidationError.html">ValidationError</a></div><div class="sidebar-section-children"><a href="module-schema_validator-ValidationError.html">ValidationError</a></div><div class="sidebar-section-children"><a href="module-storage_backend-factory.BackendFactory.html">BackendFactory</a></div><div class="sidebar-section-children"><a href="module-storage_backend-interface.StorageBackend.html">StorageBackend</a></div><div class="sidebar-section-children"><a href="module-storage_backend-interface-StorageBackend.html">StorageBackend</a></div><div class="sidebar-section-children"><a href="module-storage_backends_activitypub-backend.ActivityPubBackend.html">ActivityPubBackend</a></div><div class="sidebar-section-children"><a href="module-storage_backends_activitypub-backend-ActivityPubBackend.html">ActivityPubBackend</a></div><div class="sidebar-section-children"><a href="module-storage_backends_activitypub_server.ActivityPubServer.html">ActivityPubServer</a></div><div class="sidebar-section-children"><a href="module-storage_backends_activitypub_server-ActivityPubServer.html">ActivityPubServer</a></div><div class="sidebar-section-children"><a href="module-storage_backends_gundb-backend.GunDBBackend.html">GunDBBackend</a></div><div class="sidebar-section-children"><a href="module-storage_backends_gundb-backend-GunDBBackend.html">GunDBBackend</a></div><div class="sidebar-section-children"><a href="module-storage_backends_nostr-backend.NostrBackend.html">NostrBackend</a></div><div class="sidebar-section-children"><a href="module-storage_backends_nostr-backend-NostrBackend.html">NostrBackend</a></div><div class="sidebar-section-children"><a href="module-storage_filesystem-storage-browser.FileSystemStorage.html">FileSystemStorage</a></div><div class="sidebar-section-children"><a href="module-storage_filesystem-storage-browser-FileSystemStorage.html">FileSystemStorage</a></div><div class="sidebar-section-children"><a href="module-storage_filesystem-storage.FileSystemStorage.html">FileSystemStorage</a></div><div class="sidebar-section-children"><a href="module-storage_filesystem-storage-FileSystemStorage.html">FileSystemStorage</a></div><div class="sidebar-section-children"><a href="module-storage_gun-auth.GunAuth.html">GunAuth</a></div><div class="sidebar-section-children"><a href="module-storage_gun-auth-GunAuth.html">GunAuth</a></div><div class="sidebar-section-children"><a href="module-storage_gun-references.GunReferenceHandler.html">GunReferenceHandler</a></div><div class="sidebar-section-children"><a href="module-storage_gun-references-GunReferenceHandler.html">GunReferenceHandler</a></div><div class="sidebar-section-children"><a href="module-storage_gun-schema.GunSchemaValidator.html">GunSchemaValidator</a></div><div class="sidebar-section-children"><a href="module-storage_gun-schema-GunSchemaValidator.html">GunSchemaValidator</a></div><div class="sidebar-section-children"><a href="module-storage_indexeddb-storage.IndexedDBStorage.html">IndexedDBStorage</a></div><div class="sidebar-section-children"><a href="module-storage_indexeddb-storage-IndexedDBStorage.html">IndexedDBStorage</a></div><div class="sidebar-section-children"><a href="module-storage_memory-storage.MemoryStorage.html">MemoryStorage</a></div><div class="sidebar-section-children"><a href="module-storage_memory-storage-MemoryStorage.html">MemoryStorage</a></div><div class="sidebar-section-children"><a href="module-storage_migration.MigrationTool.html">MigrationTool</a></div><div class="sidebar-section-children"><a href="module-storage_migration-MigrationTool.html">MigrationTool</a></div><div class="sidebar-section-children"><a href="module-storage_nostr-client.NostrClient.html">NostrClient</a></div><div class="sidebar-section-children"><a href="module-storage_nostr-client-LRUCache.html">LRUCache</a></div><div class="sidebar-section-children"><a href="module-storage_nostr-client-NostrClient.html">NostrClient</a></div><div class="sidebar-section-children"><a href="module-storage_outbox-queue.OutboxQueue.html">OutboxQueue</a></div><div class="sidebar-section-children"><a href="module-storage_outbox-queue-OutboxQueue.html">OutboxQueue</a></div><div class="sidebar-section-children"><a href="module-storage_persistent-storage-PersistentStorage.html">PersistentStorage</a></div><div class="sidebar-section-children"><a href="module-storage_sync-service.SyncService.html">SyncService</a></div><div class="sidebar-section-children"><a href="module-storage_sync-service-SyncService.html">SyncService</a></div><div class="sidebar-section-children"><a href="module-subscriptions_manager.SubscriptionRegistry.html">SubscriptionRegistry</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-global"><div>Global</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="global.html#FederationRequestPayload">FederationRequestPayload</a></div><div class="sidebar-section-children"><a href="global.html#FederationResponsePayload">FederationResponsePayload</a></div><div class="sidebar-section-children"><a href="global.html#acceptFederationRequest">acceptFederationRequest</a></div><div class="sidebar-section-children"><a href="global.html#acceptFederationRequest">acceptFederationRequest</a></div><div class="sidebar-section-children"><a href="global.html#addFederatedPartner">addFederatedPartner</a></div><div class="sidebar-section-children"><a href="global.html#cleanupExpiredCapabilities">cleanupExpiredCapabilities</a></div><div class="sidebar-section-children"><a href="global.html#createFederationRequest">createFederationRequest</a></div><div class="sidebar-section-children"><a href="global.html#createFederationResponse">createFederationResponse</a></div><div class="sidebar-section-children"><a href="global.html#declineFederationRequest">declineFederationRequest</a></div><div class="sidebar-section-children"><a href="global.html#getCapabilityForAuthor">getCapabilityForAuthor</a></div><div class="sidebar-section-children"><a href="global.html#getFederatedAuthors">getFederatedAuthors</a></div><div class="sidebar-section-children"><a href="global.html#getFederatedAuthorsForScope">getFederatedAuthorsForScope</a></div><div class="sidebar-section-children"><a href="global.html#getFederatedPartner">getFederatedPartner</a></div><div class="sidebar-section-children"><a href="global.html#getFederationRegistry">getFederationRegistry</a></div><div class="sidebar-section-children"><a href="global.html#getPendingFederationRequests">getPendingFederationRequests</a></div><div class="sidebar-section-children"><a href="global.html#initiateFederationHandshake">initiateFederationHandshake</a></div><div class="sidebar-section-children"><a href="global.html#isFederationRequest">isFederationRequest</a></div><div class="sidebar-section-children"><a href="global.html#isFederationResponse">isFederationResponse</a></div><div class="sidebar-section-children"><a href="global.html#rejectFederationRequest">rejectFederationRequest</a></div><div class="sidebar-section-children"><a href="global.html#removeFederatedPartner">removeFederatedPartner</a></div><div class="sidebar-section-children"><a href="global.html#revokeOutboundCapability">revokeOutboundCapability</a></div><div class="sidebar-section-children"><a href="global.html#saveFederationRegistry">saveFederationRegistry</a></div><div class="sidebar-section-children"><a href="global.html#sendFederationRequest">sendFederationRequest</a></div><div class="sidebar-section-children"><a href="global.html#sendFederationRequest">sendFederationRequest</a></div><div class="sidebar-section-children"><a href="global.html#sendFederationResponse">sendFederationResponse</a></div><div class="sidebar-section-children"><a href="global.html#storeInboundCapability">storeInboundCapability</a></div><div class="sidebar-section-children"><a href="global.html#storeOutboundCapability">storeOutboundCapability</a></div><div class="sidebar-section-children"><a href="global.html#subscribeFederationAcceptances">subscribeFederationAcceptances</a></div><div class="sidebar-section-children"><a href="global.html#subscribeFederationDeclines">subscribeFederationDeclines</a></div><div class="sidebar-section-children"><a href="global.html#subscribeFederationRequests">subscribeFederationRequests</a></div><div class="sidebar-section-children"><a href="global.html#subscribeToFederationDMs">subscribeToFederationDMs</a></div><div class="sidebar-section-children"><a href="global.html#updateDiscoverySettings">updateDiscoverySettings</a></div></div></div><div class="mobile-navbar-actions"><div class="navbar-right-item"><button class="icon-button search-button" aria-label="open-search"><svg><use xlink:href="#search-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button theme-toggle" aria-label="toggle-theme"><svg><use class="theme-svg-use" xlink:href="#light-theme-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button font-size" aria-label="change-font-size"><svg><use xlink:href="#font-size-icon"></use></svg></button></div></div></div></div><script type="text/javascript" src="scripts/core.min.js"></script><script src="scripts/search.min.js" defer="defer"></script><script src="scripts/third-party/fuse.js" defer="defer"></script><script type="text/javascript">var tocbotInstance=tocbot.init({tocSelector:"#eed4d2a0bfd64539bb9df78095dec881",contentSelector:".main-content",headingSelector:"h1, h2, h3",hasInnerContainers:!0,scrollContainer:".main-content",headingsOffset:130,onClick:bringLinkToView})</script></body></html>