@coasys/ad4m 0.12.0 → 0.13.0-postmessage-ws-proxy.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -25
- package/jest-setup.ts +1 -1
- package/lib/index.cjs +7444 -13939
- package/lib/index.js +5322 -11888
- package/lib/src/Ad4mClient.d.ts +9 -3
- package/lib/src/Ad4mClient.js +40 -13
- package/lib/src/Literal.js +6 -5
- package/lib/src/agent/Agent.js +26 -272
- package/lib/src/agent/AgentClient.d.ts +33 -21
- package/lib/src/agent/AgentClient.js +180 -373
- package/lib/src/agent/AgentStatus.js +2 -37
- package/lib/src/ai/AIClient.d.ts +12 -4
- package/lib/src/ai/AIClient.js +81 -285
- package/lib/src/ai/AITypes.d.ts +55 -0
- package/lib/src/ai/AITypes.js +18 -0
- package/lib/src/ai/Tasks.js +10 -133
- package/lib/src/apiClient.d.ts +53 -0
- package/lib/src/apiClient.js +234 -0
- package/lib/src/cache/PersistentCache.d.ts +40 -0
- package/lib/src/cache/PersistentCache.js +139 -0
- package/lib/src/expression/Expression.d.ts +1 -1
- package/lib/src/expression/Expression.js +13 -122
- package/lib/src/expression/ExpressionClient.d.ts +11 -3
- package/lib/src/expression/ExpressionClient.js +120 -75
- package/lib/src/expression/ExpressionRef.js +4 -27
- package/lib/src/generated/api/AIModelLoadingStatus.d.ts +7 -0
- package/lib/src/generated/api/AIModelLoadingStatus.js +2 -0
- package/lib/src/generated/api/AddLinkExpressionRequest.d.ts +6 -0
- package/lib/src/generated/api/AddLinkExpressionRequest.js +1 -0
- package/lib/src/generated/api/AddLinkRequest.d.ts +6 -0
- package/lib/src/generated/api/AddLinkRequest.js +1 -0
- package/lib/src/generated/api/AddLinksBulkRequest.d.ts +6 -0
- package/lib/src/generated/api/AddLinksBulkRequest.js +1 -0
- package/lib/src/generated/api/AddSdnaRequest.d.ts +6 -0
- package/lib/src/generated/api/AddSdnaRequest.js +2 -0
- package/lib/src/generated/api/ApplyTemplateRequest.d.ts +4 -0
- package/lib/src/generated/api/ApplyTemplateRequest.js +2 -0
- package/lib/src/generated/api/AuthInfoInput.d.ts +10 -0
- package/lib/src/generated/api/AuthInfoInput.js +1 -0
- package/lib/src/generated/api/CapabilityInput.d.ts +5 -0
- package/lib/src/generated/api/CapabilityInput.js +1 -0
- package/lib/src/generated/api/CommitBatchRequest.d.ts +3 -0
- package/lib/src/generated/api/CommitBatchRequest.js +2 -0
- package/lib/src/generated/api/ComputeLogEntry.d.ts +9 -0
- package/lib/src/generated/api/ComputeLogEntry.js +2 -0
- package/lib/src/generated/api/CreateExpressionRequest.d.ts +4 -0
- package/lib/src/generated/api/CreateExpressionRequest.js +2 -0
- package/lib/src/generated/api/CreatePerspectiveRequest.d.ts +3 -0
- package/lib/src/generated/api/CreatePerspectiveRequest.js +2 -0
- package/lib/src/generated/api/CreateSubjectRequest.d.ts +6 -0
- package/lib/src/generated/api/CreateSubjectRequest.js +2 -0
- package/lib/src/generated/api/EmbedRequest.d.ts +4 -0
- package/lib/src/generated/api/EmbedRequest.js +2 -0
- package/lib/src/generated/api/EntanglementProofInput.d.ts +6 -0
- package/lib/src/generated/api/EntanglementProofInput.js +2 -0
- package/lib/src/generated/api/ExecuteCommandsRequest.d.ts +4 -0
- package/lib/src/generated/api/ExecuteCommandsRequest.js +2 -0
- package/lib/src/generated/api/ExportRequest.d.ts +5 -0
- package/lib/src/generated/api/ExportRequest.js +2 -0
- package/lib/src/generated/api/ExpressionManyRequest.d.ts +3 -0
- package/lib/src/generated/api/ExpressionManyRequest.js +2 -0
- package/lib/src/generated/api/ExpressionProof.d.ts +4 -0
- package/lib/src/generated/api/ExpressionProof.js +2 -0
- package/lib/src/generated/api/ExpressionProofInput.d.ts +6 -0
- package/lib/src/generated/api/ExpressionProofInput.js +2 -0
- package/lib/src/generated/api/FriendSendMessageRequest.d.ts +3 -0
- package/lib/src/generated/api/FriendSendMessageRequest.js +2 -0
- package/lib/src/generated/api/FriendsListRequest.d.ts +3 -0
- package/lib/src/generated/api/FriendsListRequest.js +2 -0
- package/lib/src/generated/api/GenerateAgentRequest.d.ts +3 -0
- package/lib/src/generated/api/GenerateAgentRequest.js +2 -0
- package/lib/src/generated/api/GenerateJwtRequest.d.ts +4 -0
- package/lib/src/generated/api/GenerateJwtRequest.js +2 -0
- package/lib/src/generated/api/GetSubjectDataRequest.d.ts +4 -0
- package/lib/src/generated/api/GetSubjectDataRequest.js +2 -0
- package/lib/src/generated/api/ImportAgentRequest.d.ts +6 -0
- package/lib/src/generated/api/ImportAgentRequest.js +2 -0
- package/lib/src/generated/api/ImportRequest.d.ts +4 -0
- package/lib/src/generated/api/ImportRequest.js +2 -0
- package/lib/src/generated/api/JoinNeighbourhoodRequest.d.ts +3 -0
- package/lib/src/generated/api/JoinNeighbourhoodRequest.js +2 -0
- package/lib/src/generated/api/LanguageMetaInput.d.ts +6 -0
- package/lib/src/generated/api/LanguageMetaInput.js +2 -0
- package/lib/src/generated/api/Link.d.ts +5 -0
- package/lib/src/generated/api/Link.js +2 -0
- package/lib/src/generated/api/LinkExpression.d.ts +10 -0
- package/lib/src/generated/api/LinkExpression.js +1 -0
- package/lib/src/generated/api/LinkExpressionInput.d.ts +10 -0
- package/lib/src/generated/api/LinkExpressionInput.js +1 -0
- package/lib/src/generated/api/LinkInput.d.ts +5 -0
- package/lib/src/generated/api/LinkInput.js +2 -0
- package/lib/src/generated/api/LinkLanguageTemplatesRequest.d.ts +3 -0
- package/lib/src/generated/api/LinkLanguageTemplatesRequest.js +2 -0
- package/lib/src/generated/api/LinkMutations.d.ts +6 -0
- package/lib/src/generated/api/LinkMutations.js +1 -0
- package/lib/src/generated/api/LinkStatus.d.ts +1 -0
- package/lib/src/generated/api/LinkStatus.js +2 -0
- package/lib/src/generated/api/LockAgentRequest.d.ts +3 -0
- package/lib/src/generated/api/LockAgentRequest.js +2 -0
- package/lib/src/generated/api/ModelType.d.ts +1 -0
- package/lib/src/generated/api/ModelType.js +2 -0
- package/lib/src/generated/api/NotificationInput.d.ts +10 -0
- package/lib/src/generated/api/NotificationInput.js +2 -0
- package/lib/src/generated/api/OpenLinkRequest.d.ts +3 -0
- package/lib/src/generated/api/OpenLinkRequest.js +2 -0
- package/lib/src/generated/api/PermitCapabilityRequest.d.ts +3 -0
- package/lib/src/generated/api/PermitCapabilityRequest.js +2 -0
- package/lib/src/generated/api/PerspectiveInput.d.ts +4 -0
- package/lib/src/generated/api/PerspectiveInput.js +1 -0
- package/lib/src/generated/api/PromptRequest.d.ts +4 -0
- package/lib/src/generated/api/PromptRequest.js +2 -0
- package/lib/src/generated/api/PublishLanguageRequest.d.ts +5 -0
- package/lib/src/generated/api/PublishLanguageRequest.js +1 -0
- package/lib/src/generated/api/PublishNeighbourhoodRequest.d.ts +6 -0
- package/lib/src/generated/api/PublishNeighbourhoodRequest.js +1 -0
- package/lib/src/generated/api/QueryRequest.d.ts +7 -0
- package/lib/src/generated/api/QueryRequest.js +2 -0
- package/lib/src/generated/api/RemoveLinkRequest.d.ts +5 -0
- package/lib/src/generated/api/RemoveLinkRequest.js +1 -0
- package/lib/src/generated/api/RemoveLinksBulkRequest.d.ts +5 -0
- package/lib/src/generated/api/RemoveLinksBulkRequest.js +1 -0
- package/lib/src/generated/api/ResourceInput.d.ts +4 -0
- package/lib/src/generated/api/ResourceInput.js +2 -0
- package/lib/src/generated/api/SetDefaultModelRequest.d.ts +4 -0
- package/lib/src/generated/api/SetDefaultModelRequest.js +1 -0
- package/lib/src/generated/api/SetFreeHostingEnabledRequest.d.ts +3 -0
- package/lib/src/generated/api/SetFreeHostingEnabledRequest.js +2 -0
- package/lib/src/generated/api/SetMultiUserRequest.d.ts +3 -0
- package/lib/src/generated/api/SetMultiUserRequest.js +2 -0
- package/lib/src/generated/api/SetStatusRequest.d.ts +3 -0
- package/lib/src/generated/api/SetStatusRequest.js +2 -0
- package/lib/src/generated/api/SignMessageRequest.d.ts +3 -0
- package/lib/src/generated/api/SignMessageRequest.js +2 -0
- package/lib/src/generated/api/TrustedAgentsRequest.d.ts +3 -0
- package/lib/src/generated/api/TrustedAgentsRequest.js +2 -0
- package/lib/src/generated/api/UnlockAgentRequest.d.ts +4 -0
- package/lib/src/generated/api/UnlockAgentRequest.js +2 -0
- package/lib/src/generated/api/UpdateLinkRequest.d.ts +7 -0
- package/lib/src/generated/api/UpdateLinkRequest.js +1 -0
- package/lib/src/generated/api/UpdatePerspectiveRequest.d.ts +3 -0
- package/lib/src/generated/api/UpdatePerspectiveRequest.js +2 -0
- package/lib/src/generated/api/UserStatistics.d.ts +9 -0
- package/lib/src/generated/api/UserStatistics.js +2 -0
- package/lib/src/generated/api/VerificationRequestResult.d.ts +6 -0
- package/lib/src/generated/api/VerificationRequestResult.js +2 -0
- package/lib/src/generated/api/VerifySignatureRequest.d.ts +5 -0
- package/lib/src/generated/api/VerifySignatureRequest.js +2 -0
- package/lib/src/generated/api/WriteSettingsRequest.d.ts +3 -0
- package/lib/src/generated/api/WriteSettingsRequest.js +2 -0
- package/lib/src/generated/api/index.d.ts +42 -0
- package/lib/src/generated/api/index.js +7 -0
- package/lib/src/index.d.ts +7 -2
- package/lib/src/index.js +7 -2
- package/lib/src/jestSetup.d.ts +0 -1
- package/lib/src/jestSetup.js +1 -1
- package/lib/src/language/Icon.js +2 -21
- package/lib/src/language/Language.d.ts +26 -176
- package/lib/src/language/Language.js +32 -72
- package/lib/src/language/LanguageClient.d.ts +2 -2
- package/lib/src/language/LanguageClient.js +15 -105
- package/lib/src/language/LanguageHandle.js +2 -41
- package/lib/src/language/LanguageMeta.js +4 -75
- package/lib/src/language/LanguageRef.js +2 -25
- package/lib/src/links/Links.js +14 -111
- package/lib/src/model/Ad4mModel.d.ts +150 -62
- package/lib/src/model/Ad4mModel.js +689 -417
- package/lib/src/model/Ad4mModel.test.js +1434 -688
- package/lib/src/model/ModelQueryBuilder.d.ts +59 -38
- package/lib/src/model/ModelQueryBuilder.js +317 -153
- package/lib/src/model/Subject.js +6 -6
- package/lib/src/model/decorators.d.ts +36 -8
- package/lib/src/model/decorators.js +41 -14
- package/lib/src/model/hydration-batch.d.ts +34 -0
- package/lib/src/model/hydration-batch.js +147 -0
- package/lib/src/model/hydration-batching.test.d.ts +7 -0
- package/lib/src/model/hydration-batching.test.js +456 -0
- package/lib/src/model/hydration.d.ts +3 -92
- package/lib/src/model/hydration.js +3 -691
- package/lib/src/model/index.d.ts +3 -4
- package/lib/src/model/index.js +3 -4
- package/lib/src/model/json-schema.js +2 -2
- package/lib/src/model/model-manifest.d.ts +41 -0
- package/lib/src/model/model-manifest.js +11 -0
- package/lib/src/model/query-cache.d.ts +30 -0
- package/lib/src/model/query-cache.js +66 -0
- package/lib/src/model/query-cache.test.d.ts +1 -0
- package/lib/src/model/query-cache.test.js +43 -0
- package/lib/src/model/query-common.d.ts +1 -1
- package/lib/src/model/query-common.js +1 -1
- package/lib/src/model/query-sparql-batch.d.ts +17 -0
- package/lib/src/model/query-sparql-batch.js +260 -0
- package/lib/src/model/query-sparql.d.ts +51 -0
- package/lib/src/model/query-sparql.js +466 -0
- package/lib/src/model/query-sparql.test.d.ts +1 -0
- package/lib/src/model/query-sparql.test.js +312 -0
- package/lib/src/model/{surreal-utils.d.ts → query-utils.d.ts} +13 -9
- package/lib/src/model/query-utils.js +189 -0
- package/lib/src/model/relation-filtering.test.js +15 -15
- package/lib/src/model/sdna.js +1 -1
- package/lib/src/model/shacl-gen.js +46 -18
- package/lib/src/model/subscription-delta.test.d.ts +24 -0
- package/lib/src/model/subscription-delta.test.js +180 -0
- package/lib/src/model/subscription-pool.d.ts +39 -0
- package/lib/src/model/subscription-pool.js +165 -0
- package/lib/src/model/types.d.ts +60 -5
- package/lib/src/model/types.js +5 -2
- package/lib/src/neighbourhood/Neighbourhood.js +4 -32
- package/lib/src/neighbourhood/NeighbourhoodClient.d.ts +3 -3
- package/lib/src/neighbourhood/NeighbourhoodClient.js +40 -203
- package/lib/src/perspectives/LinkQuery.js +2 -42
- package/lib/src/perspectives/Perspective.d.ts +1 -1
- package/lib/src/perspectives/Perspective.js +10 -52
- package/lib/src/perspectives/PerspectiveClient.d.ts +22 -32
- package/lib/src/perspectives/PerspectiveClient.js +189 -454
- package/lib/src/perspectives/PerspectiveClient.test.d.ts +1 -0
- package/lib/src/perspectives/PerspectiveClient.test.js +224 -0
- package/lib/src/perspectives/PerspectiveDiff.js +4 -31
- package/lib/src/perspectives/PerspectiveHandle.js +3 -43
- package/lib/src/perspectives/PerspectiveProxy.d.ts +156 -78
- package/lib/src/perspectives/PerspectiveProxy.js +474 -389
- package/lib/src/perspectives/PerspectiveResolver.d.ts +0 -1
- package/lib/src/perspectives/PerspectiveResolver.js +0 -11
- package/lib/src/perspectives/WakerSubscriptionManager.d.ts +3 -3
- package/lib/src/perspectives/WakerSubscriptionManager.js +12 -12
- package/lib/src/runtime/RuntimeClient.d.ts +34 -6
- package/lib/src/runtime/RuntimeClient.js +131 -362
- package/lib/src/runtime/RuntimeResolver.d.ts +28 -1
- package/lib/src/runtime/RuntimeResolver.js +197 -4
- package/lib/src/runtime/RuntimeTypes.d.ts +101 -0
- package/lib/src/runtime/RuntimeTypes.js +45 -0
- package/lib/src/schema.gql +27 -1
- package/lib/src/shacl/SHACLFlow.d.ts +1 -1
- package/lib/src/shacl/SHACLFlow.js +9 -9
- package/lib/src/shacl/SHACLShape.d.ts +8 -1
- package/lib/src/shacl/SHACLShape.js +57 -38
- package/lib/src/shacl/SHACLShape.test.js +82 -0
- package/lib/src/typeDefs.js +3 -602
- package/lib/src/utils.d.ts +6 -6
- package/lib/src/utils.js +6 -6
- package/package.json +6 -18
- package/rollup.config.js +0 -7
- package/src/Ad4mClient.test.ts +1192 -1288
- package/src/Ad4mClient.ts +46 -15
- package/src/Literal.test.ts +10 -5
- package/src/Literal.ts +6 -5
- package/src/agent/Agent.ts +0 -99
- package/src/agent/AgentClient.ts +238 -465
- package/src/agent/AgentStatus.ts +0 -12
- package/src/ai/AIClient.ts +96 -296
- package/src/ai/AITypes.ts +66 -0
- package/src/ai/Tasks.ts +0 -52
- package/src/apiClient.ts +287 -0
- package/src/cache/PersistentCache.ts +145 -0
- package/src/cache/cache.test.ts +713 -0
- package/src/expression/Expression.ts +3 -43
- package/src/expression/ExpressionClient.ts +148 -77
- package/src/expression/ExpressionRef.ts +2 -8
- package/src/generated/api/AIModelLoadingStatus.ts +3 -0
- package/src/generated/api/AddLinkExpressionRequest.ts +4 -0
- package/src/generated/api/AddLinkRequest.ts +4 -0
- package/src/generated/api/AddLinksBulkRequest.ts +4 -0
- package/src/generated/api/AddSdnaRequest.ts +3 -0
- package/src/generated/api/ApplyTemplateRequest.ts +3 -0
- package/src/generated/api/AuthInfoInput.ts +4 -0
- package/src/generated/api/CapabilityInput.ts +4 -0
- package/src/generated/api/CommitBatchRequest.ts +3 -0
- package/src/generated/api/ComputeLogEntry.ts +3 -0
- package/src/generated/api/CreateExpressionRequest.ts +3 -0
- package/src/generated/api/CreatePerspectiveRequest.ts +3 -0
- package/src/generated/api/CreateSubjectRequest.ts +3 -0
- package/src/generated/api/EmbedRequest.ts +3 -0
- package/src/generated/api/EntanglementProofInput.ts +3 -0
- package/src/generated/api/ExecuteCommandsRequest.ts +3 -0
- package/src/generated/api/ExportRequest.ts +3 -0
- package/src/generated/api/ExpressionManyRequest.ts +3 -0
- package/src/generated/api/ExpressionProof.ts +3 -0
- package/src/generated/api/ExpressionProofInput.ts +3 -0
- package/src/generated/api/FriendSendMessageRequest.ts +3 -0
- package/src/generated/api/FriendsListRequest.ts +3 -0
- package/src/generated/api/GenerateAgentRequest.ts +3 -0
- package/src/generated/api/GenerateJwtRequest.ts +3 -0
- package/src/generated/api/GetSubjectDataRequest.ts +3 -0
- package/src/generated/api/ImportAgentRequest.ts +3 -0
- package/src/generated/api/ImportRequest.ts +3 -0
- package/src/generated/api/JoinNeighbourhoodRequest.ts +3 -0
- package/src/generated/api/LanguageMetaInput.ts +3 -0
- package/src/generated/api/Link.ts +3 -0
- package/src/generated/api/LinkExpression.ts +6 -0
- package/src/generated/api/LinkExpressionInput.ts +6 -0
- package/src/generated/api/LinkInput.ts +3 -0
- package/src/generated/api/LinkLanguageTemplatesRequest.ts +3 -0
- package/src/generated/api/LinkMutations.ts +5 -0
- package/src/generated/api/LinkStatus.ts +3 -0
- package/src/generated/api/LockAgentRequest.ts +3 -0
- package/src/generated/api/ModelType.ts +3 -0
- package/src/generated/api/NotificationInput.ts +3 -0
- package/src/generated/api/OpenLinkRequest.ts +3 -0
- package/src/generated/api/PermitCapabilityRequest.ts +3 -0
- package/src/generated/api/PerspectiveInput.ts +4 -0
- package/src/generated/api/PromptRequest.ts +3 -0
- package/src/generated/api/PublishLanguageRequest.ts +4 -0
- package/src/generated/api/PublishNeighbourhoodRequest.ts +4 -0
- package/src/generated/api/QueryRequest.ts +6 -0
- package/src/generated/api/RemoveLinkRequest.ts +4 -0
- package/src/generated/api/RemoveLinksBulkRequest.ts +4 -0
- package/src/generated/api/ResourceInput.ts +3 -0
- package/src/generated/api/SetDefaultModelRequest.ts +4 -0
- package/src/generated/api/SetFreeHostingEnabledRequest.ts +3 -0
- package/src/generated/api/SetMultiUserRequest.ts +3 -0
- package/src/generated/api/SetStatusRequest.ts +3 -0
- package/src/generated/api/SignMessageRequest.ts +3 -0
- package/src/generated/api/TrustedAgentsRequest.ts +3 -0
- package/src/generated/api/UnlockAgentRequest.ts +3 -0
- package/src/generated/api/UpdateLinkRequest.ts +5 -0
- package/src/generated/api/UpdatePerspectiveRequest.ts +3 -0
- package/src/generated/api/UserStatistics.ts +3 -0
- package/src/generated/api/VerificationRequestResult.ts +3 -0
- package/src/generated/api/VerifySignatureRequest.ts +3 -0
- package/src/generated/api/WriteSettingsRequest.ts +3 -0
- package/src/generated/api/index.ts +49 -0
- package/src/index.ts +7 -2
- package/src/jestSetup.ts +1 -1
- package/src/language/Icon.ts +0 -4
- package/src/language/Language.ts +51 -248
- package/src/language/LanguageClient.ts +21 -132
- package/src/language/LanguageHandle.ts +0 -14
- package/src/language/LanguageMeta.ts +0 -29
- package/src/language/LanguageRef.ts +0 -7
- package/src/links/Links.ts +0 -37
- package/src/model/Ad4mModel.test.ts +1690 -777
- package/src/model/Ad4mModel.ts +749 -477
- package/src/model/ModelQueryBuilder.ts +356 -171
- package/src/model/decorators.ts +71 -22
- package/src/model/hydration.ts +3 -772
- package/src/model/index.ts +3 -4
- package/src/model/json-schema.ts +2 -2
- package/src/model/query-cache.test.ts +54 -0
- package/src/model/query-cache.ts +79 -0
- package/src/model/query-common.ts +1 -1
- package/src/model/query-sparql.test.ts +376 -0
- package/src/model/query-sparql.ts +504 -0
- package/src/model/query-utils.ts +209 -0
- package/src/model/relation-filtering.test.ts +15 -15
- package/src/model/sdna.ts +1 -1
- package/src/model/shacl-gen.ts +47 -17
- package/src/model/types.ts +65 -5
- package/src/neighbourhood/Neighbourhood.ts +0 -9
- package/src/neighbourhood/NeighbourhoodClient.ts +42 -207
- package/src/neighbourhood/NeighbourhoodProxy.test.ts +34 -36
- package/src/perspectives/LinkQuery.ts +0 -15
- package/src/perspectives/Perspective.ts +1 -12
- package/src/perspectives/PerspectiveClient.test.ts +262 -0
- package/src/perspectives/PerspectiveClient.ts +254 -468
- package/src/perspectives/PerspectiveDiff.ts +0 -8
- package/src/perspectives/PerspectiveHandle.ts +1 -12
- package/src/perspectives/PerspectiveProxy.test.ts +125 -0
- package/src/perspectives/PerspectiveProxy.ts +522 -434
- package/src/perspectives/WakerSubscriptionManager.ts +13 -13
- package/src/runtime/RuntimeClient.ts +166 -369
- package/src/runtime/RuntimeTypes.ts +144 -0
- package/src/shacl/SHACLFlow.ts +9 -9
- package/src/shacl/SHACLShape.test.ts +94 -0
- package/src/shacl/SHACLShape.ts +66 -39
- package/src/typeDefs.ts +3 -5
- package/src/utils.ts +6 -6
- package/tsconfig.json +3 -7
- package/lib/src/model/query-surreal.d.ts +0 -44
- package/lib/src/model/query-surreal.js +0 -249
- package/lib/src/model/surreal-utils.js +0 -128
- package/shims/reflect-metadata.ts +0 -0
- package/shims/type-graphql.ts +0 -75
- package/src/PubSub.ts +0 -17
- package/src/agent/AgentResolver.ts +0 -263
- package/src/ai/AIResolver.ts +0 -372
- package/src/buildSchema.ts +0 -43
- package/src/expression/ExpressionResolver.ts +0 -64
- package/src/language/LanguageContext.ts +0 -37
- package/src/language/LanguageResolver.ts +0 -98
- package/src/model/Subject.ts +0 -159
- package/src/model/prolog-facts.ts +0 -145
- package/src/model/query-prolog.ts +0 -148
- package/src/model/query-surreal.ts +0 -280
- package/src/model/surreal-utils.ts +0 -147
- package/src/neighbourhood/NeighbourhoodResolver.ts +0 -100
- package/src/perspectives/PerspectiveResolver.ts +0 -372
- package/src/runtime/RuntimeResolver.ts +0 -617
- package/src/unwrapApolloResult.ts +0 -16
- package/tsconfig-browser.json +0 -82
package/lib/src/Ad4mClient.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ApolloClient } from '@apollo/client/core';
|
|
2
1
|
import { AgentClient } from './agent/AgentClient';
|
|
3
2
|
import { LanguageClient } from './language/LanguageClient';
|
|
4
3
|
import { NeighbourhoodClient } from './neighbourhood/NeighbourhoodClient';
|
|
@@ -7,7 +6,7 @@ import { RuntimeClient } from './runtime/RuntimeClient';
|
|
|
7
6
|
import { ExpressionClient } from './expression/ExpressionClient';
|
|
8
7
|
import { AIClient } from './ai/AIClient';
|
|
9
8
|
/**
|
|
10
|
-
* Client for the Ad4m interface wrapping
|
|
9
|
+
* Client for the Ad4m interface wrapping WebSocket RPC calls
|
|
11
10
|
* for convenient use in user facing code.
|
|
12
11
|
*
|
|
13
12
|
* Aggregates the six sub-clients:
|
|
@@ -17,7 +16,9 @@ import { AIClient } from './ai/AIClient';
|
|
|
17
16
|
*/
|
|
18
17
|
export declare class Ad4mClient {
|
|
19
18
|
#private;
|
|
20
|
-
constructor(
|
|
19
|
+
constructor(baseUrl: string, token?: string, subscribe?: boolean, options?: {
|
|
20
|
+
webSocketImpl?: new (url: string) => WebSocket;
|
|
21
|
+
});
|
|
21
22
|
get agent(): AgentClient;
|
|
22
23
|
get expression(): ExpressionClient;
|
|
23
24
|
get languages(): LanguageClient;
|
|
@@ -25,4 +26,9 @@ export declare class Ad4mClient {
|
|
|
25
26
|
get perspective(): PerspectiveClient;
|
|
26
27
|
get runtime(): RuntimeClient;
|
|
27
28
|
get ai(): AIClient;
|
|
29
|
+
/** Start event subscriptions (agent-updated, agent-status-changed, apps-changed).
|
|
30
|
+
* Safe to call if subscriptions were deferred at construction (subscribe=false). */
|
|
31
|
+
startSubscriptions(): void;
|
|
32
|
+
/** Close all event connections and clear in-memory caches */
|
|
33
|
+
close(): void;
|
|
28
34
|
}
|
package/lib/src/Ad4mClient.js
CHANGED
|
@@ -9,7 +9,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
9
9
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
10
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
11
|
};
|
|
12
|
-
var
|
|
12
|
+
var _Ad4mClient_baseUrl, _Ad4mClient_token, _Ad4mClient_apiClient, _Ad4mClient_agentClient, _Ad4mClient_expressionClient, _Ad4mClient_languageClient, _Ad4mClient_neighbourhoodClient, _Ad4mClient_perspectiveClient, _Ad4mClient_runtimeClient, _Ad4mClient_aiClient;
|
|
13
13
|
import { AgentClient } from './agent/AgentClient';
|
|
14
14
|
import { LanguageClient } from './language/LanguageClient';
|
|
15
15
|
import { NeighbourhoodClient } from './neighbourhood/NeighbourhoodClient';
|
|
@@ -17,8 +17,10 @@ import { PerspectiveClient } from './perspectives/PerspectiveClient';
|
|
|
17
17
|
import { RuntimeClient } from './runtime/RuntimeClient';
|
|
18
18
|
import { ExpressionClient } from './expression/ExpressionClient';
|
|
19
19
|
import { AIClient } from './ai/AIClient';
|
|
20
|
+
import { ApiClient } from './apiClient';
|
|
21
|
+
import { Ad4mModel } from './model/Ad4mModel';
|
|
20
22
|
/**
|
|
21
|
-
* Client for the Ad4m interface wrapping
|
|
23
|
+
* Client for the Ad4m interface wrapping WebSocket RPC calls
|
|
22
24
|
* for convenient use in user facing code.
|
|
23
25
|
*
|
|
24
26
|
* Aggregates the six sub-clients:
|
|
@@ -27,8 +29,10 @@ import { AIClient } from './ai/AIClient';
|
|
|
27
29
|
* for the respective functionality.
|
|
28
30
|
*/
|
|
29
31
|
export class Ad4mClient {
|
|
30
|
-
constructor(
|
|
31
|
-
|
|
32
|
+
constructor(baseUrl, token, subscribe = true, options) {
|
|
33
|
+
_Ad4mClient_baseUrl.set(this, void 0);
|
|
34
|
+
_Ad4mClient_token.set(this, void 0);
|
|
35
|
+
_Ad4mClient_apiClient.set(this, void 0);
|
|
32
36
|
_Ad4mClient_agentClient.set(this, void 0);
|
|
33
37
|
_Ad4mClient_expressionClient.set(this, void 0);
|
|
34
38
|
_Ad4mClient_languageClient.set(this, void 0);
|
|
@@ -36,17 +40,28 @@ export class Ad4mClient {
|
|
|
36
40
|
_Ad4mClient_perspectiveClient.set(this, void 0);
|
|
37
41
|
_Ad4mClient_runtimeClient.set(this, void 0);
|
|
38
42
|
_Ad4mClient_aiClient.set(this, void 0);
|
|
39
|
-
__classPrivateFieldSet(this,
|
|
40
|
-
__classPrivateFieldSet(this,
|
|
41
|
-
__classPrivateFieldSet(this,
|
|
42
|
-
__classPrivateFieldSet(this,
|
|
43
|
-
__classPrivateFieldSet(this,
|
|
44
|
-
__classPrivateFieldSet(this,
|
|
45
|
-
__classPrivateFieldSet(this,
|
|
43
|
+
__classPrivateFieldSet(this, _Ad4mClient_baseUrl, baseUrl, "f");
|
|
44
|
+
__classPrivateFieldSet(this, _Ad4mClient_token, token, "f");
|
|
45
|
+
__classPrivateFieldSet(this, _Ad4mClient_apiClient, new ApiClient(baseUrl, token, options?.webSocketImpl), "f");
|
|
46
|
+
__classPrivateFieldSet(this, _Ad4mClient_agentClient, new AgentClient(baseUrl, token, subscribe, __classPrivateFieldGet(this, _Ad4mClient_apiClient, "f")), "f");
|
|
47
|
+
__classPrivateFieldSet(this, _Ad4mClient_expressionClient, new ExpressionClient(baseUrl, token, __classPrivateFieldGet(this, _Ad4mClient_apiClient, "f")), "f");
|
|
48
|
+
__classPrivateFieldSet(this, _Ad4mClient_languageClient, new LanguageClient(baseUrl, token, __classPrivateFieldGet(this, _Ad4mClient_apiClient, "f")), "f");
|
|
49
|
+
__classPrivateFieldSet(this, _Ad4mClient_neighbourhoodClient, new NeighbourhoodClient(baseUrl, token, __classPrivateFieldGet(this, _Ad4mClient_apiClient, "f")), "f");
|
|
50
|
+
__classPrivateFieldSet(this, _Ad4mClient_aiClient, new AIClient(baseUrl, token, subscribe, __classPrivateFieldGet(this, _Ad4mClient_apiClient, "f")), "f");
|
|
51
|
+
__classPrivateFieldSet(this, _Ad4mClient_perspectiveClient, new PerspectiveClient(baseUrl, token, subscribe, __classPrivateFieldGet(this, _Ad4mClient_apiClient, "f")), "f");
|
|
46
52
|
__classPrivateFieldGet(this, _Ad4mClient_perspectiveClient, "f").setExpressionClient(__classPrivateFieldGet(this, _Ad4mClient_expressionClient, "f"));
|
|
47
53
|
__classPrivateFieldGet(this, _Ad4mClient_perspectiveClient, "f").setNeighbourhoodClient(__classPrivateFieldGet(this, _Ad4mClient_neighbourhoodClient, "f"));
|
|
48
54
|
__classPrivateFieldGet(this, _Ad4mClient_perspectiveClient, "f").setAIClient(__classPrivateFieldGet(this, _Ad4mClient_aiClient, "f"));
|
|
49
|
-
__classPrivateFieldSet(this, _Ad4mClient_runtimeClient, new RuntimeClient(__classPrivateFieldGet(this,
|
|
55
|
+
__classPrivateFieldSet(this, _Ad4mClient_runtimeClient, new RuntimeClient(baseUrl, token, subscribe, __classPrivateFieldGet(this, _Ad4mClient_apiClient, "f")), "f");
|
|
56
|
+
// Register with AD4M DevTools if the bridge is installed (e.g. browser extension)
|
|
57
|
+
try {
|
|
58
|
+
const dt = globalThis.__AD4M_DEVTOOLS__;
|
|
59
|
+
if (dt) {
|
|
60
|
+
dt._client = this;
|
|
61
|
+
dt._Ad4mModel = Ad4mModel;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
catch { }
|
|
50
65
|
}
|
|
51
66
|
get agent() {
|
|
52
67
|
return __classPrivateFieldGet(this, _Ad4mClient_agentClient, "f");
|
|
@@ -69,5 +84,17 @@ export class Ad4mClient {
|
|
|
69
84
|
get ai() {
|
|
70
85
|
return __classPrivateFieldGet(this, _Ad4mClient_aiClient, "f");
|
|
71
86
|
}
|
|
87
|
+
/** Start event subscriptions (agent-updated, agent-status-changed, apps-changed).
|
|
88
|
+
* Safe to call if subscriptions were deferred at construction (subscribe=false). */
|
|
89
|
+
startSubscriptions() {
|
|
90
|
+
__classPrivateFieldGet(this, _Ad4mClient_agentClient, "f").subscribeAgentUpdated();
|
|
91
|
+
__classPrivateFieldGet(this, _Ad4mClient_agentClient, "f").subscribeAgentStatusChanged();
|
|
92
|
+
__classPrivateFieldGet(this, _Ad4mClient_agentClient, "f").subscribeAppsChanged();
|
|
93
|
+
}
|
|
94
|
+
/** Close all event connections and clear in-memory caches */
|
|
95
|
+
close() {
|
|
96
|
+
__classPrivateFieldGet(this, _Ad4mClient_agentClient, "f").clearByDidCache();
|
|
97
|
+
__classPrivateFieldGet(this, _Ad4mClient_apiClient, "f").closeAll();
|
|
98
|
+
}
|
|
72
99
|
}
|
|
73
|
-
|
|
100
|
+
_Ad4mClient_baseUrl = new WeakMap(), _Ad4mClient_token = new WeakMap(), _Ad4mClient_apiClient = new WeakMap(), _Ad4mClient_agentClient = new WeakMap(), _Ad4mClient_expressionClient = new WeakMap(), _Ad4mClient_languageClient = new WeakMap(), _Ad4mClient_neighbourhoodClient = new WeakMap(), _Ad4mClient_perspectiveClient = new WeakMap(), _Ad4mClient_runtimeClient = new WeakMap(), _Ad4mClient_aiClient = new WeakMap();
|
package/lib/src/Literal.js
CHANGED
|
@@ -20,8 +20,10 @@ export class Literal {
|
|
|
20
20
|
_Literal_url.set(this, void 0);
|
|
21
21
|
}
|
|
22
22
|
static fromUrl(url) {
|
|
23
|
-
if (!url || !url.startsWith("literal
|
|
23
|
+
if (!url || !url.startsWith("literal:"))
|
|
24
24
|
throw new Error("Can't create Literal from non-literal URL");
|
|
25
|
+
if (url.startsWith("literal://"))
|
|
26
|
+
throw new Error("literal:// format is no longer supported. Use literal: instead.");
|
|
25
27
|
const l = new Literal();
|
|
26
28
|
__classPrivateFieldSet(l, _Literal_url, url, "f");
|
|
27
29
|
return l;
|
|
@@ -51,17 +53,16 @@ export class Literal {
|
|
|
51
53
|
encoded = `json:${encodeRFC3986URIComponent(JSON.stringify(__classPrivateFieldGet(this, _Literal_literal, "f")))}`;
|
|
52
54
|
break;
|
|
53
55
|
}
|
|
54
|
-
return `literal
|
|
56
|
+
return `literal:${encoded}`;
|
|
55
57
|
}
|
|
56
58
|
get() {
|
|
57
59
|
if (__classPrivateFieldGet(this, _Literal_literal, "f"))
|
|
58
60
|
return __classPrivateFieldGet(this, _Literal_literal, "f");
|
|
59
61
|
if (!__classPrivateFieldGet(this, _Literal_url, "f"))
|
|
60
62
|
throw new Error("Can't render empty Literal");
|
|
61
|
-
if (!__classPrivateFieldGet(this, _Literal_url, "f").startsWith("literal
|
|
63
|
+
if (!__classPrivateFieldGet(this, _Literal_url, "f").startsWith("literal:"))
|
|
62
64
|
throw new Error("Can't render Literal from non-literal URL");
|
|
63
|
-
|
|
64
|
-
const body = __classPrivateFieldGet(this, _Literal_url, "f").substring(10);
|
|
65
|
+
const body = __classPrivateFieldGet(this, _Literal_url, "f").substring(8);
|
|
65
66
|
if (body.startsWith("string:")) {
|
|
66
67
|
return decodeURIComponent(body.substring(7));
|
|
67
68
|
}
|
package/lib/src/agent/Agent.js
CHANGED
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
};
|
|
10
|
-
import { Field, ObjectType, InputType } from "type-graphql";
|
|
11
1
|
import { Perspective } from "../perspectives/Perspective";
|
|
12
2
|
import { ExpressionGeneric } from "../expression/Expression";
|
|
13
3
|
/** AD4M's representation of an Agent
|
|
@@ -26,7 +16,7 @@ import { ExpressionGeneric } from "../expression/Expression";
|
|
|
26
16
|
* DIDs are resolved to Expressions that are objects of this class.
|
|
27
17
|
* Thus, this is how agents see (other) agents.
|
|
28
18
|
*/
|
|
29
|
-
|
|
19
|
+
export class Agent {
|
|
30
20
|
constructor(did, perspective) {
|
|
31
21
|
this.did = did;
|
|
32
22
|
if (perspective) {
|
|
@@ -36,31 +26,10 @@ let Agent = class Agent {
|
|
|
36
26
|
this.perspective = new Perspective();
|
|
37
27
|
}
|
|
38
28
|
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
], Agent.prototype, "did", void 0);
|
|
44
|
-
__decorate([
|
|
45
|
-
Field((type) => Perspective, { nullable: true }),
|
|
46
|
-
__metadata("design:type", Perspective)
|
|
47
|
-
], Agent.prototype, "perspective", void 0);
|
|
48
|
-
__decorate([
|
|
49
|
-
Field({ nullable: true }),
|
|
50
|
-
__metadata("design:type", String)
|
|
51
|
-
], Agent.prototype, "directMessageLanguage", void 0);
|
|
52
|
-
Agent = __decorate([
|
|
53
|
-
ObjectType(),
|
|
54
|
-
__metadata("design:paramtypes", [String, Perspective])
|
|
55
|
-
], Agent);
|
|
56
|
-
export { Agent };
|
|
57
|
-
let AgentExpression = class AgentExpression extends ExpressionGeneric(Agent) {
|
|
58
|
-
};
|
|
59
|
-
AgentExpression = __decorate([
|
|
60
|
-
ObjectType()
|
|
61
|
-
], AgentExpression);
|
|
62
|
-
export { AgentExpression };
|
|
63
|
-
let EntanglementProof = class EntanglementProof {
|
|
29
|
+
}
|
|
30
|
+
export class AgentExpression extends ExpressionGeneric(Agent) {
|
|
31
|
+
}
|
|
32
|
+
export class EntanglementProof {
|
|
64
33
|
constructor(did, didSigningKeyId, deviceKeyType, deviceKey, deviceKeySignedByDid, didSignedByDeviceKey) {
|
|
65
34
|
this.did = did;
|
|
66
35
|
this.didSigningKeyId = didSigningKeyId;
|
|
@@ -69,37 +38,8 @@ let EntanglementProof = class EntanglementProof {
|
|
|
69
38
|
this.deviceKeySignedByDid = deviceKeySignedByDid;
|
|
70
39
|
this.didSignedByDeviceKey = didSignedByDeviceKey;
|
|
71
40
|
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
Field(),
|
|
75
|
-
__metadata("design:type", String)
|
|
76
|
-
], EntanglementProof.prototype, "did", void 0);
|
|
77
|
-
__decorate([
|
|
78
|
-
Field(),
|
|
79
|
-
__metadata("design:type", String)
|
|
80
|
-
], EntanglementProof.prototype, "didSigningKeyId", void 0);
|
|
81
|
-
__decorate([
|
|
82
|
-
Field(),
|
|
83
|
-
__metadata("design:type", String)
|
|
84
|
-
], EntanglementProof.prototype, "deviceKeyType", void 0);
|
|
85
|
-
__decorate([
|
|
86
|
-
Field(),
|
|
87
|
-
__metadata("design:type", String)
|
|
88
|
-
], EntanglementProof.prototype, "deviceKey", void 0);
|
|
89
|
-
__decorate([
|
|
90
|
-
Field(),
|
|
91
|
-
__metadata("design:type", String)
|
|
92
|
-
], EntanglementProof.prototype, "deviceKeySignedByDid", void 0);
|
|
93
|
-
__decorate([
|
|
94
|
-
Field({ nullable: true }),
|
|
95
|
-
__metadata("design:type", String)
|
|
96
|
-
], EntanglementProof.prototype, "didSignedByDeviceKey", void 0);
|
|
97
|
-
EntanglementProof = __decorate([
|
|
98
|
-
ObjectType(),
|
|
99
|
-
__metadata("design:paramtypes", [String, String, String, String, String, String])
|
|
100
|
-
], EntanglementProof);
|
|
101
|
-
export { EntanglementProof };
|
|
102
|
-
let EntanglementProofInput = class EntanglementProofInput {
|
|
41
|
+
}
|
|
42
|
+
export class EntanglementProofInput {
|
|
103
43
|
constructor(did, didSigningKeyId, deviceKeyType, deviceKey, deviceKeySignedByDid, didSignedByDeviceKey) {
|
|
104
44
|
this.did = did;
|
|
105
45
|
this.didSigningKeyId = didSigningKeyId;
|
|
@@ -108,94 +48,26 @@ let EntanglementProofInput = class EntanglementProofInput {
|
|
|
108
48
|
this.deviceKeySignedByDid = deviceKeySignedByDid;
|
|
109
49
|
this.didSignedByDeviceKey = didSignedByDeviceKey;
|
|
110
50
|
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
Field(),
|
|
114
|
-
__metadata("design:type", String)
|
|
115
|
-
], EntanglementProofInput.prototype, "did", void 0);
|
|
116
|
-
__decorate([
|
|
117
|
-
Field(),
|
|
118
|
-
__metadata("design:type", String)
|
|
119
|
-
], EntanglementProofInput.prototype, "didSigningKeyId", void 0);
|
|
120
|
-
__decorate([
|
|
121
|
-
Field(),
|
|
122
|
-
__metadata("design:type", String)
|
|
123
|
-
], EntanglementProofInput.prototype, "deviceKeyType", void 0);
|
|
124
|
-
__decorate([
|
|
125
|
-
Field(),
|
|
126
|
-
__metadata("design:type", String)
|
|
127
|
-
], EntanglementProofInput.prototype, "deviceKey", void 0);
|
|
128
|
-
__decorate([
|
|
129
|
-
Field(),
|
|
130
|
-
__metadata("design:type", String)
|
|
131
|
-
], EntanglementProofInput.prototype, "deviceKeySignedByDid", void 0);
|
|
132
|
-
__decorate([
|
|
133
|
-
Field(),
|
|
134
|
-
__metadata("design:type", String)
|
|
135
|
-
], EntanglementProofInput.prototype, "didSignedByDeviceKey", void 0);
|
|
136
|
-
EntanglementProofInput = __decorate([
|
|
137
|
-
InputType(),
|
|
138
|
-
__metadata("design:paramtypes", [String, String, String, String, String, String])
|
|
139
|
-
], EntanglementProofInput);
|
|
140
|
-
export { EntanglementProofInput };
|
|
141
|
-
let AgentSignature = class AgentSignature {
|
|
51
|
+
}
|
|
52
|
+
export class AgentSignature {
|
|
142
53
|
constructor(signature, publicKey) {
|
|
143
54
|
this.signature = signature;
|
|
144
55
|
this.publicKey = publicKey;
|
|
145
56
|
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
Field(),
|
|
149
|
-
__metadata("design:type", String)
|
|
150
|
-
], AgentSignature.prototype, "signature", void 0);
|
|
151
|
-
__decorate([
|
|
152
|
-
Field(),
|
|
153
|
-
__metadata("design:type", String)
|
|
154
|
-
], AgentSignature.prototype, "publicKey", void 0);
|
|
155
|
-
AgentSignature = __decorate([
|
|
156
|
-
ObjectType(),
|
|
157
|
-
__metadata("design:paramtypes", [String, String])
|
|
158
|
-
], AgentSignature);
|
|
159
|
-
export { AgentSignature };
|
|
160
|
-
let Resource = class Resource {
|
|
57
|
+
}
|
|
58
|
+
export class Resource {
|
|
161
59
|
constructor(domain, pointers) {
|
|
162
60
|
this.domain = domain;
|
|
163
61
|
this.pointers = pointers;
|
|
164
62
|
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
Field(),
|
|
168
|
-
__metadata("design:type", String)
|
|
169
|
-
], Resource.prototype, "domain", void 0);
|
|
170
|
-
__decorate([
|
|
171
|
-
Field((type) => [String]),
|
|
172
|
-
__metadata("design:type", Array)
|
|
173
|
-
], Resource.prototype, "pointers", void 0);
|
|
174
|
-
Resource = __decorate([
|
|
175
|
-
ObjectType(),
|
|
176
|
-
__metadata("design:paramtypes", [String, Array])
|
|
177
|
-
], Resource);
|
|
178
|
-
export { Resource };
|
|
179
|
-
let Capability = class Capability {
|
|
63
|
+
}
|
|
64
|
+
export class Capability {
|
|
180
65
|
constructor(withF, can) {
|
|
181
66
|
this.with = withF;
|
|
182
67
|
this.can = can;
|
|
183
68
|
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
Field((type) => Resource),
|
|
187
|
-
__metadata("design:type", Resource)
|
|
188
|
-
], Capability.prototype, "with", void 0);
|
|
189
|
-
__decorate([
|
|
190
|
-
Field((type) => [String]),
|
|
191
|
-
__metadata("design:type", Array)
|
|
192
|
-
], Capability.prototype, "can", void 0);
|
|
193
|
-
Capability = __decorate([
|
|
194
|
-
ObjectType(),
|
|
195
|
-
__metadata("design:paramtypes", [Resource, Array])
|
|
196
|
-
], Capability);
|
|
197
|
-
export { Capability };
|
|
198
|
-
let AuthInfo = class AuthInfo {
|
|
69
|
+
}
|
|
70
|
+
export class AuthInfo {
|
|
199
71
|
constructor(appName, appDesc, appUrl, capabilities, appIconPath) {
|
|
200
72
|
this.appName = appName;
|
|
201
73
|
this.appDesc = appDesc;
|
|
@@ -203,100 +75,28 @@ let AuthInfo = class AuthInfo {
|
|
|
203
75
|
this.appUrl = appUrl;
|
|
204
76
|
this.capabilities = capabilities;
|
|
205
77
|
}
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
Field(),
|
|
209
|
-
__metadata("design:type", String)
|
|
210
|
-
], AuthInfo.prototype, "appName", void 0);
|
|
211
|
-
__decorate([
|
|
212
|
-
Field(),
|
|
213
|
-
__metadata("design:type", String)
|
|
214
|
-
], AuthInfo.prototype, "appDesc", void 0);
|
|
215
|
-
__decorate([
|
|
216
|
-
Field(),
|
|
217
|
-
__metadata("design:type", String)
|
|
218
|
-
], AuthInfo.prototype, "appUrl", void 0);
|
|
219
|
-
__decorate([
|
|
220
|
-
Field({ nullable: true }),
|
|
221
|
-
__metadata("design:type", String)
|
|
222
|
-
], AuthInfo.prototype, "appIconPath", void 0);
|
|
223
|
-
__decorate([
|
|
224
|
-
Field((type) => [Capability]),
|
|
225
|
-
__metadata("design:type", Array)
|
|
226
|
-
], AuthInfo.prototype, "capabilities", void 0);
|
|
227
|
-
AuthInfo = __decorate([
|
|
228
|
-
ObjectType(),
|
|
229
|
-
__metadata("design:paramtypes", [String, String, String, Array, String])
|
|
230
|
-
], AuthInfo);
|
|
231
|
-
export { AuthInfo };
|
|
232
|
-
let Apps = class Apps {
|
|
78
|
+
}
|
|
79
|
+
export class Apps {
|
|
233
80
|
constructor(requestId, auth, token, revoked) {
|
|
234
81
|
this.requestId = requestId;
|
|
235
82
|
this.auth = auth;
|
|
236
83
|
this.token = token;
|
|
237
84
|
this.revoked = revoked;
|
|
238
85
|
}
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
Field(),
|
|
242
|
-
__metadata("design:type", String)
|
|
243
|
-
], Apps.prototype, "requestId", void 0);
|
|
244
|
-
__decorate([
|
|
245
|
-
Field(),
|
|
246
|
-
__metadata("design:type", String)
|
|
247
|
-
], Apps.prototype, "token", void 0);
|
|
248
|
-
__decorate([
|
|
249
|
-
Field({ nullable: true }),
|
|
250
|
-
__metadata("design:type", Boolean)
|
|
251
|
-
], Apps.prototype, "revoked", void 0);
|
|
252
|
-
__decorate([
|
|
253
|
-
Field(),
|
|
254
|
-
__metadata("design:type", AuthInfo)
|
|
255
|
-
], Apps.prototype, "auth", void 0);
|
|
256
|
-
Apps = __decorate([
|
|
257
|
-
ObjectType(),
|
|
258
|
-
__metadata("design:paramtypes", [String, AuthInfo, String, Boolean])
|
|
259
|
-
], Apps);
|
|
260
|
-
export { Apps };
|
|
261
|
-
let ResourceInput = class ResourceInput {
|
|
86
|
+
}
|
|
87
|
+
export class ResourceInput {
|
|
262
88
|
constructor(domain, pointers) {
|
|
263
89
|
this.domain = domain;
|
|
264
90
|
this.pointers = pointers;
|
|
265
91
|
}
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
Field(),
|
|
269
|
-
__metadata("design:type", String)
|
|
270
|
-
], ResourceInput.prototype, "domain", void 0);
|
|
271
|
-
__decorate([
|
|
272
|
-
Field((type) => [String]),
|
|
273
|
-
__metadata("design:type", Array)
|
|
274
|
-
], ResourceInput.prototype, "pointers", void 0);
|
|
275
|
-
ResourceInput = __decorate([
|
|
276
|
-
InputType(),
|
|
277
|
-
__metadata("design:paramtypes", [String, Array])
|
|
278
|
-
], ResourceInput);
|
|
279
|
-
export { ResourceInput };
|
|
280
|
-
let CapabilityInput = class CapabilityInput {
|
|
92
|
+
}
|
|
93
|
+
export class CapabilityInput {
|
|
281
94
|
constructor(withF, can) {
|
|
282
95
|
this.with = withF;
|
|
283
96
|
this.can = can;
|
|
284
97
|
}
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
Field((type) => ResourceInput),
|
|
288
|
-
__metadata("design:type", ResourceInput)
|
|
289
|
-
], CapabilityInput.prototype, "with", void 0);
|
|
290
|
-
__decorate([
|
|
291
|
-
Field((type) => [String]),
|
|
292
|
-
__metadata("design:type", Array)
|
|
293
|
-
], CapabilityInput.prototype, "can", void 0);
|
|
294
|
-
CapabilityInput = __decorate([
|
|
295
|
-
InputType(),
|
|
296
|
-
__metadata("design:paramtypes", [ResourceInput, Array])
|
|
297
|
-
], CapabilityInput);
|
|
298
|
-
export { CapabilityInput };
|
|
299
|
-
let AuthInfoInput = class AuthInfoInput {
|
|
98
|
+
}
|
|
99
|
+
export class AuthInfoInput {
|
|
300
100
|
constructor(appName, appDesc, appDomain, appUrl, appIconPath, capabilities) {
|
|
301
101
|
this.appName = appName;
|
|
302
102
|
this.appDesc = appDesc;
|
|
@@ -305,57 +105,11 @@ let AuthInfoInput = class AuthInfoInput {
|
|
|
305
105
|
this.capabilities = capabilities;
|
|
306
106
|
this.appIconPath = appIconPath;
|
|
307
107
|
}
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
Field(),
|
|
311
|
-
__metadata("design:type", String)
|
|
312
|
-
], AuthInfoInput.prototype, "appName", void 0);
|
|
313
|
-
__decorate([
|
|
314
|
-
Field(),
|
|
315
|
-
__metadata("design:type", String)
|
|
316
|
-
], AuthInfoInput.prototype, "appDesc", void 0);
|
|
317
|
-
__decorate([
|
|
318
|
-
Field(),
|
|
319
|
-
__metadata("design:type", String)
|
|
320
|
-
], AuthInfoInput.prototype, "appDomain", void 0);
|
|
321
|
-
__decorate([
|
|
322
|
-
Field({ nullable: true }),
|
|
323
|
-
__metadata("design:type", String)
|
|
324
|
-
], AuthInfoInput.prototype, "appUrl", void 0);
|
|
325
|
-
__decorate([
|
|
326
|
-
Field({ nullable: true }),
|
|
327
|
-
__metadata("design:type", String)
|
|
328
|
-
], AuthInfoInput.prototype, "appIconPath", void 0);
|
|
329
|
-
__decorate([
|
|
330
|
-
Field((type) => [CapabilityInput], { nullable: true }),
|
|
331
|
-
__metadata("design:type", Array)
|
|
332
|
-
], AuthInfoInput.prototype, "capabilities", void 0);
|
|
333
|
-
AuthInfoInput = __decorate([
|
|
334
|
-
InputType(),
|
|
335
|
-
__metadata("design:paramtypes", [String, String, String, String, String, Array])
|
|
336
|
-
], AuthInfoInput);
|
|
337
|
-
export { AuthInfoInput };
|
|
338
|
-
let UserCreationResult = class UserCreationResult {
|
|
108
|
+
}
|
|
109
|
+
export class UserCreationResult {
|
|
339
110
|
constructor(did, success, error) {
|
|
340
111
|
this.did = did;
|
|
341
112
|
this.success = success;
|
|
342
113
|
this.error = error;
|
|
343
114
|
}
|
|
344
|
-
}
|
|
345
|
-
__decorate([
|
|
346
|
-
Field(),
|
|
347
|
-
__metadata("design:type", String)
|
|
348
|
-
], UserCreationResult.prototype, "did", void 0);
|
|
349
|
-
__decorate([
|
|
350
|
-
Field(),
|
|
351
|
-
__metadata("design:type", Boolean)
|
|
352
|
-
], UserCreationResult.prototype, "success", void 0);
|
|
353
|
-
__decorate([
|
|
354
|
-
Field({ nullable: true }),
|
|
355
|
-
__metadata("design:type", String)
|
|
356
|
-
], UserCreationResult.prototype, "error", void 0);
|
|
357
|
-
UserCreationResult = __decorate([
|
|
358
|
-
ObjectType(),
|
|
359
|
-
__metadata("design:paramtypes", [String, Boolean, String])
|
|
360
|
-
], UserCreationResult);
|
|
361
|
-
export { UserCreationResult };
|
|
115
|
+
}
|
|
@@ -1,33 +1,26 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ApiClient } from "../apiClient";
|
|
2
2
|
import { PerspectiveInput } from "../perspectives/Perspective";
|
|
3
3
|
import { Agent, Apps, AuthInfoInput, EntanglementProof, EntanglementProofInput, UserCreationResult } from "./Agent";
|
|
4
|
-
import { HostingUserInfo, PaymentRequestResult } from "../runtime/
|
|
4
|
+
import { HostingUserInfo, PaymentRequestResult, ComputeLogEntry } from "../runtime/RuntimeTypes";
|
|
5
5
|
import { AgentStatus } from "./AgentStatus";
|
|
6
6
|
import { LinkMutations } from "../links/Links";
|
|
7
|
-
import { VerificationRequestResult } from "../runtime/
|
|
7
|
+
import { VerificationRequestResult } from "../runtime/RuntimeTypes";
|
|
8
8
|
export interface InitializeArgs {
|
|
9
9
|
did: string;
|
|
10
10
|
didDocument: string;
|
|
11
11
|
keystore: string;
|
|
12
12
|
passphrase: string;
|
|
13
13
|
}
|
|
14
|
-
export type AgentUpdatedCallback = (agent: Agent) =>
|
|
15
|
-
export type AgentStatusChangedCallback = (agent: Agent) =>
|
|
16
|
-
export type AgentAppsUpdatedCallback = () =>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
* such as generating, locking, unlocking, importing the DID keystore,
|
|
20
|
-
* as well as updating the publicly shared Agent expression.
|
|
21
|
-
*/
|
|
14
|
+
export type AgentUpdatedCallback = (agent: Agent) => void;
|
|
15
|
+
export type AgentStatusChangedCallback = (agent: Agent) => void;
|
|
16
|
+
export type AgentAppsUpdatedCallback = () => void;
|
|
17
|
+
export type HostingUserInfoChangedCallback = (info: HostingUserInfo) => void;
|
|
18
|
+
export type ComputeLogUpdatedCallback = (entry: ComputeLogEntry) => void;
|
|
22
19
|
export declare class AgentClient {
|
|
23
20
|
#private;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
* publicly via the AgentLanguage.
|
|
28
|
-
*
|
|
29
|
-
* I.e. this is the users profile.
|
|
30
|
-
*/
|
|
21
|
+
/** TTL for remote (non-self) agent profiles in L1 cache (ms). */
|
|
22
|
+
static REMOTE_AGENT_TTL_MS: number;
|
|
23
|
+
constructor(baseUrl: string, token?: string, subscribe?: boolean, sharedApiClient?: ApiClient);
|
|
31
24
|
me(): Promise<Agent>;
|
|
32
25
|
status(): Promise<AgentStatus>;
|
|
33
26
|
generate(passphrase: string): Promise<AgentStatus>;
|
|
@@ -35,6 +28,20 @@ export declare class AgentClient {
|
|
|
35
28
|
lock(passphrase: string): Promise<AgentStatus>;
|
|
36
29
|
unlock(passphrase: string, holochain?: boolean): Promise<AgentStatus>;
|
|
37
30
|
byDID(did: string): Promise<Agent>;
|
|
31
|
+
/**
|
|
32
|
+
* Set the current agent's own DID.
|
|
33
|
+
* The self-DID receives event-driven invalidation and is never TTL-expired.
|
|
34
|
+
*/
|
|
35
|
+
setSelfDid(did: string): void;
|
|
36
|
+
/**
|
|
37
|
+
* Invalidate a specific DID's cache entry in both L1 and L2.
|
|
38
|
+
*/
|
|
39
|
+
invalidateByDid(did: string): void;
|
|
40
|
+
/**
|
|
41
|
+
* Clear the entire L1 (memory) byDID cache.
|
|
42
|
+
* L2 (IndexedDB) is preserved — agent data remains valid across sessions.
|
|
43
|
+
*/
|
|
44
|
+
clearByDidCache(): void;
|
|
38
45
|
updatePublicPerspective(perspective: PerspectiveInput): Promise<Agent>;
|
|
39
46
|
mutatePublicPerspective(mutations: LinkMutations): Promise<Agent>;
|
|
40
47
|
updateDirectMessageLanguage(directMessageLanguage: string): Promise<Agent>;
|
|
@@ -42,12 +49,16 @@ export declare class AgentClient {
|
|
|
42
49
|
deleteEntanglementProofs(proofs: EntanglementProofInput[]): Promise<EntanglementProof[]>;
|
|
43
50
|
getEntanglementProofs(): Promise<string[]>;
|
|
44
51
|
entanglementProofPreFlight(deviceKey: string, deviceKeyType: string): Promise<EntanglementProof>;
|
|
45
|
-
addUpdatedListener(listener:
|
|
46
|
-
addAppChangedListener(listener:
|
|
52
|
+
addUpdatedListener(listener: AgentUpdatedCallback): void;
|
|
53
|
+
addAppChangedListener(listener: AgentAppsUpdatedCallback): void;
|
|
47
54
|
subscribeAgentUpdated(): void;
|
|
48
55
|
subscribeAppsChanged(): void;
|
|
49
|
-
addAgentStatusChangedListener(listener:
|
|
56
|
+
addAgentStatusChangedListener(listener: AgentStatusChangedCallback): void;
|
|
50
57
|
subscribeAgentStatusChanged(): void;
|
|
58
|
+
addHostingUserInfoChangedListener(listener: HostingUserInfoChangedCallback): void;
|
|
59
|
+
subscribeHostingUserInfoChanged(): void;
|
|
60
|
+
addComputeLogUpdatedListener(listener: ComputeLogUpdatedCallback): void;
|
|
61
|
+
subscribeComputeLogUpdated(): void;
|
|
51
62
|
requestCapability(authInfo: AuthInfoInput): Promise<string>;
|
|
52
63
|
permitCapability(auth: string): Promise<string>;
|
|
53
64
|
generateJwt(requestId: string, rand: string): Promise<string>;
|
|
@@ -61,6 +72,7 @@ export declare class AgentClient {
|
|
|
61
72
|
requestLoginVerification(email: string, appInfo?: AuthInfoInput): Promise<VerificationRequestResult>;
|
|
62
73
|
verifyEmailCode(email: string, code: string, verificationType: string): Promise<string>;
|
|
63
74
|
hostingUserInfo(): Promise<HostingUserInfo>;
|
|
75
|
+
computeLog(since?: string, limit?: number, userEmail?: string): Promise<ComputeLogEntry[]>;
|
|
64
76
|
setHotWalletAddress(address: string): Promise<boolean>;
|
|
65
77
|
requestPayment(amountHOT: string): Promise<PaymentRequestResult>;
|
|
66
78
|
}
|