@oobe-protocol-labs/synapse-client-sdk 2.0.2 → 2.0.5
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/CHANGELOG.md +54 -0
- package/README.md +2 -2
- package/dist/cjs/ai/index.d.ts +1 -1
- package/dist/cjs/ai/index.d.ts.map +1 -1
- package/dist/cjs/ai/index.js +12 -28
- package/dist/cjs/ai/index.js.map +1 -1
- package/dist/cjs/ai/sap/client.d.ts +197 -0
- package/dist/cjs/ai/sap/client.d.ts.map +1 -0
- package/dist/cjs/ai/sap/client.js +334 -0
- package/dist/cjs/ai/sap/client.js.map +1 -0
- package/dist/cjs/ai/sap/index.d.ts +69 -52
- package/dist/cjs/ai/sap/index.d.ts.map +1 -1
- package/dist/cjs/ai/sap/index.js +73 -77
- package/dist/cjs/ai/sap/index.js.map +1 -1
- package/dist/cjs/ai/sap/provider.d.ts +180 -0
- package/dist/cjs/ai/sap/provider.d.ts.map +1 -0
- package/dist/cjs/ai/sap/provider.js +219 -0
- package/dist/cjs/ai/sap/provider.js.map +1 -0
- package/dist/cjs/ai/sap/types.d.ts +120 -384
- package/dist/cjs/ai/sap/types.d.ts.map +1 -1
- package/dist/cjs/ai/sap/types.js +20 -200
- package/dist/cjs/ai/sap/types.js.map +1 -1
- package/dist/docs/classes/AccountReader.html +18 -18
- package/dist/docs/classes/AccountsClient.html +10 -10
- package/dist/docs/classes/AsyncProviderError.html +4 -4
- package/dist/docs/classes/CircularDependencyError.html +4 -4
- package/dist/docs/classes/DasClient.html +13 -13
- package/dist/docs/classes/GeyserParser.html +17 -17
- package/dist/docs/classes/GrpcTransport.html +6 -6
- package/dist/docs/classes/HttpTransport.html +4 -4
- package/dist/docs/classes/InstructionWriter.html +11 -11
- package/dist/docs/classes/MemoryGuard.html +9 -9
- package/dist/docs/classes/NetworkError.html +5 -5
- package/dist/docs/classes/RefRegistry.html +11 -11
- package/dist/docs/classes/RefReleasedError.html +4 -4
- package/dist/docs/classes/RpcMethodNotFoundError.html +4 -4
- package/dist/docs/classes/ServiceNotFoundError.html +4 -4
- package/dist/docs/classes/ServiceRef.html +13 -13
- package/dist/docs/classes/SolanaRpc.html +55 -55
- package/dist/docs/classes/SynapseClient.html +15 -15
- package/dist/docs/classes/SynapseContext.html +27 -27
- package/dist/docs/classes/SynapseError.html +4 -4
- package/dist/docs/classes/TimeoutError.html +4 -4
- package/dist/docs/classes/UpstreamError.html +6 -6
- package/dist/docs/classes/WeakServiceRef.html +4 -4
- package/dist/docs/classes/WsClient.html +10 -10
- package/dist/docs/enums/SynapseNetwork.html +2 -2
- package/dist/docs/enums/SynapseRegion.html +2 -2
- package/dist/docs/enums/TokenExtensionType.html +2 -2
- package/dist/docs/functions/Epoch-1.html +1 -1
- package/dist/docs/functions/Lamports-2.html +1 -1
- package/dist/docs/functions/Pubkey-1.html +1 -1
- package/dist/docs/functions/Sig.html +1 -1
- package/dist/docs/functions/Slot-1.html +1 -1
- package/dist/docs/functions/UnixTs.html +1 -1
- package/dist/docs/functions/autoSelectRegion.html +1 -1
- package/dist/docs/functions/autoWire.html +1 -1
- package/dist/docs/functions/base58Encode.html +1 -1
- package/dist/docs/functions/base64ToBytes.html +1 -1
- package/dist/docs/functions/bigIntReplacer.html +1 -1
- package/dist/docs/functions/chunk.html +1 -1
- package/dist/docs/functions/computeBalanceChanges.html +1 -1
- package/dist/docs/functions/computeTokenBalanceChanges.html +1 -1
- package/dist/docs/functions/createBareContext.html +1 -1
- package/dist/docs/functions/createBinding.html +1 -1
- package/dist/docs/functions/createBoundHook.html +1 -1
- package/dist/docs/functions/createReactAdapter.html +1 -1
- package/dist/docs/functions/createRefHook.html +1 -1
- package/dist/docs/functions/createServerMiddleware.html +1 -1
- package/dist/docs/functions/createServiceHook.html +1 -1
- package/dist/docs/functions/createSingleton.html +1 -1
- package/dist/docs/functions/createSynapse.html +1 -1
- package/dist/docs/functions/createSynapseContext.html +1 -1
- package/dist/docs/functions/createToken.html +1 -1
- package/dist/docs/functions/decodeBase58.html +1 -1
- package/dist/docs/functions/decodeLookupTable.html +1 -1
- package/dist/docs/functions/decodeMint.html +1 -1
- package/dist/docs/functions/decodeMultisig.html +1 -1
- package/dist/docs/functions/decodeNonceAccount.html +1 -1
- package/dist/docs/functions/decodeStakeAccount.html +1 -1
- package/dist/docs/functions/decodeToken2022Account.html +1 -1
- package/dist/docs/functions/decodeToken2022Mint.html +1 -1
- package/dist/docs/functions/decodeTokenAccount.html +1 -1
- package/dist/docs/functions/encodeBase58.html +1 -1
- package/dist/docs/functions/fetchLookupTable.html +1 -1
- package/dist/docs/functions/fetchMint.html +1 -1
- package/dist/docs/functions/fetchNonceAccount.html +1 -1
- package/dist/docs/functions/fetchStakeAccount.html +1 -1
- package/dist/docs/functions/fetchTokenAccount.html +1 -1
- package/dist/docs/functions/fetchTokenAccountsByOwner.html +1 -1
- package/dist/docs/functions/fromKitAddress.html +1 -1
- package/dist/docs/functions/getAccountInfo.html +1 -1
- package/dist/docs/functions/getAsset.html +1 -1
- package/dist/docs/functions/getAssetBatch.html +1 -1
- package/dist/docs/functions/getAssetProof.html +1 -1
- package/dist/docs/functions/getAssetProofBatch.html +1 -1
- package/dist/docs/functions/getAssetsByAuthority.html +1 -1
- package/dist/docs/functions/getAssetsByCreator.html +1 -1
- package/dist/docs/functions/getAssetsByGroup.html +1 -1
- package/dist/docs/functions/getAssetsByOwner.html +1 -1
- package/dist/docs/functions/getBalance.html +1 -1
- package/dist/docs/functions/getBlock.html +1 -1
- package/dist/docs/functions/getBlockCommitment.html +1 -1
- package/dist/docs/functions/getBlockHeight.html +1 -1
- package/dist/docs/functions/getBlockProduction.html +1 -1
- package/dist/docs/functions/getBlockTime.html +1 -1
- package/dist/docs/functions/getBlocks.html +1 -1
- package/dist/docs/functions/getBlocksWithLimit.html +1 -1
- package/dist/docs/functions/getClusterNodes.html +1 -1
- package/dist/docs/functions/getContext.html +1 -1
- package/dist/docs/functions/getDecodedAccount.html +1 -1
- package/dist/docs/functions/getDecodedAccounts.html +1 -1
- package/dist/docs/functions/getEnvironment.html +1 -1
- package/dist/docs/functions/getEpochInfo.html +1 -1
- package/dist/docs/functions/getEpochSchedule.html +1 -1
- package/dist/docs/functions/getFeeForMessage.html +1 -1
- package/dist/docs/functions/getFirstAvailableBlock.html +1 -1
- package/dist/docs/functions/getGenesisHash.html +1 -1
- package/dist/docs/functions/getHealth.html +1 -1
- package/dist/docs/functions/getHighestSnapshotSlot.html +1 -1
- package/dist/docs/functions/getIdentity.html +1 -1
- package/dist/docs/functions/getInflationGovernor.html +1 -1
- package/dist/docs/functions/getInflationRate.html +1 -1
- package/dist/docs/functions/getInflationReward.html +1 -1
- package/dist/docs/functions/getLargestAccounts.html +1 -1
- package/dist/docs/functions/getLatestBlockhash.html +1 -1
- package/dist/docs/functions/getLeaderSchedule.html +1 -1
- package/dist/docs/functions/getMaxRetransmitSlot.html +1 -1
- package/dist/docs/functions/getMaxShredInsertSlot.html +1 -1
- package/dist/docs/functions/getMinimumBalanceForRentExemption.html +1 -1
- package/dist/docs/functions/getMultipleAccounts.html +1 -1
- package/dist/docs/functions/getProgramAccounts.html +1 -1
- package/dist/docs/functions/getProgramCategory.html +1 -1
- package/dist/docs/functions/getRecentPerformanceSamples.html +1 -1
- package/dist/docs/functions/getRecentPrioritizationFees.html +1 -1
- package/dist/docs/functions/getSignatureStatuses.html +1 -1
- package/dist/docs/functions/getSignaturesForAddress.html +1 -1
- package/dist/docs/functions/getSignaturesForAsset.html +1 -1
- package/dist/docs/functions/getSlot.html +1 -1
- package/dist/docs/functions/getSlotLeader.html +1 -1
- package/dist/docs/functions/getSlotLeaders.html +1 -1
- package/dist/docs/functions/getStakeActivation.html +1 -1
- package/dist/docs/functions/getStakeMinimumDelegation.html +1 -1
- package/dist/docs/functions/getSupply.html +1 -1
- package/dist/docs/functions/getTokenAccountBalance.html +1 -1
- package/dist/docs/functions/getTokenAccounts.html +1 -1
- package/dist/docs/functions/getTokenAccountsByDelegate.html +1 -1
- package/dist/docs/functions/getTokenAccountsByOwner.html +1 -1
- package/dist/docs/functions/getTokenLargestAccounts.html +1 -1
- package/dist/docs/functions/getTokenSupply.html +1 -1
- package/dist/docs/functions/getTransaction.html +1 -1
- package/dist/docs/functions/getTransactionCount.html +1 -1
- package/dist/docs/functions/getVersion.html +1 -1
- package/dist/docs/functions/getVoteAccounts.html +1 -1
- package/dist/docs/functions/isBlockhashValid.html +1 -1
- package/dist/docs/functions/isBrowser.html +1 -1
- package/dist/docs/functions/isDisposable.html +1 -1
- package/dist/docs/functions/isProgramInCategory.html +1 -1
- package/dist/docs/functions/isServer.html +1 -1
- package/dist/docs/functions/isValidPubkey.html +1 -1
- package/dist/docs/functions/isValidSignature.html +1 -1
- package/dist/docs/functions/lamportsToSol.html +1 -1
- package/dist/docs/functions/listEndpoints.html +1 -1
- package/dist/docs/functions/listNetworks.html +1 -1
- package/dist/docs/functions/listRegions.html +1 -1
- package/dist/docs/functions/minimumLedgerSlot.html +1 -1
- package/dist/docs/functions/parseAccountUpdate.html +1 -1
- package/dist/docs/functions/parseBlockMeta.html +1 -1
- package/dist/docs/functions/parseEntry.html +1 -1
- package/dist/docs/functions/parseGeyserUpdate.html +1 -1
- package/dist/docs/functions/parseSlotUpdate.html +1 -1
- package/dist/docs/functions/parseTimestamp.html +1 -1
- package/dist/docs/functions/parseTransaction.html +1 -1
- package/dist/docs/functions/probeLatency.html +1 -1
- package/dist/docs/functions/rawBufferToBase58.html +1 -1
- package/dist/docs/functions/rawBufferToBase64.html +1 -1
- package/dist/docs/functions/rawBufferToBytes.html +1 -1
- package/dist/docs/functions/rawBufferToHex.html +1 -1
- package/dist/docs/functions/readonly.html +1 -1
- package/dist/docs/functions/readonlySigner.html +1 -1
- package/dist/docs/functions/requestAirdrop.html +1 -1
- package/dist/docs/functions/resolveEndpoint.html +1 -1
- package/dist/docs/functions/resolveProgram.html +1 -1
- package/dist/docs/functions/resolveProgramBatch.html +1 -1
- package/dist/docs/functions/retry.html +1 -1
- package/dist/docs/functions/searchAssets.html +1 -1
- package/dist/docs/functions/sendTransaction.html +1 -1
- package/dist/docs/functions/setGlobalContext.html +1 -1
- package/dist/docs/functions/simulateTransaction.html +1 -1
- package/dist/docs/functions/sleep.html +1 -1
- package/dist/docs/functions/solToLamports.html +1 -1
- package/dist/docs/functions/toClientConfig.html +1 -1
- package/dist/docs/functions/toJsonSafe.html +1 -1
- package/dist/docs/functions/toKitAddress.html +1 -1
- package/dist/docs/functions/toKitInstruction.html +1 -1
- package/dist/docs/functions/toKitLamports.html +1 -1
- package/dist/docs/functions/toKitSignatureString.html +1 -1
- package/dist/docs/functions/tryGetContext.html +1 -1
- package/dist/docs/functions/tryUseService.html +1 -1
- package/dist/docs/functions/useBoundServices.html +1 -1
- package/dist/docs/functions/useService.html +1 -1
- package/dist/docs/functions/useSharedRef.html +1 -1
- package/dist/docs/functions/withRef.html +1 -1
- package/dist/docs/functions/withRefAsync.html +1 -1
- package/dist/docs/functions/writable.html +1 -1
- package/dist/docs/functions/writableSigner.html +1 -1
- package/dist/docs/index.html +2 -2
- package/dist/docs/interfaces/AccountInfo.html +7 -7
- package/dist/docs/interfaces/AccountMeta.html +4 -4
- package/dist/docs/interfaces/AccountNotification.html +2 -2
- package/dist/docs/interfaces/AccountSubParams.html +2 -2
- package/dist/docs/interfaces/AddMemoParams.html +5 -5
- package/dist/docs/interfaces/AdvanceNonceParams.html +3 -3
- package/dist/docs/interfaces/AliasProvider.html +2 -2
- package/dist/docs/interfaces/AllocateParams.html +3 -3
- package/dist/docs/interfaces/ApproveCheckedParams.html +9 -9
- package/dist/docs/interfaces/ApproveParams.html +7 -7
- package/dist/docs/interfaces/AssetSignatureInfo.html +2 -2
- package/dist/docs/interfaces/AssetSignaturesPage.html +2 -2
- package/dist/docs/interfaces/AssignParams.html +3 -3
- package/dist/docs/interfaces/AsyncFactoryProvider.html +2 -2
- package/dist/docs/interfaces/AuthorizeNonceParams.html +4 -4
- package/dist/docs/interfaces/BalanceChange.html +6 -6
- package/dist/docs/interfaces/BlockProduction.html +3 -3
- package/dist/docs/interfaces/BlockResult.html +2 -2
- package/dist/docs/interfaces/BlockReward.html +2 -2
- package/dist/docs/interfaces/BlockhashResult.html +2 -2
- package/dist/docs/interfaces/BurnCheckedParams.html +8 -8
- package/dist/docs/interfaces/BurnParams.html +7 -7
- package/dist/docs/interfaces/CallOptions.html +6 -6
- package/dist/docs/interfaces/ClassProvider.html +2 -2
- package/dist/docs/interfaces/CloseAccountParams.html +6 -6
- package/dist/docs/interfaces/ConfirmedTransaction.html +6 -6
- package/dist/docs/interfaces/ContactInfo.html +2 -2
- package/dist/docs/interfaces/ContextAdapter.html +5 -5
- package/dist/docs/interfaces/ContextEvents.html +6 -6
- package/dist/docs/interfaces/ContextModule.html +3 -3
- package/dist/docs/interfaces/CreateATAParams.html +6 -6
- package/dist/docs/interfaces/CreateAccountParams.html +6 -6
- package/dist/docs/interfaces/CreateAccountWithSeedParams.html +8 -8
- package/dist/docs/interfaces/CreateSynapseContextOpts.html +4 -4
- package/dist/docs/interfaces/DasAsset.html +2 -2
- package/dist/docs/interfaces/DasAssetProof.html +2 -2
- package/dist/docs/interfaces/DasAuthority.html +2 -2
- package/dist/docs/interfaces/DasCompression.html +2 -2
- package/dist/docs/interfaces/DasContent.html +2 -2
- package/dist/docs/interfaces/DasCreator.html +2 -2
- package/dist/docs/interfaces/DasFile.html +2 -2
- package/dist/docs/interfaces/DasGrouping.html +2 -2
- package/dist/docs/interfaces/DasOpts.html +2 -2
- package/dist/docs/interfaces/DasOwnership.html +2 -2
- package/dist/docs/interfaces/DasPage.html +2 -2
- package/dist/docs/interfaces/DasRoyalty.html +2 -2
- package/dist/docs/interfaces/DasSearchParams.html +2 -2
- package/dist/docs/interfaces/DasSupply.html +2 -2
- package/dist/docs/interfaces/DataSlice.html +3 -3
- package/dist/docs/interfaces/DecodedAccountResult.html +4 -4
- package/dist/docs/interfaces/DecodedLookupTable.html +8 -8
- package/dist/docs/interfaces/DecodedMint.html +6 -6
- package/dist/docs/interfaces/DecodedMultisig.html +5 -5
- package/dist/docs/interfaces/DecodedNonceAccount.html +6 -6
- package/dist/docs/interfaces/DecodedStakeAccount.html +2 -2
- package/dist/docs/interfaces/DecodedToken2022Account.html +9 -9
- package/dist/docs/interfaces/DecodedToken2022Mint.html +6 -6
- package/dist/docs/interfaces/DecodedTokenAccount.html +9 -9
- package/dist/docs/interfaces/DefaultAccountStateExt.html +2 -2
- package/dist/docs/interfaces/Disposable.html +2 -2
- package/dist/docs/interfaces/EndpointConnectConfig.html +5 -5
- package/dist/docs/interfaces/EpochInfo.html +7 -7
- package/dist/docs/interfaces/EpochSchedule.html +2 -2
- package/dist/docs/interfaces/FactoryProvider.html +2 -2
- package/dist/docs/interfaces/FetchedMint.html +6 -6
- package/dist/docs/interfaces/FetchedTokenAccount.html +6 -6
- package/dist/docs/interfaces/FreezeThawParams.html +6 -6
- package/dist/docs/interfaces/GetAccountInfoOpts.html +6 -6
- package/dist/docs/interfaces/GetAssetsByAuthorityParams.html +2 -2
- package/dist/docs/interfaces/GetAssetsByCreatorParams.html +2 -2
- package/dist/docs/interfaces/GetAssetsByGroupParams.html +2 -2
- package/dist/docs/interfaces/GetAssetsByOwnerParams.html +2 -2
- package/dist/docs/interfaces/GetBlockOpts.html +6 -6
- package/dist/docs/interfaces/GetBlockProductionOpts.html +6 -6
- package/dist/docs/interfaces/GetMultipleAccountsOpts.html +6 -6
- package/dist/docs/interfaces/GetProgramAccountsOpts.html +6 -6
- package/dist/docs/interfaces/GetSignatureStatusesOpts.html +6 -6
- package/dist/docs/interfaces/GetSignaturesOpts.html +7 -7
- package/dist/docs/interfaces/GetTokenAccountsParams.html +2 -2
- package/dist/docs/interfaces/GetTransactionOpts.html +6 -6
- package/dist/docs/interfaces/GeyserParserConfig.html +6 -6
- package/dist/docs/interfaces/GeyserParserEvents.html +9 -9
- package/dist/docs/interfaces/GeyserParserStats.html +2 -2
- package/dist/docs/interfaces/GrpcCallOptions.html +2 -2
- package/dist/docs/interfaces/GrpcTransportConfig.html +6 -6
- package/dist/docs/interfaces/ImmutableOwnerExt.html +2 -2
- package/dist/docs/interfaces/InflationGovernor.html +2 -2
- package/dist/docs/interfaces/InflationRate.html +2 -2
- package/dist/docs/interfaces/InflationReward.html +2 -2
- package/dist/docs/interfaces/InitializeAccountParams.html +5 -5
- package/dist/docs/interfaces/InitializeMintParams.html +6 -6
- package/dist/docs/interfaces/InitializeNonceParams.html +3 -3
- package/dist/docs/interfaces/InterestBearingConfigExt.html +2 -2
- package/dist/docs/interfaces/LatencyProbeResult.html +2 -2
- package/dist/docs/interfaces/LeakReport.html +5 -5
- package/dist/docs/interfaces/LogsNotification.html +2 -2
- package/dist/docs/interfaces/LogsSubParams.html +2 -2
- package/dist/docs/interfaces/MemoTransferExt.html +2 -2
- package/dist/docs/interfaces/MemoryGuardConfig.html +4 -4
- package/dist/docs/interfaces/MetadataPointerExt.html +2 -2
- package/dist/docs/interfaces/MintCloseAuthorityExt.html +2 -2
- package/dist/docs/interfaces/MintToCheckedParams.html +8 -8
- package/dist/docs/interfaces/MintToParams.html +7 -7
- package/dist/docs/interfaces/NonTransferableExt.html +2 -2
- package/dist/docs/interfaces/PaginationOpts.html +2 -2
- package/dist/docs/interfaces/ParsedAccountUpdate.html +16 -16
- package/dist/docs/interfaces/ParsedBlockMeta.html +2 -2
- package/dist/docs/interfaces/ParsedEntry.html +2 -2
- package/dist/docs/interfaces/ParsedInstruction.html +9 -9
- package/dist/docs/interfaces/ParsedSlotUpdate.html +3 -3
- package/dist/docs/interfaces/ParsedTransaction.html +19 -19
- package/dist/docs/interfaces/PerfSample.html +2 -2
- package/dist/docs/interfaces/PermanentDelegateExt.html +2 -2
- package/dist/docs/interfaces/ProgramAccount.html +2 -2
- package/dist/docs/interfaces/ProgramNotification.html +2 -2
- package/dist/docs/interfaces/ProgramSubParams.html +2 -2
- package/dist/docs/interfaces/ProgramsBundle.html +33 -33
- package/dist/docs/interfaces/RawAccountInfo.html +2 -2
- package/dist/docs/interfaces/RawBlockMeta.html +2 -2
- package/dist/docs/interfaces/RawBuffer.html +2 -2
- package/dist/docs/interfaces/RawCompiledInstruction.html +2 -2
- package/dist/docs/interfaces/RawEntry.html +2 -2
- package/dist/docs/interfaces/RawGeyserUpdate.html +2 -2
- package/dist/docs/interfaces/RawInnerInstruction.html +2 -2
- package/dist/docs/interfaces/RawSlotInfo.html +2 -2
- package/dist/docs/interfaces/RawTimestamp.html +2 -2
- package/dist/docs/interfaces/RawTokenBalance.html +2 -2
- package/dist/docs/interfaces/RawTransactionInfo.html +2 -2
- package/dist/docs/interfaces/ReactAdapterConfig.html +2 -2
- package/dist/docs/interfaces/RecoverNestedParams.html +7 -7
- package/dist/docs/interfaces/RefRegistryConfig.html +2 -2
- package/dist/docs/interfaces/RefStats.html +7 -7
- package/dist/docs/interfaces/RequestHeapFrameParams.html +2 -2
- package/dist/docs/interfaces/ResolveMiddleware.html +1 -1
- package/dist/docs/interfaces/RevokeParams.html +5 -5
- package/dist/docs/interfaces/RootNotification.html +2 -2
- package/dist/docs/interfaces/RootSubParams.html +1 -1
- package/dist/docs/interfaces/RpcContext.html +2 -2
- package/dist/docs/interfaces/RpcError.html +4 -4
- package/dist/docs/interfaces/RpcRequest.html +3 -3
- package/dist/docs/interfaces/RpcResponse.html +2 -2
- package/dist/docs/interfaces/SendTransactionOpts.html +6 -6
- package/dist/docs/interfaces/ServerAdapterConfig.html +3 -3
- package/dist/docs/interfaces/ServiceBinding.html +6 -6
- package/dist/docs/interfaces/ServiceRegistration.html +3 -3
- package/dist/docs/interfaces/ServiceResolver.html +6 -6
- package/dist/docs/interfaces/ServiceToken.html +4 -4
- package/dist/docs/interfaces/SetComputeUnitLimitParams.html +2 -2
- package/dist/docs/interfaces/SetComputeUnitPriceParams.html +2 -2
- package/dist/docs/interfaces/SetLoadedAccountsDataSizeLimitParams.html +2 -2
- package/dist/docs/interfaces/SignatureInfo.html +7 -7
- package/dist/docs/interfaces/SignatureNotification.html +2 -2
- package/dist/docs/interfaces/SignatureStatus.html +5 -5
- package/dist/docs/interfaces/SignatureSubParams.html +2 -2
- package/dist/docs/interfaces/SignaturesForAssetParams.html +2 -2
- package/dist/docs/interfaces/SimulateResult.html +2 -2
- package/dist/docs/interfaces/SimulateTransactionOpts.html +7 -7
- package/dist/docs/interfaces/SingletonOptions.html +2 -2
- package/dist/docs/interfaces/SlotNotification.html +2 -2
- package/dist/docs/interfaces/SlotSubParams.html +1 -1
- package/dist/docs/interfaces/SortOpts.html +2 -2
- package/dist/docs/interfaces/StakeAuthorized.html +2 -2
- package/dist/docs/interfaces/StakeDelegation.html +3 -3
- package/dist/docs/interfaces/StakeLockup.html +4 -4
- package/dist/docs/interfaces/StakeMeta.html +2 -2
- package/dist/docs/interfaces/Supply.html +5 -5
- package/dist/docs/interfaces/SynapseClientConfig.html +9 -9
- package/dist/docs/interfaces/SynapseClientLike.html +2 -2
- package/dist/docs/interfaces/SynapseEndpoint.html +7 -7
- package/dist/docs/interfaces/SyncNativeParams.html +3 -3
- package/dist/docs/interfaces/SystemTransferParams.html +4 -4
- package/dist/docs/interfaces/TokenAccount.html +3 -3
- package/dist/docs/interfaces/TokenAccountsByOwnerResult.html +2 -2
- package/dist/docs/interfaces/TokenAmount.html +5 -5
- package/dist/docs/interfaces/TokenBalanceChange.html +2 -2
- package/dist/docs/interfaces/TokenTransferParams.html +7 -7
- package/dist/docs/interfaces/TransactionInstruction.html +4 -4
- package/dist/docs/interfaces/TransactionMeta.html +11 -11
- package/dist/docs/interfaces/TransferCheckedParams.html +9 -9
- package/dist/docs/interfaces/TransferFeeAmount.html +2 -2
- package/dist/docs/interfaces/TransferFeeConfig.html +2 -2
- package/dist/docs/interfaces/TransportConfig.html +7 -7
- package/dist/docs/interfaces/UnknownExtension.html +2 -2
- package/dist/docs/interfaces/ValueProvider.html +2 -2
- package/dist/docs/interfaces/VoteAccount.html +9 -9
- package/dist/docs/interfaces/VoteAccountsResult.html +3 -3
- package/dist/docs/interfaces/WithdrawNonceParams.html +5 -5
- package/dist/docs/interfaces/WsConfig.html +6 -6
- package/dist/docs/media/CHANGELOG.md +54 -0
- package/dist/docs/types/AccountFetchOpts.html +1 -1
- package/dist/docs/types/AccountFilter.html +1 -1
- package/dist/docs/types/Base58.html +1 -1
- package/dist/docs/types/Brand.html +1 -1
- package/dist/docs/types/Commitment.html +1 -1
- package/dist/docs/types/DasSortBy.html +1 -1
- package/dist/docs/types/DasSortDirection.html +1 -1
- package/dist/docs/types/DataSizeFilter.html +1 -1
- package/dist/docs/types/DecodedExtension.html +1 -1
- package/dist/docs/types/Encoding.html +1 -1
- package/dist/docs/types/Epoch.html +1 -1
- package/dist/docs/types/Lamports.html +1 -1
- package/dist/docs/types/LogsFilter.html +1 -1
- package/dist/docs/types/MemcmpFilter.html +1 -1
- package/dist/docs/types/NonceState.html +1 -1
- package/dist/docs/types/ParsedGeyserUpdate.html +1 -1
- package/dist/docs/types/Pubkey.html +1 -1
- package/dist/docs/types/RuntimeEnv.html +1 -1
- package/dist/docs/types/ServiceLifecycle.html +1 -1
- package/dist/docs/types/ServiceProvider.html +1 -1
- package/dist/docs/types/Signature.html +1 -1
- package/dist/docs/types/Slot.html +1 -1
- package/dist/docs/types/StakeAccountType.html +1 -1
- package/dist/docs/types/SubscriptionId.html +1 -1
- package/dist/docs/types/TokenAccountState.html +1 -1
- package/dist/docs/types/TransactionDetail.html +1 -1
- package/dist/docs/types/UnaryMethod.html +1 -1
- package/dist/docs/types/UnixTimestamp.html +1 -1
- package/dist/docs/types/WsNotification.html +1 -1
- package/dist/docs/variables/ASSOCIATED_TOKEN_PROGRAM.html +1 -1
- package/dist/docs/variables/AssociatedToken.html +4 -4
- package/dist/docs/variables/COMPUTE_BUDGET_PROGRAM.html +1 -1
- package/dist/docs/variables/ComputeBudget.html +5 -5
- package/dist/docs/variables/JUPITER_PROGRAMS.html +1 -1
- package/dist/docs/variables/KNOWN_PROGRAMS.html +1 -1
- package/dist/docs/variables/KNOWN_PROGRAMS_COUNT.html +1 -1
- package/dist/docs/variables/LOOKUP_TABLE_HEADER_SIZE.html +1 -1
- package/dist/docs/variables/LOOKUP_TABLE_PROGRAM_ID.html +1 -1
- package/dist/docs/variables/MARINADE_PROGRAMS.html +1 -1
- package/dist/docs/variables/MAX_MULTISIG_SIGNERS.html +1 -1
- package/dist/docs/variables/MEMO_PROGRAM_V1.html +1 -1
- package/dist/docs/variables/MEMO_PROGRAM_V2.html +1 -1
- package/dist/docs/variables/METAPLEX_PROGRAMS.html +1 -1
- package/dist/docs/variables/METEORA_PROGRAMS.html +1 -1
- package/dist/docs/variables/MINT_SIZE.html +1 -1
- package/dist/docs/variables/MULTISIG_SIZE.html +1 -1
- package/dist/docs/variables/Memo.html +2 -2
- package/dist/docs/variables/NONCE_ACCOUNT_SIZE.html +1 -1
- package/dist/docs/variables/ORCA_PROGRAMS.html +1 -1
- package/dist/docs/variables/OTHER_PROGRAMS.html +1 -1
- package/dist/docs/variables/RAYDIUM_PROGRAMS.html +1 -1
- package/dist/docs/variables/SDK_USER_AGENT.html +1 -1
- package/dist/docs/variables/SPL_PROGRAMS.html +1 -1
- package/dist/docs/variables/STAKE_PROGRAM_ID.html +1 -1
- package/dist/docs/variables/SYNAPSE_DEVNET_EU.html +1 -1
- package/dist/docs/variables/SYNAPSE_DEVNET_US.html +1 -1
- package/dist/docs/variables/SYNAPSE_ENDPOINTS.html +1 -1
- package/dist/docs/variables/SYNAPSE_MAINNET_EU.html +1 -1
- package/dist/docs/variables/SYNAPSE_MAINNET_US.html +1 -1
- package/dist/docs/variables/SYSTEM_PROGRAM.html +1 -1
- package/dist/docs/variables/SYSTEM_PROGRAMS.html +1 -1
- package/dist/docs/variables/SYSTEM_PROGRAM_ID.html +1 -1
- package/dist/docs/variables/SplToken.html +16 -16
- package/dist/docs/variables/SystemProgram.html +10 -10
- package/dist/docs/variables/TOKEN_2022_PROGRAM.html +1 -1
- package/dist/docs/variables/TOKEN_2022_PROGRAM_ID.html +1 -1
- package/dist/docs/variables/TOKEN_ACCOUNT_SIZE.html +1 -1
- package/dist/docs/variables/TOKEN_PROGRAM.html +1 -1
- package/dist/docs/variables/TOKEN_PROGRAM_ID.html +1 -1
- package/dist/docs/variables/Tokens.html +1 -1
- package/dist/esm/ai/index.d.ts +1 -1
- package/dist/esm/ai/index.d.ts.map +1 -1
- package/dist/esm/ai/index.js +9 -11
- package/dist/esm/ai/index.js.map +1 -1
- package/dist/esm/ai/sap/client.d.ts +197 -0
- package/dist/esm/ai/sap/client.d.ts.map +1 -0
- package/dist/esm/ai/sap/client.js +330 -0
- package/dist/esm/ai/sap/client.js.map +1 -0
- package/dist/esm/ai/sap/index.d.ts +69 -52
- package/dist/esm/ai/sap/index.d.ts.map +1 -1
- package/dist/esm/ai/sap/index.js +68 -49
- package/dist/esm/ai/sap/index.js.map +1 -1
- package/dist/esm/ai/sap/provider.d.ts +180 -0
- package/dist/esm/ai/sap/provider.d.ts.map +1 -0
- package/dist/esm/ai/sap/provider.js +215 -0
- package/dist/esm/ai/sap/provider.js.map +1 -0
- package/dist/esm/ai/sap/types.d.ts +120 -384
- package/dist/esm/ai/sap/types.d.ts.map +1 -1
- package/dist/esm/ai/sap/types.js +18 -195
- package/dist/esm/ai/sap/types.js.map +1 -1
- package/package.json +31 -20
- package/dist/cjs/ai/sap/adapter.d.ts +0 -140
- package/dist/cjs/ai/sap/adapter.d.ts.map +0 -1
- package/dist/cjs/ai/sap/adapter.js +0 -181
- package/dist/cjs/ai/sap/adapter.js.map +0 -1
- package/dist/cjs/ai/sap/discovery.d.ts +0 -165
- package/dist/cjs/ai/sap/discovery.d.ts.map +0 -1
- package/dist/cjs/ai/sap/discovery.js +0 -316
- package/dist/cjs/ai/sap/discovery.js.map +0 -1
- package/dist/cjs/ai/sap/pda.d.ts +0 -205
- package/dist/cjs/ai/sap/pda.d.ts.map +0 -1
- package/dist/cjs/ai/sap/pda.js +0 -547
- package/dist/cjs/ai/sap/pda.js.map +0 -1
- package/dist/cjs/ai/sap/program.d.ts +0 -153
- package/dist/cjs/ai/sap/program.d.ts.map +0 -1
- package/dist/cjs/ai/sap/program.js +0 -227
- package/dist/cjs/ai/sap/program.js.map +0 -1
- package/dist/cjs/ai/sap/registry.d.ts +0 -218
- package/dist/cjs/ai/sap/registry.d.ts.map +0 -1
- package/dist/cjs/ai/sap/registry.js +0 -519
- package/dist/cjs/ai/sap/registry.js.map +0 -1
- package/dist/cjs/ai/sap/scoring.d.ts +0 -138
- package/dist/cjs/ai/sap/scoring.d.ts.map +0 -1
- package/dist/cjs/ai/sap/scoring.js +0 -266
- package/dist/cjs/ai/sap/scoring.js.map +0 -1
- package/dist/cjs/ai/sap/subnetwork.d.ts +0 -201
- package/dist/cjs/ai/sap/subnetwork.d.ts.map +0 -1
- package/dist/cjs/ai/sap/subnetwork.js +0 -365
- package/dist/cjs/ai/sap/subnetwork.js.map +0 -1
- package/dist/cjs/ai/sap/validator.d.ts +0 -160
- package/dist/cjs/ai/sap/validator.d.ts.map +0 -1
- package/dist/cjs/ai/sap/validator.js +0 -619
- package/dist/cjs/ai/sap/validator.js.map +0 -1
- package/dist/esm/ai/sap/adapter.d.ts +0 -140
- package/dist/esm/ai/sap/adapter.d.ts.map +0 -1
- package/dist/esm/ai/sap/adapter.js +0 -177
- package/dist/esm/ai/sap/adapter.js.map +0 -1
- package/dist/esm/ai/sap/discovery.d.ts +0 -165
- package/dist/esm/ai/sap/discovery.d.ts.map +0 -1
- package/dist/esm/ai/sap/discovery.js +0 -311
- package/dist/esm/ai/sap/discovery.js.map +0 -1
- package/dist/esm/ai/sap/pda.d.ts +0 -205
- package/dist/esm/ai/sap/pda.d.ts.map +0 -1
- package/dist/esm/ai/sap/pda.js +0 -535
- package/dist/esm/ai/sap/pda.js.map +0 -1
- package/dist/esm/ai/sap/program.d.ts +0 -153
- package/dist/esm/ai/sap/program.d.ts.map +0 -1
- package/dist/esm/ai/sap/program.js +0 -222
- package/dist/esm/ai/sap/program.js.map +0 -1
- package/dist/esm/ai/sap/registry.d.ts +0 -218
- package/dist/esm/ai/sap/registry.d.ts.map +0 -1
- package/dist/esm/ai/sap/registry.js +0 -515
- package/dist/esm/ai/sap/registry.js.map +0 -1
- package/dist/esm/ai/sap/scoring.d.ts +0 -138
- package/dist/esm/ai/sap/scoring.d.ts.map +0 -1
- package/dist/esm/ai/sap/scoring.js +0 -262
- package/dist/esm/ai/sap/scoring.js.map +0 -1
- package/dist/esm/ai/sap/subnetwork.d.ts +0 -201
- package/dist/esm/ai/sap/subnetwork.d.ts.map +0 -1
- package/dist/esm/ai/sap/subnetwork.js +0 -361
- package/dist/esm/ai/sap/subnetwork.js.map +0 -1
- package/dist/esm/ai/sap/validator.d.ts +0 -160
- package/dist/esm/ai/sap/validator.d.ts.map +0 -1
- package/dist/esm/ai/sap/validator.js +0 -614
- package/dist/esm/ai/sap/validator.js.map +0 -1
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module ai/sap/client
|
|
3
|
+
* @description SynapseAnchorSap — One-line bridge from Synapse Client SDK to SAP.
|
|
4
|
+
*
|
|
5
|
+
* Creates a fully-initialized `SapClient` instance using Synapse's
|
|
6
|
+
* network resolution, ready for agent registration, memory writes,
|
|
7
|
+
* x402 escrow, discovery, and every other SAP operation.
|
|
8
|
+
*
|
|
9
|
+
* **Peer dependencies** (must be installed by the consumer):
|
|
10
|
+
* - `@oobe-protocol-labs/synapse-sap-sdk`
|
|
11
|
+
* - `@coral-xyz/anchor`
|
|
12
|
+
* - `@solana/web3.js`
|
|
13
|
+
*
|
|
14
|
+
* @example Standalone
|
|
15
|
+
* ```ts
|
|
16
|
+
* import { SynapseAnchorSap } from '@oobe-protocol-labs/synapse-client-sdk/ai/sap';
|
|
17
|
+
*
|
|
18
|
+
* const sap = SynapseAnchorSap.create({ wallet });
|
|
19
|
+
* await sap.agent.register({ name: 'My Agent', ... });
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @example Re-use SynapseClient endpoint
|
|
23
|
+
* ```ts
|
|
24
|
+
* import { SynapseClient } from '@oobe-protocol-labs/synapse-client-sdk';
|
|
25
|
+
* import { SynapseAnchorSap } from '@oobe-protocol-labs/synapse-client-sdk/ai/sap';
|
|
26
|
+
*
|
|
27
|
+
* const synapse = new SynapseClient({ endpoint: process.env.SYNAPSE_RPC! });
|
|
28
|
+
* const sap = SynapseAnchorSap.fromSynapseClient(synapse, wallet);
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @since 2.1.0
|
|
32
|
+
*/
|
|
33
|
+
import { resolveEndpoint, SynapseNetwork, SynapseRegion, } from '../../utils/synapse.js';
|
|
34
|
+
import { SAP_PROGRAM_ID, SapDependencyError, } from './types.js';
|
|
35
|
+
let _deps = null;
|
|
36
|
+
/** @internal Resolve all peer deps once, throw clear errors on missing packages. */
|
|
37
|
+
function resolveDeps() {
|
|
38
|
+
if (_deps)
|
|
39
|
+
return _deps;
|
|
40
|
+
let Connection;
|
|
41
|
+
let AnchorProvider;
|
|
42
|
+
let SapClient;
|
|
43
|
+
let PublicKey;
|
|
44
|
+
try {
|
|
45
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
46
|
+
const web3 = require('@solana/web3.js');
|
|
47
|
+
Connection = web3.Connection;
|
|
48
|
+
PublicKey = web3.PublicKey;
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
throw new SapDependencyError('@solana/web3.js');
|
|
52
|
+
}
|
|
53
|
+
try {
|
|
54
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
55
|
+
const anchor = require('@coral-xyz/anchor');
|
|
56
|
+
AnchorProvider = anchor.AnchorProvider;
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
throw new SapDependencyError('@coral-xyz/anchor');
|
|
60
|
+
}
|
|
61
|
+
try {
|
|
62
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
63
|
+
const sapSdk = require('@oobe-protocol-labs/synapse-sap-sdk');
|
|
64
|
+
SapClient = sapSdk.SapClient;
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
throw new SapDependencyError('@oobe-protocol-labs/synapse-sap-sdk');
|
|
68
|
+
}
|
|
69
|
+
_deps = { Connection, AnchorProvider, SapClient, PublicKey };
|
|
70
|
+
return _deps;
|
|
71
|
+
}
|
|
72
|
+
/* ═══════════════════════════════════════════════════════════════
|
|
73
|
+
* SynapseAnchorSap
|
|
74
|
+
* ═══════════════════════════════════════════════════════════════ */
|
|
75
|
+
/**
|
|
76
|
+
* Bridge between Synapse Client SDK and the SAP SDK.
|
|
77
|
+
*
|
|
78
|
+
* Resolves Synapse network endpoints automatically, creates an
|
|
79
|
+
* Anchor provider, and initializes a `SapClient` — all in a single
|
|
80
|
+
* synchronous factory call.
|
|
81
|
+
*
|
|
82
|
+
* All `SapClient` module accessors (`agent`, `builder`, `session`,
|
|
83
|
+
* `escrow`, `tools`, `discovery`, `feedback`, `attestation`) are
|
|
84
|
+
* proxied as first-class getters for ergonomic access.
|
|
85
|
+
*
|
|
86
|
+
* @example Registration flow
|
|
87
|
+
* ```ts
|
|
88
|
+
* const sap = SynapseAnchorSap.create({ wallet });
|
|
89
|
+
*
|
|
90
|
+
* // Using the fluent builder
|
|
91
|
+
* await sap.builder
|
|
92
|
+
* .agent('DeFi Bot')
|
|
93
|
+
* .description('Jupiter + Raydium swap agent')
|
|
94
|
+
* .addCapability('jupiter:swap', { protocol: 'jupiter', version: '6.0' })
|
|
95
|
+
* .addPricingTier({
|
|
96
|
+
* tierId: 'standard',
|
|
97
|
+
* pricePerCall: 10_000,
|
|
98
|
+
* rateLimit: 60,
|
|
99
|
+
* tokenType: 'sol',
|
|
100
|
+
* settlementMode: 'x402',
|
|
101
|
+
* })
|
|
102
|
+
* .register();
|
|
103
|
+
* ```
|
|
104
|
+
*
|
|
105
|
+
* @example Discovery
|
|
106
|
+
* ```ts
|
|
107
|
+
* const agents = await sap.discovery.findByCapability('jupiter:swap');
|
|
108
|
+
* ```
|
|
109
|
+
*
|
|
110
|
+
* @example Memory session
|
|
111
|
+
* ```ts
|
|
112
|
+
* const session = await sap.session.start('conv-001');
|
|
113
|
+
* await sap.session.write(session, 'User requested SOL→USDC swap');
|
|
114
|
+
* const entries = await sap.session.readLatest(session);
|
|
115
|
+
* await sap.session.seal(session);
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
118
|
+
export class SynapseAnchorSap {
|
|
119
|
+
/**
|
|
120
|
+
* The underlying `SapClient` from `@oobe-protocol-labs/synapse-sap-sdk`.
|
|
121
|
+
*
|
|
122
|
+
* Access any SapClient method directly when the proxy getters
|
|
123
|
+
* don't cover your use case.
|
|
124
|
+
*/
|
|
125
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
126
|
+
sapClient;
|
|
127
|
+
/** The resolved Synapse endpoint used for this connection. */
|
|
128
|
+
endpoint;
|
|
129
|
+
/** The SAP program ID in use. */
|
|
130
|
+
programId;
|
|
131
|
+
/** Wallet public key as base58 string. */
|
|
132
|
+
walletPubkey;
|
|
133
|
+
/** The Anchor provider instance (for advanced use). */
|
|
134
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
135
|
+
provider;
|
|
136
|
+
/** The Solana Connection instance (for advanced use). */
|
|
137
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
138
|
+
connection;
|
|
139
|
+
/* ── Private constructor ─────────────────────────────────── */
|
|
140
|
+
constructor(
|
|
141
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
142
|
+
sapClient, endpoint, programId, walletPubkey,
|
|
143
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
144
|
+
provider,
|
|
145
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
146
|
+
connection) {
|
|
147
|
+
this.sapClient = sapClient;
|
|
148
|
+
this.endpoint = endpoint;
|
|
149
|
+
this.programId = programId;
|
|
150
|
+
this.walletPubkey = walletPubkey;
|
|
151
|
+
this.provider = provider;
|
|
152
|
+
this.connection = connection;
|
|
153
|
+
}
|
|
154
|
+
/* ── Factory: create ─────────────────────────────────────── */
|
|
155
|
+
/**
|
|
156
|
+
* Create a `SynapseAnchorSap` instance.
|
|
157
|
+
*
|
|
158
|
+
* Resolves the Synapse endpoint for the given network/region,
|
|
159
|
+
* creates an Anchor provider, and initializes a SapClient.
|
|
160
|
+
*
|
|
161
|
+
* @param config - Bridge configuration (wallet + optional overrides)
|
|
162
|
+
* @returns Fully-initialized SAP bridge
|
|
163
|
+
* @throws {@link SapDependencyError} if peer dependencies are missing
|
|
164
|
+
*
|
|
165
|
+
* @example
|
|
166
|
+
* ```ts
|
|
167
|
+
* import { SynapseAnchorSap } from '@oobe-protocol-labs/synapse-client-sdk/ai/sap';
|
|
168
|
+
* import { SynapseNetwork } from '@oobe-protocol-labs/synapse-client-sdk/utils';
|
|
169
|
+
*
|
|
170
|
+
* const sap = SynapseAnchorSap.create({
|
|
171
|
+
* wallet,
|
|
172
|
+
* network: SynapseNetwork.Mainnet,
|
|
173
|
+
* commitment: 'confirmed',
|
|
174
|
+
* });
|
|
175
|
+
* ```
|
|
176
|
+
*/
|
|
177
|
+
static create(config) {
|
|
178
|
+
const { wallet, network = SynapseNetwork.Mainnet, region = SynapseRegion.US, rpcEndpoint, programId = SAP_PROGRAM_ID, commitment = 'confirmed', skipPreflight = false, debug = false, } = config;
|
|
179
|
+
// ── Resolve peer dependencies ─────────────────────────
|
|
180
|
+
const deps = resolveDeps();
|
|
181
|
+
// ── Resolve Synapse endpoint ──────────────────────────
|
|
182
|
+
const endpoint = resolveEndpoint(network, region);
|
|
183
|
+
const rpc = rpcEndpoint ?? endpoint.rpc;
|
|
184
|
+
if (debug) {
|
|
185
|
+
console.log(`[SynapseAnchorSap] connecting to ${rpc} (${network}:${region})`);
|
|
186
|
+
}
|
|
187
|
+
// ── Create Solana Connection ──────────────────────────
|
|
188
|
+
const connection = new deps.Connection(rpc, { commitment });
|
|
189
|
+
// ── Create Anchor Provider ────────────────────────────
|
|
190
|
+
const provider = new deps.AnchorProvider(connection, wallet, {
|
|
191
|
+
commitment,
|
|
192
|
+
skipPreflight,
|
|
193
|
+
});
|
|
194
|
+
// ── Create SapClient ──────────────────────────────────
|
|
195
|
+
const sapClient = deps.SapClient.from(provider, programId);
|
|
196
|
+
const walletPubkey = wallet.publicKey.toBase58();
|
|
197
|
+
if (debug) {
|
|
198
|
+
console.log(`[SynapseAnchorSap] initialized — wallet: ${walletPubkey}, program: ${programId}`);
|
|
199
|
+
}
|
|
200
|
+
return new SynapseAnchorSap(sapClient, endpoint, programId, walletPubkey, provider, connection);
|
|
201
|
+
}
|
|
202
|
+
/* ── Factory: fromSynapseClient ──────────────────────────── */
|
|
203
|
+
/**
|
|
204
|
+
* Create from an existing {@link SynapseClient}.
|
|
205
|
+
*
|
|
206
|
+
* Extracts the RPC endpoint URL from the client's configuration
|
|
207
|
+
* so you don't have to specify it twice.
|
|
208
|
+
*
|
|
209
|
+
* @param synapseClient - An initialized SynapseClient instance
|
|
210
|
+
* @param wallet - Wallet with signing capability
|
|
211
|
+
* @param opts - Optional overrides for programId, commitment, etc.
|
|
212
|
+
* @returns Fully-initialized SAP bridge using the same RPC endpoint
|
|
213
|
+
*
|
|
214
|
+
* @example
|
|
215
|
+
* ```ts
|
|
216
|
+
* import { SynapseClient } from '@oobe-protocol-labs/synapse-client-sdk';
|
|
217
|
+
* import { SynapseAnchorSap } from '@oobe-protocol-labs/synapse-client-sdk/ai/sap';
|
|
218
|
+
*
|
|
219
|
+
* const synapse = new SynapseClient({ endpoint: process.env.SYNAPSE_RPC! });
|
|
220
|
+
* const sap = SynapseAnchorSap.fromSynapseClient(synapse, wallet);
|
|
221
|
+
*
|
|
222
|
+
* // Now both synapse and sap share the same RPC endpoint
|
|
223
|
+
* await sap.agent.register({ ... });
|
|
224
|
+
* ```
|
|
225
|
+
*/
|
|
226
|
+
static fromSynapseClient(synapseClient, wallet, opts) {
|
|
227
|
+
// Extract endpoint from SynapseClient's internal config.
|
|
228
|
+
// cfg is private, so we use a known-safe internal access pattern.
|
|
229
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
230
|
+
const clientAny = synapseClient;
|
|
231
|
+
const rpcEndpoint = clientAny.cfg?.endpoint ??
|
|
232
|
+
clientAny.config?.endpoint ??
|
|
233
|
+
clientAny._config?.endpoint;
|
|
234
|
+
if (!rpcEndpoint) {
|
|
235
|
+
throw new Error('Could not extract RPC endpoint from SynapseClient. ' +
|
|
236
|
+
'Use SynapseAnchorSap.create({ wallet, rpcEndpoint: "..." }) instead.');
|
|
237
|
+
}
|
|
238
|
+
return SynapseAnchorSap.create({
|
|
239
|
+
wallet,
|
|
240
|
+
rpcEndpoint,
|
|
241
|
+
programId: opts?.programId,
|
|
242
|
+
commitment: opts?.commitment ?? 'confirmed',
|
|
243
|
+
skipPreflight: opts?.skipPreflight,
|
|
244
|
+
debug: opts?.debug,
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
/* ═══════════════════════════════════════════════════════════
|
|
248
|
+
* SapClient module accessors
|
|
249
|
+
*
|
|
250
|
+
* These proxy to the underlying SapClient's lazy getters.
|
|
251
|
+
* Each module is instantiated on first access and cached
|
|
252
|
+
* by SapClient internally.
|
|
253
|
+
* ═══════════════════════════════════════════════════════════ */
|
|
254
|
+
/**
|
|
255
|
+
* Agent lifecycle — register, update, deactivate, reactivate, close,
|
|
256
|
+
* reportCalls, updateReputation, fetch, fetchStats.
|
|
257
|
+
*/
|
|
258
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
259
|
+
get agent() {
|
|
260
|
+
return this.sapClient.agent;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Fluent agent builder — `.agent('Name').description('...').addCapability(...)
|
|
264
|
+
* .addPricingTier(...).register()`.
|
|
265
|
+
*
|
|
266
|
+
* Returns a **new** builder on every access (one-shot flow).
|
|
267
|
+
*/
|
|
268
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
269
|
+
get builder() {
|
|
270
|
+
return this.sapClient.builder;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Memory sessions — start, write, readLatest, seal, close.
|
|
274
|
+
* Composes VaultModule + LedgerModule into a single API.
|
|
275
|
+
*/
|
|
276
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
277
|
+
get session() {
|
|
278
|
+
return this.sapClient.session;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Escrow management — create, deposit, settle, withdraw, close.
|
|
282
|
+
* Handles x402 micropayment flows.
|
|
283
|
+
*/
|
|
284
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
285
|
+
get escrow() {
|
|
286
|
+
return this.sapClient.escrow;
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Tool schema registry — publish, inscribe, update, close.
|
|
290
|
+
*/
|
|
291
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
292
|
+
get tools() {
|
|
293
|
+
return this.sapClient.tools;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Discovery — find agents by capability, protocol, wallet.
|
|
297
|
+
* Composes Agent + Indexing modules.
|
|
298
|
+
*/
|
|
299
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
300
|
+
get discovery() {
|
|
301
|
+
return this.sapClient.discovery;
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Feedback — give, update, revoke trustless on-chain reviews.
|
|
305
|
+
*/
|
|
306
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
307
|
+
get feedback() {
|
|
308
|
+
return this.sapClient.feedback;
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Attestation — create and revoke web-of-trust attestations.
|
|
312
|
+
*/
|
|
313
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
314
|
+
get attestation() {
|
|
315
|
+
return this.sapClient.attestation;
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Direct access to the underlying Anchor `Program` instance.
|
|
319
|
+
* For low-level RPC calls or custom instruction building.
|
|
320
|
+
*/
|
|
321
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
322
|
+
get program() {
|
|
323
|
+
return this.sapClient.program;
|
|
324
|
+
}
|
|
325
|
+
/** Whether the bridge is fully initialized. */
|
|
326
|
+
get isReady() {
|
|
327
|
+
return this.sapClient != null;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../src/ai/sap/client.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,61 +1,78 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module ai/sap
|
|
3
|
-
* @description Solana Agent Protocol (SAP) —
|
|
3
|
+
* @description Solana Agent Protocol (SAP) — Integration bridge for `@oobe-protocol-labs/synapse-sap-sdk`.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* - `discovery` — On-chain agent search via `getProgramAccounts`
|
|
10
|
-
* - `adapter` — {@link OnChainPersistenceAdapter} for {@link AgentRegistry}
|
|
5
|
+
* This module provides a **thin integration layer** that connects the
|
|
6
|
+
* Synapse Client SDK's infrastructure (network resolution, endpoint
|
|
7
|
+
* registry, HMR-safe singletons) with the standalone SAP SDK for
|
|
8
|
+
* on-chain agent operations.
|
|
11
9
|
*
|
|
12
|
-
*
|
|
10
|
+
* ## What moved
|
|
11
|
+
*
|
|
12
|
+
* The full SAP protocol implementation (PDA derivation, Borsh
|
|
13
|
+
* serialization, instruction builders, discovery, validation,
|
|
14
|
+
* subnetworks, scoring) now lives in:
|
|
15
|
+
*
|
|
16
|
+
* - **Protocol (Anchor/Rust)**: https://github.com/OOBE-PROTOCOL/synapse-sap
|
|
17
|
+
* - **SAP SDK (TypeScript)**: https://github.com/OOBE-PROTOCOL/synapse-sap-sdk
|
|
18
|
+
* → `@oobe-protocol-labs/synapse-sap-sdk`
|
|
19
|
+
*
|
|
20
|
+
* ## What this module provides
|
|
21
|
+
*
|
|
22
|
+
* - {@link SynapseAnchorSap} — Bridge class: resolves Synapse endpoints,
|
|
23
|
+
* creates an Anchor provider, and initializes a `SapClient` in one call.
|
|
24
|
+
* Exposes all SapClient modules as getters (`agent`, `builder`, `session`,
|
|
25
|
+
* `escrow`, `tools`, `discovery`, `feedback`, `attestation`).
|
|
26
|
+
*
|
|
27
|
+
* - {@link createSapProvider} — HMR-safe singleton factory for Next.js
|
|
28
|
+
* server-side routes (same pattern as `createSynapseProvider`).
|
|
29
|
+
*
|
|
30
|
+
* - {@link createSapContextBlueprint} — React integration blueprint with
|
|
31
|
+
* typed context value, state manager, and subscription support — all
|
|
32
|
+
* without a React dependency.
|
|
33
|
+
*
|
|
34
|
+
* ## Quick start
|
|
35
|
+
*
|
|
36
|
+
* @example Standalone (Node.js / scripts)
|
|
37
|
+
* ```ts
|
|
38
|
+
* import { SynapseAnchorSap } from '@oobe-protocol-labs/synapse-client-sdk/ai/sap';
|
|
39
|
+
*
|
|
40
|
+
* const sap = SynapseAnchorSap.create({ wallet });
|
|
41
|
+
* await sap.builder
|
|
42
|
+
* .agent('TradeBot')
|
|
43
|
+
* .description('Jupiter swap agent')
|
|
44
|
+
* .addCapability('jupiter:swap', { protocol: 'jupiter', version: '6.0' })
|
|
45
|
+
* .register();
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* @example From existing SynapseClient
|
|
13
49
|
* ```ts
|
|
14
|
-
* import {
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* const
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* });
|
|
34
|
-
*
|
|
35
|
-
* // 3. Discover agents on-chain
|
|
36
|
-
* const discovery = new SAPDiscovery(client, { programId });
|
|
37
|
-
* const agents = await discovery.find({ capability: 'jupiter:swap', minReputation: 700 });
|
|
38
|
-
*
|
|
39
|
-
* // 4. Use as persistence adapter for AgentRegistry
|
|
40
|
-
* const adapter = new OnChainPersistenceAdapter(client, { programId });
|
|
41
|
-
* const registry = new AgentRegistry({ adapter });
|
|
50
|
+
* import { SynapseClient } from '@oobe-protocol-labs/synapse-client-sdk';
|
|
51
|
+
* import { SynapseAnchorSap } from '@oobe-protocol-labs/synapse-client-sdk/ai/sap';
|
|
52
|
+
*
|
|
53
|
+
* const client = new SynapseClient({ endpoint: process.env.SYNAPSE_RPC! });
|
|
54
|
+
* const sap = SynapseAnchorSap.fromSynapseClient(client, wallet);
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* @example Next.js server-side (HMR-safe)
|
|
58
|
+
* ```ts
|
|
59
|
+
* import { createSapProvider } from '@oobe-protocol-labs/synapse-client-sdk/ai/sap';
|
|
60
|
+
* const getSap = createSapProvider(serverWallet, { network: SynapseNetwork.Mainnet });
|
|
61
|
+
* const sap = getSap();
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @example Next.js client-side (React context)
|
|
65
|
+
* ```tsx
|
|
66
|
+
* import { createSapContextBlueprint } from '@oobe-protocol-labs/synapse-client-sdk/ai/sap';
|
|
67
|
+
* const blueprint = createSapContextBlueprint({ network: SynapseNetwork.Mainnet });
|
|
68
|
+
* // Wire into your React provider — see provider.ts JSDoc for full example
|
|
42
69
|
* ```
|
|
43
70
|
*
|
|
44
|
-
* @since 1.
|
|
71
|
+
* @since 2.1.0
|
|
45
72
|
*/
|
|
46
|
-
export type {
|
|
47
|
-
export {
|
|
48
|
-
export
|
|
49
|
-
export {
|
|
50
|
-
export {
|
|
51
|
-
export { SAPDiscovery, SAPDiscoveryError, } from './discovery';
|
|
52
|
-
export { OnChainPersistenceAdapter, } from './adapter';
|
|
53
|
-
export type { CapabilityCategory, CapabilityIOSchema, CapabilityDefinition, } from './registry';
|
|
54
|
-
export { SAPCapabilityRegistry, } from './registry';
|
|
55
|
-
export type { ValidationSeverity, ValidationIssue, ValidationReport, SAPValidatorConfig, } from './validator';
|
|
56
|
-
export { SAPValidator, SAPValidationError, } from './validator';
|
|
57
|
-
export type { SelectionStrategy, SubnetworkConfig, CapabilityAssignment, SubnetworkResult, SubnetworkHealth, } from './subnetwork';
|
|
58
|
-
export { SubnetworkBuilder, } from './subnetwork';
|
|
59
|
-
export type { HealthScoreBreakdown, AgentHealthScore, NetworkAnalytics, } from './scoring';
|
|
60
|
-
export { computeAgentHealthScore, computeNetworkAnalytics, } from './scoring';
|
|
73
|
+
export type { SapWallet, SapCommitment, SapBridgeConfig, SapProviderConfig, SapContextValue, } from './types';
|
|
74
|
+
export { SAP_PROGRAM_ID, SapDependencyError, } from './types';
|
|
75
|
+
export { SynapseAnchorSap } from './client';
|
|
76
|
+
export type { SapContextBlueprint, SapStateManager, } from './provider';
|
|
77
|
+
export { createSapProvider, createSapContextBlueprint, } from './provider';
|
|
61
78
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ai/sap/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ai/sap/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuEG;AAGH,YAAY,EACV,SAAS,EACT,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,eAAe,GAChB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,cAAc,EACd,kBAAkB,GACnB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAG5C,YAAY,EACV,mBAAmB,EACnB,eAAe,GAChB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,YAAY,CAAC"}
|
package/dist/esm/ai/sap/index.js
CHANGED
|
@@ -1,58 +1,77 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module ai/sap
|
|
3
|
-
* @description Solana Agent Protocol (SAP) —
|
|
3
|
+
* @description Solana Agent Protocol (SAP) — Integration bridge for `@oobe-protocol-labs/synapse-sap-sdk`.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* - `discovery` — On-chain agent search via `getProgramAccounts`
|
|
10
|
-
* - `adapter` — {@link OnChainPersistenceAdapter} for {@link AgentRegistry}
|
|
5
|
+
* This module provides a **thin integration layer** that connects the
|
|
6
|
+
* Synapse Client SDK's infrastructure (network resolution, endpoint
|
|
7
|
+
* registry, HMR-safe singletons) with the standalone SAP SDK for
|
|
8
|
+
* on-chain agent operations.
|
|
11
9
|
*
|
|
12
|
-
*
|
|
10
|
+
* ## What moved
|
|
11
|
+
*
|
|
12
|
+
* The full SAP protocol implementation (PDA derivation, Borsh
|
|
13
|
+
* serialization, instruction builders, discovery, validation,
|
|
14
|
+
* subnetworks, scoring) now lives in:
|
|
15
|
+
*
|
|
16
|
+
* - **Protocol (Anchor/Rust)**: https://github.com/OOBE-PROTOCOL/synapse-sap
|
|
17
|
+
* - **SAP SDK (TypeScript)**: https://github.com/OOBE-PROTOCOL/synapse-sap-sdk
|
|
18
|
+
* → `@oobe-protocol-labs/synapse-sap-sdk`
|
|
19
|
+
*
|
|
20
|
+
* ## What this module provides
|
|
21
|
+
*
|
|
22
|
+
* - {@link SynapseAnchorSap} — Bridge class: resolves Synapse endpoints,
|
|
23
|
+
* creates an Anchor provider, and initializes a `SapClient` in one call.
|
|
24
|
+
* Exposes all SapClient modules as getters (`agent`, `builder`, `session`,
|
|
25
|
+
* `escrow`, `tools`, `discovery`, `feedback`, `attestation`).
|
|
26
|
+
*
|
|
27
|
+
* - {@link createSapProvider} — HMR-safe singleton factory for Next.js
|
|
28
|
+
* server-side routes (same pattern as `createSynapseProvider`).
|
|
29
|
+
*
|
|
30
|
+
* - {@link createSapContextBlueprint} — React integration blueprint with
|
|
31
|
+
* typed context value, state manager, and subscription support — all
|
|
32
|
+
* without a React dependency.
|
|
33
|
+
*
|
|
34
|
+
* ## Quick start
|
|
35
|
+
*
|
|
36
|
+
* @example Standalone (Node.js / scripts)
|
|
37
|
+
* ```ts
|
|
38
|
+
* import { SynapseAnchorSap } from '@oobe-protocol-labs/synapse-client-sdk/ai/sap';
|
|
39
|
+
*
|
|
40
|
+
* const sap = SynapseAnchorSap.create({ wallet });
|
|
41
|
+
* await sap.builder
|
|
42
|
+
* .agent('TradeBot')
|
|
43
|
+
* .description('Jupiter swap agent')
|
|
44
|
+
* .addCapability('jupiter:swap', { protocol: 'jupiter', version: '6.0' })
|
|
45
|
+
* .register();
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* @example From existing SynapseClient
|
|
13
49
|
* ```ts
|
|
14
|
-
* import {
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* const
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* });
|
|
34
|
-
*
|
|
35
|
-
* // 3. Discover agents on-chain
|
|
36
|
-
* const discovery = new SAPDiscovery(client, { programId });
|
|
37
|
-
* const agents = await discovery.find({ capability: 'jupiter:swap', minReputation: 700 });
|
|
38
|
-
*
|
|
39
|
-
* // 4. Use as persistence adapter for AgentRegistry
|
|
40
|
-
* const adapter = new OnChainPersistenceAdapter(client, { programId });
|
|
41
|
-
* const registry = new AgentRegistry({ adapter });
|
|
50
|
+
* import { SynapseClient } from '@oobe-protocol-labs/synapse-client-sdk';
|
|
51
|
+
* import { SynapseAnchorSap } from '@oobe-protocol-labs/synapse-client-sdk/ai/sap';
|
|
52
|
+
*
|
|
53
|
+
* const client = new SynapseClient({ endpoint: process.env.SYNAPSE_RPC! });
|
|
54
|
+
* const sap = SynapseAnchorSap.fromSynapseClient(client, wallet);
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* @example Next.js server-side (HMR-safe)
|
|
58
|
+
* ```ts
|
|
59
|
+
* import { createSapProvider } from '@oobe-protocol-labs/synapse-client-sdk/ai/sap';
|
|
60
|
+
* const getSap = createSapProvider(serverWallet, { network: SynapseNetwork.Mainnet });
|
|
61
|
+
* const sap = getSap();
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @example Next.js client-side (React context)
|
|
65
|
+
* ```tsx
|
|
66
|
+
* import { createSapContextBlueprint } from '@oobe-protocol-labs/synapse-client-sdk/ai/sap';
|
|
67
|
+
* const blueprint = createSapContextBlueprint({ network: SynapseNetwork.Mainnet });
|
|
68
|
+
* // Wire into your React provider — see provider.ts JSDoc for full example
|
|
42
69
|
* ```
|
|
43
70
|
*
|
|
44
|
-
* @since 1.
|
|
71
|
+
* @since 2.1.0
|
|
45
72
|
*/
|
|
46
|
-
export {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
export {
|
|
50
|
-
/* ── Discovery ── */
|
|
51
|
-
export { SAPDiscovery, SAPDiscoveryError, } from './discovery.js';
|
|
52
|
-
/* ── Adapter ── */
|
|
53
|
-
export { OnChainPersistenceAdapter, } from './adapter.js';
|
|
54
|
-
export { SAPCapabilityRegistry, } from './registry.js';
|
|
55
|
-
export { SAPValidator, SAPValidationError, } from './validator.js';
|
|
56
|
-
export { SubnetworkBuilder, } from './subnetwork.js';
|
|
57
|
-
export { computeAgentHealthScore, computeNetworkAnalytics, } from './scoring.js';
|
|
73
|
+
export { SAP_PROGRAM_ID, SapDependencyError, } from './types.js';
|
|
74
|
+
/* ── Client bridge ── */
|
|
75
|
+
export { SynapseAnchorSap } from './client.js';
|
|
76
|
+
export { createSapProvider, createSapContextBlueprint, } from './provider.js';
|
|
58
77
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ai/sap/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ai/sap/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuEG;AAWH,OAAO,EACL,cAAc,EACd,kBAAkB,GACnB,MAAM,SAAS,CAAC;AAEjB,yBAAyB;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAQ5C,OAAO,EACL,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,YAAY,CAAC"}
|