@tinycloud/node-sdk 3.8.0-beta.1 → 3.8.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/{TinyCloudNode-Ckqu_fqH.d.ts → TinyCloudNode-DnD-SH6t.d.ts} +26 -3
  2. package/dist/{TinyCloudNode-DDfx8Fx5.d.cts → TinyCloudNode-Dy65bxqs.d.cts} +26 -3
  3. package/dist/{authority-DcyJpajL.d.ts → authority-BQnTX3fI.d.ts} +20 -4
  4. package/dist/{authority-BwM_s3Ya.d.cts → authority-Rbye1U4o.d.cts} +20 -4
  5. package/dist/core.cjs +189 -25
  6. package/dist/core.cjs.map +1 -1
  7. package/dist/core.d.cts +5 -4
  8. package/dist/core.d.ts +5 -4
  9. package/dist/core.js +183 -21
  10. package/dist/core.js.map +1 -1
  11. package/dist/credentials-core.d.cts +1 -1
  12. package/dist/credentials-core.d.ts +1 -1
  13. package/dist/credentials.d.cts +1 -1
  14. package/dist/credentials.d.ts +1 -1
  15. package/dist/{delegation-0LKZkmP2.d.cts → delegation-Ckc3UETl.d.cts} +1 -1
  16. package/dist/{delegation-0LKZkmP2.d.ts → delegation-Ckc3UETl.d.ts} +1 -1
  17. package/dist/encryption-keys.d.cts +2 -2
  18. package/dist/encryption-keys.d.ts +2 -2
  19. package/dist/index.cjs +239 -37
  20. package/dist/index.cjs.map +1 -1
  21. package/dist/index.d.cts +4 -3
  22. package/dist/index.d.ts +4 -3
  23. package/dist/index.js +226 -24
  24. package/dist/index.js.map +1 -1
  25. package/dist/replication/authority.cjs +39 -0
  26. package/dist/replication/authority.cjs.map +1 -1
  27. package/dist/replication/authority.d.cts +4 -3
  28. package/dist/replication/authority.d.ts +4 -3
  29. package/dist/replication/authority.js +38 -0
  30. package/dist/replication/authority.js.map +1 -1
  31. package/dist/replication/runtime.cjs +1 -0
  32. package/dist/replication/runtime.cjs.map +1 -1
  33. package/dist/replication/runtime.d.cts +1 -1
  34. package/dist/replication/runtime.d.ts +1 -1
  35. package/dist/replication/runtime.js +1 -0
  36. package/dist/replication/runtime.js.map +1 -1
  37. package/dist/{runtime-v62FzQHz.d.ts → runtime-CO4VXnPq.d.ts} +2 -1
  38. package/dist/{runtime-D1o9Eybt.d.cts → runtime-mRhSu-vJ.d.cts} +2 -1
  39. package/package.json +4 -4
package/dist/index.d.cts CHANGED
@@ -1,12 +1,13 @@
1
1
  import { ISigner, Bytes, IWasmBindings, PersistedSessionProof, ISessionManager } from '@tinycloud/sdk-core';
2
- export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, AccountApplication, AccountApplicationListOptions, AccountApplicationRegisterOptions, AccountDelegation, AccountDelegationListOptions, AccountDelegationPage, AccountDelegationQueryOptions, AccountDelegationRecord, AccountDelegationResource, AccountDelegationRevokeOptions, AccountIndexEnsureResult, AccountIndexRebuildResult, AccountIndexStatus, AccountIndexedReadOptions, AccountService, AccountServiceConfig, AccountSpace, AccountSpaceListOptions, AccountStatus, AuthorityRefusal, AutoApproveSpaceCreationHandler, AutoRejectStrategy, AutoSignStrategy, BatchOptions, BatchResponse, BuildCanonicalDecryptRequestInput, BuildDecryptFactsInput, BuildDecryptInvocationInput, BuiltDecryptInvocation, CallbackStrategy, CanonicalAddress, CanonicalDecryptRequest, CanonicalJson, CanonicalParsedNetworkId, CapabilityEntry, CapabilityKeyRegistry, CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, CaveatedDelegationUnsupportedError, ClientSession, ColumnInfo, ComposeManifestOptions, ComposedManifestRequest, CreateDelegationParams, DECRYPT_ACTION, DECRYPT_FACT_TYPE, DECRYPT_RESULT_TYPE, DEFAULT_ENCRYPTION_ALG, DEFAULT_KEY_VERSION, DEFAULT_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, DEFAULT_SIGNED_READ_URL_EXPIRY_MS, DataVaultConfig, DataVaultService, DatabaseHandle, DecryptCapabilityProof, DecryptEnvelopeOptions, DecryptInvocationFact, DecryptInvocationSigner, DecryptRequestBody, DecryptResponseBody, DecryptTransport, DecryptTransportResponseError, DelegateReceivedShareParams, DelegatedShareAccess, Delegation, DelegationChain, DelegationChainV2, DelegationDirection, DelegationError, DelegationErrorCode, DelegationErrorCodes, DelegationFilters, DelegationManager, DelegationManagerConfig, DelegationRecord, DelegationResult, DelegationRevocationReceipt, DidCacheKeyOptions, DidEqualsOptions, DiscoverNetworkInput, DiscoveredNetwork, DiscoverySource, DuckDbAction, DuckDbActionType, DuckDbBatchOptions, DuckDbBatchResponse, DuckDbDatabaseHandle, DuckDbExecuteOptions, DuckDbExecuteResponse, DuckDbOptions, DuckDbQueryOptions, DuckDbQueryResponse, DuckDbService, DuckDbServiceConfig, DuckDbStatement, DuckDbValue, ENCRYPTION_NETWORK_URN_PREFIX, ENCRYPTION_SERVICE, ENCRYPTION_SERVICE_SHORT, ENVELOPE_VERSION, EncodedShareData, EncryptToNetworkInput, EncryptToNetworkOptions, EncryptToNetworkResult, EncryptionCrypto, EncryptionError, EncryptionErrorInput, EncryptionService, EncryptionServiceConfig, ExecuteOptions, ExecuteResponse, Extension, FetchFunction, GenerateShareParams, HookEvent, HookServiceName, HookStreamEvent, HookSubscription, HookWebhookListOptions, HookWebhookRecord, HookWebhookRegistration, HookWebhookScope, HookWebhookUnregisterOptions, HooksService, HooksServiceConfig, ICapabilityKeyRegistry, IDataVaultService, IDatabaseHandle, IDuckDbDatabaseHandle, IDuckDbService, IENSResolver, IEncryptionService, IHooksService, IKVService, INotificationHandler, IPrefixedKVService, ISQLService, ISecretsService, ISessionManager, ISessionStorage, ISharingService, ISigner, ISpace, ISpaceCreationHandler, ISpaceScopedDelegations, ISpaceScopedSharing, ISpaceService, IStorageService, IUserAuthorization, IWasmBindings, IdentityParseError, IngestOptions, InlineEncryptedEnvelope, InvokeFunction, JWK, KVBatchReadResponse, KVCreateSignedReadUrlOptions, KVListPage, KVReadThrough, KVReplicaHandle, KVReplicaSpec, KVReplicaStorage, KVReplicationController, KVReplicationDeps, KVResponse, KVService, KVServiceConfig, KVSignedReadUrlResponse, KeyInfo, KeyProvider, KeyType, LocalGetResult, LocalListResult, LocalReadMeta, LocalReplicaStatus, LocalSyncResult, MAX_SECRET_SCOPE_LENGTH, Manifest, ManifestDefaults, ManifestRegistryRecord, ManifestSecretActions, ManifestValidationError, NETWORK_NAME_PATTERN, NetworkDescriptor, NetworkIdError, NodeDescriptorFetcher, OpenKeyCallbackStrategy, OpenKeySigningRequestBody, OpenKeySigningResponseBody, OpenKeySigningStrategyOptions, OwnerDelegationPermission, ParsedNetworkId, ParsedSecretCatalogKey, PendingWriteRecord, PendingWriteState, PendingWriteStore, PermissionEntry, PermissionNotInManifestError, PersistedSessionData, PinnedKey, PkhDidParts, PrefixedKVService, ProtocolMismatchError, PurgeTarget, QueryOptions, QueryResponse, RandomReceiverKeyInput, ReceiveOptions, ReceiverKeyPair, ReceiverKeySigner, RegisterBatchSuccess, RegisterPolicyV3Input, RegisterPolicyV3Receipt, ReplicaAuthorityState, ReplicaCoverage, ReplicaDevice, ReplicaGatedHandle, ReplicaGrantInfo, ReplicaInspectedStatus, ReplicaState, ReplicaStatusEntry, ReplicationAuthority, ReplicationControl, ReplicationEvent, ReplicationIdentity, ReplicationOptions, ReplicationPurgeReport, ReplicationReason, ReplicationScheduler, ResolvedCapabilities, ResolvedDelegate, ResolvedReplicationOptions, ResolvedSecretPath, ResourceCapability, SECRET_NAME_RE, SECRET_SCOPE_RE, SQLAction, SQLActionType, SQLService, SQLServiceConfig, STORAGE_FULL_MESSAGE, STORAGE_MANAGE_URL, STORAGE_WRITE_TOO_LARGE_MESSAGE, SchemaInfo, SecretCatalogEntry, SecretPayload, SecretPutOptions, SecretScopeOptions, SecretsError, SecretsService, ServiceContext, ServiceContextConfig, ServiceSession, SessionExpiredError, ShareAccess, ShareLink, ShareLinkData, ShareSchema, SharingService, SharingServiceConfig, SignCallback, SignInOptions, SignRequest, SignResponse, SignedReceiverKeyInput, SilentNotificationHandler, Space, SpaceAbilitiesMap, SpaceConfig, SpaceCreationContext, SpaceErrorCode, SpaceErrorCodes, SpaceInfo, SpaceOwnership, SpaceService, SpaceServiceConfig, SqlStatement, SqlValue, StorageAccountUsage, StorageFullEvent, StorageStatus, StorageStatusOptions, StorageUsage, StorageUsageState, StoredDelegationChain, SubscribeOptions, TC832_RESERVED_SCOPES, TableInfo, TelemetryConfig, TelemetryEventHandler, TinyCloud, TinyCloudConfig, TinyCloudDebugEnableOptions, TinyCloudDebugEvent, TinyCloudDebugLevel, TinyCloudDebugLogger, TinyCloudDebugTimer, TinyCloudSession, UnsupportedFeatureError, VAULT_PERMISSION_SERVICE, VaultCrypto, VaultEntry, VaultError, VaultGetOptions, VaultGrantOptions, VaultHeaders, VaultListOptions, VaultNetworkReadResult, VaultPublicSpaceKVActions, VaultPutOptions, VerifyDecryptResponseInput, VersionCheckError, ViewInfo, WasmVaultFunctions, WellKnownDescriptorFetcher, addressStorageKey, appSecretScope, buildCanonicalDecryptRequest, buildDecryptAttenuation, buildDecryptFacts, buildDecryptInvocation, buildNetworkId, buildSpaceUri, canonicalHashHex, canonicalSignedResponse, canonicalizeAddress, canonicalizeDid, canonicalizeDidUrl, canonicalizeEncryptionJson, canonicalizeNetworkId, canonicalizeSecretScope, checkDecryptInvocationInput, checkNodeInfo, clearTinyCloudDebugLogs, composeManifestRequest, createCapabilityKeyRegistry, createOpenKeyCallbackSigningStrategy, createSharingService, createSpaceService, createVaultCrypto, decryptEnvelopeWithKey, defaultSpaceCreationHandler, deriveSignedReceiverKey, didCacheKey, didEquals, disableTinyCloudDebug, discoverNetwork, enableTinyCloudDebug, encryptToNetwork, encryptionBase64Decode, encryptionBase64Encode, encryptionError, encryptionUtf8Decode, encryptionUtf8Encode, ensureNetworkUsableForDecrypt, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, generateRandomReceiverKey, getTinyCloudDebugLogs, hexDecode, hexEncode, installTinyCloudDebugGlobals, isCapabilitySubset, isEvmAddress, isNetworkId, isStorageFullError, loadManifest, makePkhSpaceId, makePublicSpaceId, networkDiscoveryKey, openWrappedKey, parseCanonicalNetworkId, parseExpiry, parseNetworkId, parsePkhDid, parseSecretCatalogKey, parseSpaceUri, pkhDid, principalDid, principalDidEquals, resolveManifest, resolveSecretListPrefix, resolveSecretPath, resourceCapabilitiesToSpaceAbilitiesMap, storageUsageState, tinyCloudDebugLogger, validateEnvelope, validateManifest, verifyDecryptResponse } from '@tinycloud/sdk-core';
2
+ export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, AccountApplication, AccountApplicationListOptions, AccountApplicationRegisterOptions, AccountDelegation, AccountDelegationListOptions, AccountDelegationPage, AccountDelegationQueryOptions, AccountDelegationRecord, AccountDelegationResource, AccountDelegationRevokeOptions, AccountIndexEnsureResult, AccountIndexRebuildResult, AccountIndexStatus, AccountIndexedReadOptions, AccountService, AccountServiceConfig, AccountSpace, AccountSpaceListOptions, AccountStatus, AuthorityRefusal, AutoApproveSpaceCreationHandler, AutoRejectStrategy, AutoSignStrategy, BatchOptions, BatchResponse, BuildCanonicalDecryptRequestInput, BuildDecryptFactsInput, BuildDecryptInvocationInput, BuiltDecryptInvocation, CallbackStrategy, CanonicalAddress, CanonicalDecryptRequest, CanonicalJson, CanonicalParsedNetworkId, CapabilityEntry, CapabilityKeyRegistry, CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, CaveatedDelegationUnsupportedError, ClientSession, ColumnInfo, ComposeManifestOptions, ComposedManifestRequest, CreateDelegationParams, DECRYPT_ACTION, DECRYPT_FACT_TYPE, DECRYPT_RESULT_TYPE, DEFAULT_ENCRYPTION_ALG, DEFAULT_KEY_VERSION, DEFAULT_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, DEFAULT_SIGNED_READ_URL_EXPIRY_MS, DataVaultConfig, DataVaultService, DatabaseHandle, DecryptCapabilityProof, DecryptEnvelopeOptions, DecryptInvocationFact, DecryptInvocationSigner, DecryptRequestBody, DecryptResponseBody, DecryptTransport, DecryptTransportResponseError, DelegateReceivedShareParams, DelegatedShareAccess, Delegation, DelegationChain, DelegationChainV2, DelegationDirection, DelegationError, DelegationErrorCode, DelegationErrorCodes, DelegationFilters, DelegationManager, DelegationManagerConfig, DelegationRecord, DelegationResult, DelegationRevocationReceipt, DidCacheKeyOptions, DidEqualsOptions, DiscoverNetworkInput, DiscoveredNetwork, DiscoverySource, DuckDbAction, DuckDbActionType, DuckDbBatchOptions, DuckDbBatchResponse, DuckDbDatabaseHandle, DuckDbExecuteOptions, DuckDbExecuteResponse, DuckDbOptions, DuckDbQueryOptions, DuckDbQueryResponse, DuckDbService, DuckDbServiceConfig, DuckDbStatement, DuckDbValue, ENCRYPTION_NETWORK_URN_PREFIX, ENCRYPTION_SERVICE, ENCRYPTION_SERVICE_SHORT, ENVELOPE_VERSION, EncodedShareData, EncryptToNetworkInput, EncryptToNetworkOptions, EncryptToNetworkResult, EncryptionCrypto, EncryptionError, EncryptionErrorInput, EncryptionService, EncryptionServiceConfig, ExecuteOptions, ExecuteResponse, Extension, FetchFunction, GenerateShareParams, HookEvent, HookServiceName, HookStreamEvent, HookSubscription, HookWebhookListOptions, HookWebhookRecord, HookWebhookRegistration, HookWebhookScope, HookWebhookUnregisterOptions, HooksService, HooksServiceConfig, ICapabilityKeyRegistry, IDataVaultService, IDatabaseHandle, IDuckDbDatabaseHandle, IDuckDbService, IENSResolver, IEncryptionService, IHooksService, IKVService, INotificationHandler, IPrefixedKVService, ISQLService, ISecretsService, ISessionManager, ISessionStorage, ISharingService, ISigner, ISpace, ISpaceCreationHandler, ISpaceScopedDelegations, ISpaceScopedSharing, ISpaceService, IStorageService, IUserAuthorization, IWasmBindings, IdentityParseError, IngestOptions, InlineEncryptedEnvelope, InvokeFunction, JWK, KVBatchReadResponse, KVCreateSignedReadUrlOptions, KVListPage, KVReadThrough, KVReplicaHandle, KVReplicaSpec, KVReplicaStorage, KVReplicationController, KVReplicationDeps, KVResponse, KVService, KVServiceConfig, KVSignedReadUrlResponse, KeyInfo, KeyProvider, KeyType, LocalGetResult, LocalListResult, LocalReadMeta, LocalReplicaStatus, LocalSyncResult, MAX_SECRET_SCOPE_LENGTH, Manifest, ManifestDefaults, ManifestRegistryRecord, ManifestSecretActions, ManifestValidationError, NETWORK_NAME_PATTERN, NetworkDescriptor, NetworkIdError, NodeDescriptorFetcher, OpenKeyCallbackStrategy, OpenKeySigningRequestBody, OpenKeySigningResponseBody, OpenKeySigningStrategyOptions, OwnerDelegationPermission, ParsedNetworkId, ParsedSecretCatalogKey, PendingWriteRecord, PendingWriteState, PendingWriteStore, PermissionEntry, PermissionNotInManifestError, PersistedSessionData, PinnedKey, PkhDidParts, PrefixedKVService, ProtocolMismatchError, PurgeTarget, QueryOptions, QueryResponse, RandomReceiverKeyInput, ReceiveOptions, ReceiverKeyPair, ReceiverKeySigner, RegisterBatchSuccess, RegisterPolicyV3Input, RegisterPolicyV3Receipt, ReplicaAuthorityState, ReplicaCoverage, ReplicaDevice, ReplicaGatedHandle, ReplicaGrantInfo, ReplicaInspectedStatus, ReplicaLocalEraseOutcome, ReplicaPurgeError, ReplicaPurgeFailedEvent, ReplicaPurgeLocalCopyResult, ReplicaPurgeTrigger, ReplicaState, ReplicaStatusEntry, ReplicationAuthority, ReplicationControl, ReplicationEvent, ReplicationIdentity, ReplicationOptions, ReplicationPurgeReport, ReplicationReason, ReplicationScheduler, ResolvedCapabilities, ResolvedDelegate, ResolvedReplicationOptions, ResolvedSecretPath, ResourceCapability, SECRET_NAME_RE, SECRET_SCOPE_RE, SQLAction, SQLActionType, SQLService, SQLServiceConfig, STORAGE_FULL_MESSAGE, STORAGE_MANAGE_URL, STORAGE_WRITE_TOO_LARGE_MESSAGE, SchemaInfo, SecretCatalogEntry, SecretPayload, SecretPutOptions, SecretScopeOptions, SecretsError, SecretsService, ServiceContext, ServiceContextConfig, ServiceSession, SessionExpiredError, ShareAccess, ShareLink, ShareLinkData, ShareSchema, SharingService, SharingServiceConfig, SignCallback, SignInOptions, SignRequest, SignResponse, SignedReceiverKeyInput, SilentNotificationHandler, Space, SpaceAbilitiesMap, SpaceConfig, SpaceCreationContext, SpaceErrorCode, SpaceErrorCodes, SpaceInfo, SpaceOwnership, SpaceService, SpaceServiceConfig, SqlStatement, SqlValue, StorageAccountUsage, StorageFullEvent, StorageStatus, StorageStatusOptions, StorageUsage, StorageUsageState, StoredDelegationChain, SubscribeOptions, TC832_RESERVED_SCOPES, TableInfo, TelemetryConfig, TelemetryEventHandler, TinyCloud, TinyCloudConfig, TinyCloudDebugEnableOptions, TinyCloudDebugEvent, TinyCloudDebugLevel, TinyCloudDebugLogger, TinyCloudDebugTimer, TinyCloudSession, UnsupportedFeatureError, VAULT_PERMISSION_SERVICE, VaultCrypto, VaultEntry, VaultError, VaultGetOptions, VaultGrantOptions, VaultHeaders, VaultListOptions, VaultNetworkReadResult, VaultPublicSpaceKVActions, VaultPutOptions, VerifyDecryptResponseInput, VersionCheckError, ViewInfo, WasmVaultFunctions, WellKnownDescriptorFetcher, addressStorageKey, appSecretScope, buildCanonicalDecryptRequest, buildDecryptAttenuation, buildDecryptFacts, buildDecryptInvocation, buildNetworkId, buildSpaceUri, canonicalHashHex, canonicalSignedResponse, canonicalizeAddress, canonicalizeDid, canonicalizeDidUrl, canonicalizeEncryptionJson, canonicalizeNetworkId, canonicalizeSecretScope, checkDecryptInvocationInput, checkNodeInfo, clearTinyCloudDebugLogs, composeManifestRequest, createCapabilityKeyRegistry, createOpenKeyCallbackSigningStrategy, createSharingService, createSpaceService, createVaultCrypto, decryptEnvelopeWithKey, defaultSpaceCreationHandler, deriveSignedReceiverKey, didCacheKey, didEquals, disableTinyCloudDebug, discoverNetwork, enableTinyCloudDebug, encryptToNetwork, encryptionBase64Decode, encryptionBase64Encode, encryptionError, encryptionUtf8Decode, encryptionUtf8Encode, ensureNetworkUsableForDecrypt, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, generateRandomReceiverKey, getTinyCloudDebugLogs, hexDecode, hexEncode, installTinyCloudDebugGlobals, isCapabilitySubset, isEvmAddress, isNetworkId, isStorageFullError, loadManifest, makePkhSpaceId, makePublicSpaceId, networkDiscoveryKey, openWrappedKey, parseCanonicalNetworkId, parseExpiry, parseNetworkId, parsePkhDid, parseSecretCatalogKey, parseSpaceUri, pkhDid, principalDid, principalDidEquals, resolveManifest, resolveSecretListPrefix, resolveSecretPath, resourceCapabilitiesToSpaceAbilitiesMap, storageUsageState, tinyCloudDebugLogger, validateEnvelope, validateManifest, verifyDecryptResponse } from '@tinycloud/sdk-core';
3
3
  export { F as FileSessionStorage, M as MemorySessionStorage, W as WasmKeyProvider, a as WasmKeyProviderConfig, c as createWasmKeyProvider } from './WasmKeyProvider-5Ee7fcAw.cjs';
4
- export { A as ACCEPTED_MARKER_VERSIONS, l as BOOTSTRAP_COMPLETION_MARKER_KEY, m as BOOTSTRAP_COMPLETION_MARKER_VERSION, n as BootstrapCompletionMarker, B as BootstrapWarning, C as CreateOwnerDelegationParams, D as DelegateToOptions, a as DelegateToResult, b as DelegatedAccess, E as EnsureEncryptionNetworkOptions, I as InvalidRestoredSessionError, N as NodeEventEmitterStrategy, c as NodeUserAuthorization, o as NodeUserAuthorizationAuthorizeFn, d as NodeUserAuthorizationConfig, p as OpenKeyAuthorizationResultV1, q as OpenKeyAuthorizeInput, r as OpenKeyAuthorizeTinyCloud, s as OpenKeyBridgeInput, O as OwnerDelegationReceipt, t as RestorableSession, R as RuntimePermissionGrantOptions, S as SecretPermissionHint, e as SecretReadInput, f as SecretReadResult, g as SignStrategy, T as TinyCloudNode, h as TinyCloudNodeConfig, U as UnifiedOwnerRootInput, i as UnifiedOwnerRootReceipt, j as UnsupportedSessionRestoreError, k as defaultSignStrategy, w as wireOpenKeyAuthorize } from './TinyCloudNode-DDfx8Fx5.cjs';
4
+ export { A as ACCEPTED_MARKER_VERSIONS, l as BOOTSTRAP_COMPLETION_MARKER_KEY, m as BOOTSTRAP_COMPLETION_MARKER_VERSION, n as BootstrapCompletionMarker, B as BootstrapWarning, C as CreateOwnerDelegationParams, D as DelegateToOptions, a as DelegateToResult, b as DelegatedAccess, E as EnsureEncryptionNetworkOptions, I as InvalidRestoredSessionError, N as NodeEventEmitterStrategy, c as NodeUserAuthorization, o as NodeUserAuthorizationAuthorizeFn, d as NodeUserAuthorizationConfig, p as OpenKeyAuthorizationResultV1, q as OpenKeyAuthorizeInput, r as OpenKeyAuthorizeTinyCloud, s as OpenKeyBridgeInput, O as OwnerDelegationReceipt, t as RestorableSession, R as RuntimePermissionGrantOptions, S as SecretPermissionHint, e as SecretReadInput, f as SecretReadResult, g as SignStrategy, T as TinyCloudNode, h as TinyCloudNodeConfig, U as UnifiedOwnerRootInput, i as UnifiedOwnerRootReceipt, j as UnsupportedSessionRestoreError, k as defaultSignStrategy, w as wireOpenKeyAuthorize } from './TinyCloudNode-Dy65bxqs.cjs';
5
5
  import { invoke, invokeAny, computeCid, prepareSession, completeSessionSetup, ensureEip55, makeSpaceId, createDelegation, parseRecapFromSiwe, parseVerifiedRecapFromSiwe, generateHostSIWEMessage, siweToDelegationHeaders, protocolVersion, vault_encrypt, vault_decrypt, vault_derive_key, vault_x25519_from_seed, vault_x25519_dh, vault_random_bytes, vault_sha256 } from '@tinycloud/node-sdk-wasm';
6
- export { A as AuthDelegationArtifact, b as AuthRequestArtifact, C as CompactRuntimeDelegationInput, D as DelegationAuthority, P as PortableDelegation, R as RUNTIME_DELEGATION_REJECTIONS, c as RuntimeDelegationActivator, e as RuntimeDelegationRejectedError, f as RuntimeDelegationRejection, S as SessionGrantProof, V as ValidatedRuntimeDelegation, g as VerifiedSessionGrant, a as activateCompactRuntimeDelegation, h as activateValidatedRuntimeDelegation, d as deserializeDelegation, i as grantAuthRequest, s as serializeDelegation, j as signedCompactUcanExpiry, k as siweRuntimeDelegation } from './delegation-0LKZkmP2.cjs';
6
+ export { A as AuthDelegationArtifact, e as AuthRequestArtifact, C as CompactRuntimeDelegationInput, D as DelegationAuthority, P as PortableDelegation, f as RUNTIME_DELEGATION_REJECTIONS, g as RuntimeDelegationActivator, R as RuntimeDelegationRejectedError, a as RuntimeDelegationRejection, S as SessionGrantProof, V as ValidatedRuntimeDelegation, h as VerifiedSessionGrant, b as activateCompactRuntimeDelegation, c as activateValidatedRuntimeDelegation, d as deserializeDelegation, i as grantAuthRequest, s as serializeDelegation, j as signedCompactUcanExpiry, k as siweRuntimeDelegation } from './delegation-Ckc3UETl.cjs';
7
7
  import { KVReplicaStorage } from '@tinycloud/sdk-services';
8
8
  import { ProfileReplicaPurge } from '@tinycloud/sdk-services/kv/replication';
9
9
  export { ProfileReplicaDeferredToken, ProfileReplicaPurge } from '@tinycloud/sdk-services/kv/replication';
10
+ import '@tinycloud/sdk-services/encryption/named-keys';
10
11
  import 'events';
11
12
 
12
13
  /**
package/dist/index.d.ts CHANGED
@@ -1,12 +1,13 @@
1
1
  import { ISigner, Bytes, IWasmBindings, PersistedSessionProof, ISessionManager } from '@tinycloud/sdk-core';
2
- export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, AccountApplication, AccountApplicationListOptions, AccountApplicationRegisterOptions, AccountDelegation, AccountDelegationListOptions, AccountDelegationPage, AccountDelegationQueryOptions, AccountDelegationRecord, AccountDelegationResource, AccountDelegationRevokeOptions, AccountIndexEnsureResult, AccountIndexRebuildResult, AccountIndexStatus, AccountIndexedReadOptions, AccountService, AccountServiceConfig, AccountSpace, AccountSpaceListOptions, AccountStatus, AuthorityRefusal, AutoApproveSpaceCreationHandler, AutoRejectStrategy, AutoSignStrategy, BatchOptions, BatchResponse, BuildCanonicalDecryptRequestInput, BuildDecryptFactsInput, BuildDecryptInvocationInput, BuiltDecryptInvocation, CallbackStrategy, CanonicalAddress, CanonicalDecryptRequest, CanonicalJson, CanonicalParsedNetworkId, CapabilityEntry, CapabilityKeyRegistry, CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, CaveatedDelegationUnsupportedError, ClientSession, ColumnInfo, ComposeManifestOptions, ComposedManifestRequest, CreateDelegationParams, DECRYPT_ACTION, DECRYPT_FACT_TYPE, DECRYPT_RESULT_TYPE, DEFAULT_ENCRYPTION_ALG, DEFAULT_KEY_VERSION, DEFAULT_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, DEFAULT_SIGNED_READ_URL_EXPIRY_MS, DataVaultConfig, DataVaultService, DatabaseHandle, DecryptCapabilityProof, DecryptEnvelopeOptions, DecryptInvocationFact, DecryptInvocationSigner, DecryptRequestBody, DecryptResponseBody, DecryptTransport, DecryptTransportResponseError, DelegateReceivedShareParams, DelegatedShareAccess, Delegation, DelegationChain, DelegationChainV2, DelegationDirection, DelegationError, DelegationErrorCode, DelegationErrorCodes, DelegationFilters, DelegationManager, DelegationManagerConfig, DelegationRecord, DelegationResult, DelegationRevocationReceipt, DidCacheKeyOptions, DidEqualsOptions, DiscoverNetworkInput, DiscoveredNetwork, DiscoverySource, DuckDbAction, DuckDbActionType, DuckDbBatchOptions, DuckDbBatchResponse, DuckDbDatabaseHandle, DuckDbExecuteOptions, DuckDbExecuteResponse, DuckDbOptions, DuckDbQueryOptions, DuckDbQueryResponse, DuckDbService, DuckDbServiceConfig, DuckDbStatement, DuckDbValue, ENCRYPTION_NETWORK_URN_PREFIX, ENCRYPTION_SERVICE, ENCRYPTION_SERVICE_SHORT, ENVELOPE_VERSION, EncodedShareData, EncryptToNetworkInput, EncryptToNetworkOptions, EncryptToNetworkResult, EncryptionCrypto, EncryptionError, EncryptionErrorInput, EncryptionService, EncryptionServiceConfig, ExecuteOptions, ExecuteResponse, Extension, FetchFunction, GenerateShareParams, HookEvent, HookServiceName, HookStreamEvent, HookSubscription, HookWebhookListOptions, HookWebhookRecord, HookWebhookRegistration, HookWebhookScope, HookWebhookUnregisterOptions, HooksService, HooksServiceConfig, ICapabilityKeyRegistry, IDataVaultService, IDatabaseHandle, IDuckDbDatabaseHandle, IDuckDbService, IENSResolver, IEncryptionService, IHooksService, IKVService, INotificationHandler, IPrefixedKVService, ISQLService, ISecretsService, ISessionManager, ISessionStorage, ISharingService, ISigner, ISpace, ISpaceCreationHandler, ISpaceScopedDelegations, ISpaceScopedSharing, ISpaceService, IStorageService, IUserAuthorization, IWasmBindings, IdentityParseError, IngestOptions, InlineEncryptedEnvelope, InvokeFunction, JWK, KVBatchReadResponse, KVCreateSignedReadUrlOptions, KVListPage, KVReadThrough, KVReplicaHandle, KVReplicaSpec, KVReplicaStorage, KVReplicationController, KVReplicationDeps, KVResponse, KVService, KVServiceConfig, KVSignedReadUrlResponse, KeyInfo, KeyProvider, KeyType, LocalGetResult, LocalListResult, LocalReadMeta, LocalReplicaStatus, LocalSyncResult, MAX_SECRET_SCOPE_LENGTH, Manifest, ManifestDefaults, ManifestRegistryRecord, ManifestSecretActions, ManifestValidationError, NETWORK_NAME_PATTERN, NetworkDescriptor, NetworkIdError, NodeDescriptorFetcher, OpenKeyCallbackStrategy, OpenKeySigningRequestBody, OpenKeySigningResponseBody, OpenKeySigningStrategyOptions, OwnerDelegationPermission, ParsedNetworkId, ParsedSecretCatalogKey, PendingWriteRecord, PendingWriteState, PendingWriteStore, PermissionEntry, PermissionNotInManifestError, PersistedSessionData, PinnedKey, PkhDidParts, PrefixedKVService, ProtocolMismatchError, PurgeTarget, QueryOptions, QueryResponse, RandomReceiverKeyInput, ReceiveOptions, ReceiverKeyPair, ReceiverKeySigner, RegisterBatchSuccess, RegisterPolicyV3Input, RegisterPolicyV3Receipt, ReplicaAuthorityState, ReplicaCoverage, ReplicaDevice, ReplicaGatedHandle, ReplicaGrantInfo, ReplicaInspectedStatus, ReplicaState, ReplicaStatusEntry, ReplicationAuthority, ReplicationControl, ReplicationEvent, ReplicationIdentity, ReplicationOptions, ReplicationPurgeReport, ReplicationReason, ReplicationScheduler, ResolvedCapabilities, ResolvedDelegate, ResolvedReplicationOptions, ResolvedSecretPath, ResourceCapability, SECRET_NAME_RE, SECRET_SCOPE_RE, SQLAction, SQLActionType, SQLService, SQLServiceConfig, STORAGE_FULL_MESSAGE, STORAGE_MANAGE_URL, STORAGE_WRITE_TOO_LARGE_MESSAGE, SchemaInfo, SecretCatalogEntry, SecretPayload, SecretPutOptions, SecretScopeOptions, SecretsError, SecretsService, ServiceContext, ServiceContextConfig, ServiceSession, SessionExpiredError, ShareAccess, ShareLink, ShareLinkData, ShareSchema, SharingService, SharingServiceConfig, SignCallback, SignInOptions, SignRequest, SignResponse, SignedReceiverKeyInput, SilentNotificationHandler, Space, SpaceAbilitiesMap, SpaceConfig, SpaceCreationContext, SpaceErrorCode, SpaceErrorCodes, SpaceInfo, SpaceOwnership, SpaceService, SpaceServiceConfig, SqlStatement, SqlValue, StorageAccountUsage, StorageFullEvent, StorageStatus, StorageStatusOptions, StorageUsage, StorageUsageState, StoredDelegationChain, SubscribeOptions, TC832_RESERVED_SCOPES, TableInfo, TelemetryConfig, TelemetryEventHandler, TinyCloud, TinyCloudConfig, TinyCloudDebugEnableOptions, TinyCloudDebugEvent, TinyCloudDebugLevel, TinyCloudDebugLogger, TinyCloudDebugTimer, TinyCloudSession, UnsupportedFeatureError, VAULT_PERMISSION_SERVICE, VaultCrypto, VaultEntry, VaultError, VaultGetOptions, VaultGrantOptions, VaultHeaders, VaultListOptions, VaultNetworkReadResult, VaultPublicSpaceKVActions, VaultPutOptions, VerifyDecryptResponseInput, VersionCheckError, ViewInfo, WasmVaultFunctions, WellKnownDescriptorFetcher, addressStorageKey, appSecretScope, buildCanonicalDecryptRequest, buildDecryptAttenuation, buildDecryptFacts, buildDecryptInvocation, buildNetworkId, buildSpaceUri, canonicalHashHex, canonicalSignedResponse, canonicalizeAddress, canonicalizeDid, canonicalizeDidUrl, canonicalizeEncryptionJson, canonicalizeNetworkId, canonicalizeSecretScope, checkDecryptInvocationInput, checkNodeInfo, clearTinyCloudDebugLogs, composeManifestRequest, createCapabilityKeyRegistry, createOpenKeyCallbackSigningStrategy, createSharingService, createSpaceService, createVaultCrypto, decryptEnvelopeWithKey, defaultSpaceCreationHandler, deriveSignedReceiverKey, didCacheKey, didEquals, disableTinyCloudDebug, discoverNetwork, enableTinyCloudDebug, encryptToNetwork, encryptionBase64Decode, encryptionBase64Encode, encryptionError, encryptionUtf8Decode, encryptionUtf8Encode, ensureNetworkUsableForDecrypt, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, generateRandomReceiverKey, getTinyCloudDebugLogs, hexDecode, hexEncode, installTinyCloudDebugGlobals, isCapabilitySubset, isEvmAddress, isNetworkId, isStorageFullError, loadManifest, makePkhSpaceId, makePublicSpaceId, networkDiscoveryKey, openWrappedKey, parseCanonicalNetworkId, parseExpiry, parseNetworkId, parsePkhDid, parseSecretCatalogKey, parseSpaceUri, pkhDid, principalDid, principalDidEquals, resolveManifest, resolveSecretListPrefix, resolveSecretPath, resourceCapabilitiesToSpaceAbilitiesMap, storageUsageState, tinyCloudDebugLogger, validateEnvelope, validateManifest, verifyDecryptResponse } from '@tinycloud/sdk-core';
2
+ export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, AccountApplication, AccountApplicationListOptions, AccountApplicationRegisterOptions, AccountDelegation, AccountDelegationListOptions, AccountDelegationPage, AccountDelegationQueryOptions, AccountDelegationRecord, AccountDelegationResource, AccountDelegationRevokeOptions, AccountIndexEnsureResult, AccountIndexRebuildResult, AccountIndexStatus, AccountIndexedReadOptions, AccountService, AccountServiceConfig, AccountSpace, AccountSpaceListOptions, AccountStatus, AuthorityRefusal, AutoApproveSpaceCreationHandler, AutoRejectStrategy, AutoSignStrategy, BatchOptions, BatchResponse, BuildCanonicalDecryptRequestInput, BuildDecryptFactsInput, BuildDecryptInvocationInput, BuiltDecryptInvocation, CallbackStrategy, CanonicalAddress, CanonicalDecryptRequest, CanonicalJson, CanonicalParsedNetworkId, CapabilityEntry, CapabilityKeyRegistry, CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, CaveatedDelegationUnsupportedError, ClientSession, ColumnInfo, ComposeManifestOptions, ComposedManifestRequest, CreateDelegationParams, DECRYPT_ACTION, DECRYPT_FACT_TYPE, DECRYPT_RESULT_TYPE, DEFAULT_ENCRYPTION_ALG, DEFAULT_KEY_VERSION, DEFAULT_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, DEFAULT_SIGNED_READ_URL_EXPIRY_MS, DataVaultConfig, DataVaultService, DatabaseHandle, DecryptCapabilityProof, DecryptEnvelopeOptions, DecryptInvocationFact, DecryptInvocationSigner, DecryptRequestBody, DecryptResponseBody, DecryptTransport, DecryptTransportResponseError, DelegateReceivedShareParams, DelegatedShareAccess, Delegation, DelegationChain, DelegationChainV2, DelegationDirection, DelegationError, DelegationErrorCode, DelegationErrorCodes, DelegationFilters, DelegationManager, DelegationManagerConfig, DelegationRecord, DelegationResult, DelegationRevocationReceipt, DidCacheKeyOptions, DidEqualsOptions, DiscoverNetworkInput, DiscoveredNetwork, DiscoverySource, DuckDbAction, DuckDbActionType, DuckDbBatchOptions, DuckDbBatchResponse, DuckDbDatabaseHandle, DuckDbExecuteOptions, DuckDbExecuteResponse, DuckDbOptions, DuckDbQueryOptions, DuckDbQueryResponse, DuckDbService, DuckDbServiceConfig, DuckDbStatement, DuckDbValue, ENCRYPTION_NETWORK_URN_PREFIX, ENCRYPTION_SERVICE, ENCRYPTION_SERVICE_SHORT, ENVELOPE_VERSION, EncodedShareData, EncryptToNetworkInput, EncryptToNetworkOptions, EncryptToNetworkResult, EncryptionCrypto, EncryptionError, EncryptionErrorInput, EncryptionService, EncryptionServiceConfig, ExecuteOptions, ExecuteResponse, Extension, FetchFunction, GenerateShareParams, HookEvent, HookServiceName, HookStreamEvent, HookSubscription, HookWebhookListOptions, HookWebhookRecord, HookWebhookRegistration, HookWebhookScope, HookWebhookUnregisterOptions, HooksService, HooksServiceConfig, ICapabilityKeyRegistry, IDataVaultService, IDatabaseHandle, IDuckDbDatabaseHandle, IDuckDbService, IENSResolver, IEncryptionService, IHooksService, IKVService, INotificationHandler, IPrefixedKVService, ISQLService, ISecretsService, ISessionManager, ISessionStorage, ISharingService, ISigner, ISpace, ISpaceCreationHandler, ISpaceScopedDelegations, ISpaceScopedSharing, ISpaceService, IStorageService, IUserAuthorization, IWasmBindings, IdentityParseError, IngestOptions, InlineEncryptedEnvelope, InvokeFunction, JWK, KVBatchReadResponse, KVCreateSignedReadUrlOptions, KVListPage, KVReadThrough, KVReplicaHandle, KVReplicaSpec, KVReplicaStorage, KVReplicationController, KVReplicationDeps, KVResponse, KVService, KVServiceConfig, KVSignedReadUrlResponse, KeyInfo, KeyProvider, KeyType, LocalGetResult, LocalListResult, LocalReadMeta, LocalReplicaStatus, LocalSyncResult, MAX_SECRET_SCOPE_LENGTH, Manifest, ManifestDefaults, ManifestRegistryRecord, ManifestSecretActions, ManifestValidationError, NETWORK_NAME_PATTERN, NetworkDescriptor, NetworkIdError, NodeDescriptorFetcher, OpenKeyCallbackStrategy, OpenKeySigningRequestBody, OpenKeySigningResponseBody, OpenKeySigningStrategyOptions, OwnerDelegationPermission, ParsedNetworkId, ParsedSecretCatalogKey, PendingWriteRecord, PendingWriteState, PendingWriteStore, PermissionEntry, PermissionNotInManifestError, PersistedSessionData, PinnedKey, PkhDidParts, PrefixedKVService, ProtocolMismatchError, PurgeTarget, QueryOptions, QueryResponse, RandomReceiverKeyInput, ReceiveOptions, ReceiverKeyPair, ReceiverKeySigner, RegisterBatchSuccess, RegisterPolicyV3Input, RegisterPolicyV3Receipt, ReplicaAuthorityState, ReplicaCoverage, ReplicaDevice, ReplicaGatedHandle, ReplicaGrantInfo, ReplicaInspectedStatus, ReplicaLocalEraseOutcome, ReplicaPurgeError, ReplicaPurgeFailedEvent, ReplicaPurgeLocalCopyResult, ReplicaPurgeTrigger, ReplicaState, ReplicaStatusEntry, ReplicationAuthority, ReplicationControl, ReplicationEvent, ReplicationIdentity, ReplicationOptions, ReplicationPurgeReport, ReplicationReason, ReplicationScheduler, ResolvedCapabilities, ResolvedDelegate, ResolvedReplicationOptions, ResolvedSecretPath, ResourceCapability, SECRET_NAME_RE, SECRET_SCOPE_RE, SQLAction, SQLActionType, SQLService, SQLServiceConfig, STORAGE_FULL_MESSAGE, STORAGE_MANAGE_URL, STORAGE_WRITE_TOO_LARGE_MESSAGE, SchemaInfo, SecretCatalogEntry, SecretPayload, SecretPutOptions, SecretScopeOptions, SecretsError, SecretsService, ServiceContext, ServiceContextConfig, ServiceSession, SessionExpiredError, ShareAccess, ShareLink, ShareLinkData, ShareSchema, SharingService, SharingServiceConfig, SignCallback, SignInOptions, SignRequest, SignResponse, SignedReceiverKeyInput, SilentNotificationHandler, Space, SpaceAbilitiesMap, SpaceConfig, SpaceCreationContext, SpaceErrorCode, SpaceErrorCodes, SpaceInfo, SpaceOwnership, SpaceService, SpaceServiceConfig, SqlStatement, SqlValue, StorageAccountUsage, StorageFullEvent, StorageStatus, StorageStatusOptions, StorageUsage, StorageUsageState, StoredDelegationChain, SubscribeOptions, TC832_RESERVED_SCOPES, TableInfo, TelemetryConfig, TelemetryEventHandler, TinyCloud, TinyCloudConfig, TinyCloudDebugEnableOptions, TinyCloudDebugEvent, TinyCloudDebugLevel, TinyCloudDebugLogger, TinyCloudDebugTimer, TinyCloudSession, UnsupportedFeatureError, VAULT_PERMISSION_SERVICE, VaultCrypto, VaultEntry, VaultError, VaultGetOptions, VaultGrantOptions, VaultHeaders, VaultListOptions, VaultNetworkReadResult, VaultPublicSpaceKVActions, VaultPutOptions, VerifyDecryptResponseInput, VersionCheckError, ViewInfo, WasmVaultFunctions, WellKnownDescriptorFetcher, addressStorageKey, appSecretScope, buildCanonicalDecryptRequest, buildDecryptAttenuation, buildDecryptFacts, buildDecryptInvocation, buildNetworkId, buildSpaceUri, canonicalHashHex, canonicalSignedResponse, canonicalizeAddress, canonicalizeDid, canonicalizeDidUrl, canonicalizeEncryptionJson, canonicalizeNetworkId, canonicalizeSecretScope, checkDecryptInvocationInput, checkNodeInfo, clearTinyCloudDebugLogs, composeManifestRequest, createCapabilityKeyRegistry, createOpenKeyCallbackSigningStrategy, createSharingService, createSpaceService, createVaultCrypto, decryptEnvelopeWithKey, defaultSpaceCreationHandler, deriveSignedReceiverKey, didCacheKey, didEquals, disableTinyCloudDebug, discoverNetwork, enableTinyCloudDebug, encryptToNetwork, encryptionBase64Decode, encryptionBase64Encode, encryptionError, encryptionUtf8Decode, encryptionUtf8Encode, ensureNetworkUsableForDecrypt, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, generateRandomReceiverKey, getTinyCloudDebugLogs, hexDecode, hexEncode, installTinyCloudDebugGlobals, isCapabilitySubset, isEvmAddress, isNetworkId, isStorageFullError, loadManifest, makePkhSpaceId, makePublicSpaceId, networkDiscoveryKey, openWrappedKey, parseCanonicalNetworkId, parseExpiry, parseNetworkId, parsePkhDid, parseSecretCatalogKey, parseSpaceUri, pkhDid, principalDid, principalDidEquals, resolveManifest, resolveSecretListPrefix, resolveSecretPath, resourceCapabilitiesToSpaceAbilitiesMap, storageUsageState, tinyCloudDebugLogger, validateEnvelope, validateManifest, verifyDecryptResponse } from '@tinycloud/sdk-core';
3
3
  export { F as FileSessionStorage, M as MemorySessionStorage, W as WasmKeyProvider, a as WasmKeyProviderConfig, c as createWasmKeyProvider } from './WasmKeyProvider-5Ee7fcAw.js';
4
- export { A as ACCEPTED_MARKER_VERSIONS, l as BOOTSTRAP_COMPLETION_MARKER_KEY, m as BOOTSTRAP_COMPLETION_MARKER_VERSION, n as BootstrapCompletionMarker, B as BootstrapWarning, C as CreateOwnerDelegationParams, D as DelegateToOptions, a as DelegateToResult, b as DelegatedAccess, E as EnsureEncryptionNetworkOptions, I as InvalidRestoredSessionError, N as NodeEventEmitterStrategy, c as NodeUserAuthorization, o as NodeUserAuthorizationAuthorizeFn, d as NodeUserAuthorizationConfig, p as OpenKeyAuthorizationResultV1, q as OpenKeyAuthorizeInput, r as OpenKeyAuthorizeTinyCloud, s as OpenKeyBridgeInput, O as OwnerDelegationReceipt, t as RestorableSession, R as RuntimePermissionGrantOptions, S as SecretPermissionHint, e as SecretReadInput, f as SecretReadResult, g as SignStrategy, T as TinyCloudNode, h as TinyCloudNodeConfig, U as UnifiedOwnerRootInput, i as UnifiedOwnerRootReceipt, j as UnsupportedSessionRestoreError, k as defaultSignStrategy, w as wireOpenKeyAuthorize } from './TinyCloudNode-Ckqu_fqH.js';
4
+ export { A as ACCEPTED_MARKER_VERSIONS, l as BOOTSTRAP_COMPLETION_MARKER_KEY, m as BOOTSTRAP_COMPLETION_MARKER_VERSION, n as BootstrapCompletionMarker, B as BootstrapWarning, C as CreateOwnerDelegationParams, D as DelegateToOptions, a as DelegateToResult, b as DelegatedAccess, E as EnsureEncryptionNetworkOptions, I as InvalidRestoredSessionError, N as NodeEventEmitterStrategy, c as NodeUserAuthorization, o as NodeUserAuthorizationAuthorizeFn, d as NodeUserAuthorizationConfig, p as OpenKeyAuthorizationResultV1, q as OpenKeyAuthorizeInput, r as OpenKeyAuthorizeTinyCloud, s as OpenKeyBridgeInput, O as OwnerDelegationReceipt, t as RestorableSession, R as RuntimePermissionGrantOptions, S as SecretPermissionHint, e as SecretReadInput, f as SecretReadResult, g as SignStrategy, T as TinyCloudNode, h as TinyCloudNodeConfig, U as UnifiedOwnerRootInput, i as UnifiedOwnerRootReceipt, j as UnsupportedSessionRestoreError, k as defaultSignStrategy, w as wireOpenKeyAuthorize } from './TinyCloudNode-DnD-SH6t.js';
5
5
  import { invoke, invokeAny, computeCid, prepareSession, completeSessionSetup, ensureEip55, makeSpaceId, createDelegation, parseRecapFromSiwe, parseVerifiedRecapFromSiwe, generateHostSIWEMessage, siweToDelegationHeaders, protocolVersion, vault_encrypt, vault_decrypt, vault_derive_key, vault_x25519_from_seed, vault_x25519_dh, vault_random_bytes, vault_sha256 } from '@tinycloud/node-sdk-wasm';
6
- export { A as AuthDelegationArtifact, b as AuthRequestArtifact, C as CompactRuntimeDelegationInput, D as DelegationAuthority, P as PortableDelegation, R as RUNTIME_DELEGATION_REJECTIONS, c as RuntimeDelegationActivator, e as RuntimeDelegationRejectedError, f as RuntimeDelegationRejection, S as SessionGrantProof, V as ValidatedRuntimeDelegation, g as VerifiedSessionGrant, a as activateCompactRuntimeDelegation, h as activateValidatedRuntimeDelegation, d as deserializeDelegation, i as grantAuthRequest, s as serializeDelegation, j as signedCompactUcanExpiry, k as siweRuntimeDelegation } from './delegation-0LKZkmP2.js';
6
+ export { A as AuthDelegationArtifact, e as AuthRequestArtifact, C as CompactRuntimeDelegationInput, D as DelegationAuthority, P as PortableDelegation, f as RUNTIME_DELEGATION_REJECTIONS, g as RuntimeDelegationActivator, R as RuntimeDelegationRejectedError, a as RuntimeDelegationRejection, S as SessionGrantProof, V as ValidatedRuntimeDelegation, h as VerifiedSessionGrant, b as activateCompactRuntimeDelegation, c as activateValidatedRuntimeDelegation, d as deserializeDelegation, i as grantAuthRequest, s as serializeDelegation, j as signedCompactUcanExpiry, k as siweRuntimeDelegation } from './delegation-Ckc3UETl.js';
7
7
  import { KVReplicaStorage } from '@tinycloud/sdk-services';
8
8
  import { ProfileReplicaPurge } from '@tinycloud/sdk-services/kv/replication';
9
9
  export { ProfileReplicaDeferredToken, ProfileReplicaPurge } from '@tinycloud/sdk-services/kv/replication';
10
+ import '@tinycloud/sdk-services/encryption/named-keys';
10
11
  import 'events';
11
12
 
12
13
  /**
package/dist/index.js CHANGED
@@ -17099,6 +17099,9 @@ function assertValidReplicationConfig(replication) {
17099
17099
  if (replication?.syncScope !== void 0 && replication.syncScope !== "prefixes") {
17100
17100
  throw new TypeError('replication.syncScope must be "prefixes"');
17101
17101
  }
17102
+ if (replication?.contentFetch !== void 0 && replication.contentFetch !== "eager" && replication.contentFetch !== "lazy") {
17103
+ throw new TypeError('replication.contentFetch must be "eager" or "lazy"');
17104
+ }
17102
17105
  if (replication === void 0 || !replication.enabled) return;
17103
17106
  if (replication.storage === void 0 || replication.storage === null) {
17104
17107
  throw new TypeError("replication.enabled requires replication.storage");
@@ -17151,6 +17154,7 @@ function resolvedOptions(options) {
17151
17154
  maxStalenessMs: options.maxStalenessMs ?? 12e4,
17152
17155
  staleSyncTimeoutMs: options.staleSyncTimeoutMs ?? 5e3,
17153
17156
  allowSecrets: options.allowSecrets === true,
17157
+ contentFetch: options.contentFetch ?? "eager",
17154
17158
  verify: options.verify === true
17155
17159
  };
17156
17160
  }
@@ -17421,6 +17425,7 @@ __export(authority_exports, {
17421
17425
  assertValidReplicationConfig: () => assertValidReplicationConfig,
17422
17426
  augmentSignInEntriesWithReplication: () => augmentSignInEntriesWithReplication,
17423
17427
  createReplicationAuthority: () => createReplicationAuthority,
17428
+ eraseReplicaLocalCopy: () => eraseReplicaLocalCopy,
17424
17429
  establishReplicaSessionStamp: () => establishReplicaSessionStamp,
17425
17430
  hasUnrestrictedGetCoverage: () => hasUnrestrictedGetCoverage,
17426
17431
  mintNodeReplicationGrant: () => mintNodeReplicationGrant,
@@ -17461,6 +17466,38 @@ function reportReplicaDenial(result, reason, onEvent, context) {
17461
17466
  } catch {
17462
17467
  }
17463
17468
  }
17469
+ async function eraseReplicaLocalCopy(lifecycle, trigger, denyStatus, handlers) {
17470
+ if (lifecycle?.kind !== "indexeddb" || lifecycle.eraseLocalCopy === void 0) return void 0;
17471
+ let outcome = { status: "failed", code: "STORAGE_ERROR", marker: false };
17472
+ for (let attempt = 0; attempt <= ERASE_RETRY_DELAYS_MS.length; attempt++) {
17473
+ if (attempt > 0) await new Promise((resolve2) => setTimeout(resolve2, ERASE_RETRY_DELAYS_MS[attempt - 1]));
17474
+ try {
17475
+ outcome = await lifecycle.eraseLocalCopy({ signal: AbortSignal.timeout(ERASE_ATTEMPT_MS) });
17476
+ } catch {
17477
+ outcome = { status: "failed", code: "STORAGE_ERROR", marker: false };
17478
+ }
17479
+ if (outcome.status !== "failed") break;
17480
+ }
17481
+ const keysKept = denyStatus === "marker" || denyStatus === "unguarded";
17482
+ const purge = outcome.status === "erased" ? { ok: true } : { ok: false, retryNow: outcome.status === "failed" };
17483
+ if (outcome.status === "erased" || outcome.status === "refused" && !keysKept) return { outcome, purge };
17484
+ const logoutPending = outcome.status === "failed" && outcome.marker;
17485
+ const event = {
17486
+ type: "replica.purge.failed",
17487
+ trigger,
17488
+ reason: logoutPending ? "logout_pending" : "gate_unavailable",
17489
+ code: outcome.code,
17490
+ retryNow: outcome.status === "failed"
17491
+ };
17492
+ for (const handler of handlers) {
17493
+ try {
17494
+ handler(event);
17495
+ } catch (error) {
17496
+ console.error('Error in "replica.purge.failed" handler:', error);
17497
+ }
17498
+ }
17499
+ return logoutPending ? { outcome, purge, logoutPending } : { outcome, purge };
17500
+ }
17464
17501
  function verifiedOwnerConsentAnchor(session, wasmBindings, exactVerifiedRecap2) {
17465
17502
  if (typeof session.siwe !== "string" || typeof session.signature !== "string" || typeof session.address !== "string" || typeof session.chainId !== "number") return null;
17466
17503
  try {
@@ -17719,13 +17756,15 @@ function createReplicationAuthority(host) {
17719
17756
  };
17720
17757
  return authority;
17721
17758
  }
17722
- var parseUcanGrant, KV_GET2, KV_SYNC2, KV_SERVICE2, AUTHORITY_EXPIRY_MARGIN_MS;
17759
+ var parseUcanGrant, ERASE_RETRY_DELAYS_MS, ERASE_ATTEMPT_MS, KV_GET2, KV_SYNC2, KV_SERVICE2, AUTHORITY_EXPIRY_MARGIN_MS;
17723
17760
  var init_authority = __esm({
17724
17761
  "src/replication/authority.ts"() {
17725
17762
  "use strict";
17726
17763
  init_config();
17727
17764
  init_authority_sign_in();
17728
17765
  parseUcanGrant = replicaParseUcanGrant;
17766
+ ERASE_RETRY_DELAYS_MS = [150, 450];
17767
+ ERASE_ATTEMPT_MS = 3e3;
17729
17768
  KV_GET2 = KV4.GET;
17730
17769
  KV_SYNC2 = KV4.SYNC;
17731
17770
  KV_SERVICE2 = "tinycloud.kv";
@@ -18748,9 +18787,9 @@ import {
18748
18787
  tinyCloudDebugLogger
18749
18788
  } from "@tinycloud/sdk-services";
18750
18789
  import { RequestLog, observeReplicaReads, readOnlyRequestLog } from "@tinycloud/sdk-services/telemetry/requestLog";
18790
+ import { parseEncryptionResource as parseEncryptionResource2 } from "@tinycloud/sdk-services/encryption/resource";
18751
18791
 
18752
18792
  // src/authorization/NodeUserAuthorization.ts
18753
- init_authority_sign_in();
18754
18793
  import { createHash } from "crypto";
18755
18794
  import { SiweMessage } from "siwe";
18756
18795
  import {
@@ -18759,10 +18798,10 @@ import {
18759
18798
  activateSessionWithHost,
18760
18799
  checkNodeInfo,
18761
18800
  AutoApproveSpaceCreationHandler,
18801
+ ManifestValidationError,
18762
18802
  DEFAULT_MANIFEST_SPACE,
18763
18803
  ENCRYPTION_PERMISSION_SERVICE,
18764
18804
  composeManifestRequest,
18765
- parseNetworkId,
18766
18805
  principalDidEquals as principalDidEquals2,
18767
18806
  resourceCapabilitiesToAbilitiesMap,
18768
18807
  resourceCapabilitiesToSpaceAbilitiesMap,
@@ -18790,6 +18829,35 @@ import {
18790
18829
  HOOKS,
18791
18830
  ENCRYPTION
18792
18831
  } from "@tinycloud/sdk-core";
18832
+ import { parseEncryptionResource } from "@tinycloud/sdk-services/encryption/resource";
18833
+ import { parseNetworkId } from "@tinycloud/sdk-services";
18834
+
18835
+ // src/authorization/appKeyHostBinding.ts
18836
+ var DOMAIN_LABEL = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/;
18837
+ var IPV4 = /^\d+\.\d+\.\d+\.\d+$/;
18838
+ var APP_ID = /^[a-z0-9][a-z0-9._-]{0,63}$/;
18839
+ function appKeyHostBinding(domain, appId) {
18840
+ if (!APP_ID.test(appId)) return false;
18841
+ if (domain.endsWith(":")) return false;
18842
+ let url;
18843
+ try {
18844
+ url = new URL(`https://${domain}`);
18845
+ } catch {
18846
+ return false;
18847
+ }
18848
+ if (url.protocol !== "https:" || url.port !== "" || url.username !== "" || url.password !== "") return false;
18849
+ if (url.pathname !== "/" || url.search !== "" || url.hash !== "") return false;
18850
+ const host = url.hostname;
18851
+ if (host.startsWith("[") || host.endsWith(".") || IPV4.test(host)) return false;
18852
+ const labels = host.split(".");
18853
+ if (labels.length < 2 || labels[labels.length - 1] === "localhost") return false;
18854
+ if (!labels.every((label) => DOMAIN_LABEL.test(label))) return false;
18855
+ const reversed = labels.reverse().join(".");
18856
+ return appId === reversed || appId.startsWith(`${reversed}.`);
18857
+ }
18858
+
18859
+ // src/authorization/NodeUserAuthorization.ts
18860
+ init_authority_sign_in();
18793
18861
 
18794
18862
  // src/authorization/caveatRefusal.ts
18795
18863
  import {
@@ -19303,6 +19371,23 @@ var NodeUserAuthorization = class {
19303
19371
  );
19304
19372
  return this._capabilityRequest;
19305
19373
  }
19374
+ async refreshNamedKeyFeatureForSignIn(address, chainId) {
19375
+ const request = this.getCapabilityRequest();
19376
+ const siweDomain = this.siweConfig?.domain ?? this.domain;
19377
+ const hasNamedKeys = request?.manifests.some((manifest) => manifest.keys?.length && appKeyHostBinding(siweDomain, manifest.keys_app_id ?? manifest.app_id));
19378
+ if (hasNamedKeys) {
19379
+ await this.resolveTinyCloudHostsForSignIn(address, chainId);
19380
+ await this.refreshNodeInfo();
19381
+ }
19382
+ }
19383
+ /** Manifest key paths that this sign-in cannot grant. */
19384
+ get unavailableKeyPaths() {
19385
+ const request = this.getCapabilityRequest();
19386
+ const siweDomain = this.siweConfig?.domain ?? this.domain;
19387
+ return (request?.manifests ?? []).flatMap(
19388
+ (manifest) => this._nodeFeatures.includes("encryption-named-keys-v1") && appKeyHostBinding(siweDomain, manifest.keys_app_id ?? manifest.app_id) ? [] : (manifest.keys ?? []).map((entry) => "path" in entry ? entry.path : entry.prefix)
19389
+ );
19390
+ }
19306
19391
  resolveSpaceName(space, address, chainId) {
19307
19392
  if (space.startsWith("tinycloud:")) {
19308
19393
  return space;
@@ -19494,15 +19579,31 @@ var NodeUserAuthorization = class {
19494
19579
  }
19495
19580
  const rawAbilities = {};
19496
19581
  const currentDid = pkhDid(address, chainId);
19582
+ if (this._nodeFeatures.includes("encryption-named-keys-v1")) {
19583
+ const siweDomain = this.siweConfig?.domain ?? this.domain;
19584
+ for (const manifest of request.manifests) {
19585
+ if (!appKeyHostBinding(siweDomain, manifest.keys_app_id ?? manifest.app_id)) continue;
19586
+ for (const declaration of manifest.keys ?? []) {
19587
+ const path = "path" in declaration ? declaration.path : declaration.prefix;
19588
+ const resource = `urn:tinycloud:encryption:${currentDid}:default/${path}`;
19589
+ for (const ability of declaration.abilities) {
19590
+ addRawAbility(rawAbilities, resource, `tinycloud.encryption/${ability}`);
19591
+ }
19592
+ }
19593
+ }
19594
+ }
19497
19595
  const spaceResources = request.resources.filter((entry) => {
19498
19596
  if (entry.service !== ENCRYPTION_PERMISSION_SERVICE) {
19499
19597
  return true;
19500
19598
  }
19599
+ const parsed = entry.path.includes("/") ? parseEncryptionResource(entry.path) : { ...parseNetworkId(entry.path), kind: "network" };
19600
+ if (parsed.kind !== "network") {
19601
+ throw new ManifestValidationError("named keys go in manifest.keys");
19602
+ }
19501
19603
  for (const action of entry.actions) {
19502
19604
  addRawAbility(rawAbilities, entry.path, action);
19503
19605
  }
19504
- if (entry.actions.includes(DECRYPT_ACTION)) {
19505
- const parsed = parseNetworkId(entry.path);
19606
+ if (entry.actions.includes(DECRYPT_ACTION) && parsed.kind === "network") {
19506
19607
  if (didPrincipalMatches(parsed.ownerDid, currentDid)) {
19507
19608
  addRawAbility(rawAbilities, entry.path, NETWORK_CREATE_ACTION);
19508
19609
  }
@@ -19898,6 +19999,8 @@ var NodeUserAuthorization = class {
19898
19999
  this._chainId = chainId;
19899
20000
  await this.resolveTinyCloudHostsForSignIn(address, chainId);
19900
20001
  this.assertSignInCurrent(generation);
20002
+ await this.refreshNamedKeyFeatureForSignIn(address, chainId);
20003
+ this.assertSignInCurrent(generation);
19901
20004
  const keyId = `session-${Date.now()}`;
19902
20005
  this.sessionManager.renameSessionKeyId(this.activeSessionKeyId, keyId);
19903
20006
  this.activeSessionKeyId = keyId;
@@ -20044,6 +20147,7 @@ var NodeUserAuthorization = class {
20044
20147
  refuseCaveated(this.getCapabilityRequest()?.manifests);
20045
20148
  const address = canonicalizeAddress(await this.signer.getAddress());
20046
20149
  const chainId = await this.signer.getChainId();
20150
+ await this.refreshNamedKeyFeatureForSignIn(address, chainId);
20047
20151
  const keyId = `session-${Date.now()}`;
20048
20152
  this.sessionManager.renameSessionKeyId(this.activeSessionKeyId, keyId);
20049
20153
  this.activeSessionKeyId = keyId;
@@ -21112,6 +21216,7 @@ var ROOT_DELEGATION_ACTIONS = [
21112
21216
  DUCKDB2.ALL
21113
21217
  ];
21114
21218
  var DEFAULT_SESSION_EXPIRATION_MS = EXPIRY3.SESSION_MS;
21219
+ var OWNER_REVOCATION_WINDOW_MS = 10 * 6e4;
21115
21220
  function unifiedRootAttenuation(capabilities) {
21116
21221
  const attenuation = {};
21117
21222
  for (const capability of capabilities) {
@@ -21576,6 +21681,7 @@ function replicaRestoreRefusal(error) {
21576
21681
  case "purge_pending":
21577
21682
  case "logout_pending":
21578
21683
  case "gate_unavailable":
21684
+ case "wallet_provider_required":
21579
21685
  return error.gate;
21580
21686
  }
21581
21687
  }
@@ -21610,6 +21716,7 @@ var _TinyCloudNode = class _TinyCloudNode {
21610
21716
  this.auth = null;
21611
21717
  this.tc = null;
21612
21718
  this._chainId = 1;
21719
+ this.replicaPurgeFailedHandlers = /* @__PURE__ */ new Set();
21613
21720
  /** Mints the replica session stamp on each fresh sign-in (TC-858 §4.1). Undefined when replication is off. */
21614
21721
  this.establishReplicaStamp = async (session) => {
21615
21722
  const replication = this.config.replication;
@@ -21641,6 +21748,7 @@ var _TinyCloudNode = class _TinyCloudNode {
21641
21748
  return void 0;
21642
21749
  }
21643
21750
  };
21751
+ this._keysUnavailable = [];
21644
21752
  this._baseVaults = /* @__PURE__ */ new Map();
21645
21753
  this._baseSecrets = /* @__PURE__ */ new Map();
21646
21754
  this._secrets = /* @__PURE__ */ new Map();
@@ -21816,6 +21924,7 @@ var _TinyCloudNode = class _TinyCloudNode {
21816
21924
  return instance ? instance.control.purge(input) : runtime.then((ready) => ready.control.purge(input));
21817
21925
  },
21818
21926
  clearPending: async () => (await runtime).control.clearPending(),
21927
+ purgeLocalCopy: async () => (await this.eraseReplicaLocalCopy("purge_local_copy"))?.purge ?? { ok: false, retryNow: false },
21819
21928
  close: async () => (await runtime).control.close()
21820
21929
  };
21821
21930
  }
@@ -21870,18 +21979,14 @@ var _TinyCloudNode = class _TinyCloudNode {
21870
21979
  get freshEncryptionNetworkCreated() {
21871
21980
  return this._freshEncryptionNetworkCreated;
21872
21981
  }
21873
- /**
21874
- * Subscribe to `storage.full`. It fires on the first write any service had
21875
- * rejected because the owner's TinyCloud storage is full
21876
- * (`STORAGE_QUOTA_EXCEEDED` or `STORAGE_LIMIT_REACHED`), so an app can show
21877
- * one read-only banner. Reads keep working. For the signed-in account's own
21878
- * storage it fires once per episode: the episode ends only when a write to
21879
- * that storage succeeds, or on sign-out. A `storage.status()` read does not
21880
- * end it. A rejection on another owner's delegated space fires once per
21881
- * owner, until that owner's `storage.status()` reports space again. Returns
21882
- * the unsubscribe function.
21883
- */
21884
21982
  on(event, handler) {
21983
+ if (event === "replica.purge.failed") {
21984
+ const listener = handler;
21985
+ this.replicaPurgeFailedHandlers.add(listener);
21986
+ return () => {
21987
+ this.replicaPurgeFailedHandlers.delete(listener);
21988
+ };
21989
+ }
21885
21990
  if (event !== "storage.full") {
21886
21991
  throw new Error(`Unknown TinyCloud event: ${String(event)}`);
21887
21992
  }
@@ -22362,6 +22467,7 @@ var _TinyCloudNode = class _TinyCloudNode {
22362
22467
  const leavingAuth = this.auth;
22363
22468
  const leavingContext = this._serviceContext;
22364
22469
  let denied;
22470
+ let erased;
22365
22471
  try {
22366
22472
  this.teardownSession();
22367
22473
  } finally {
@@ -22372,6 +22478,7 @@ var _TinyCloudNode = class _TinyCloudNode {
22372
22478
  try {
22373
22479
  await this.accountRegistryTail;
22374
22480
  await this.quiesceReplicaRuntime();
22481
+ if (denied) erased = await this.eraseReplicaLocalCopy("sign_out", denied.status);
22375
22482
  } finally {
22376
22483
  if (leavingAddress) {
22377
22484
  await (leavingAuth ? leavingAuth.clearPersistedSession(leavingAddress) : this.config.sessionStorage?.clear(leavingAddress));
@@ -22379,8 +22486,37 @@ var _TinyCloudNode = class _TinyCloudNode {
22379
22486
  }
22380
22487
  }
22381
22488
  }
22382
- if (denied?.status === "unguarded") {
22383
- throw new Error(`Replica gate was not denied (${denied.code ?? "unknown"}); the replica may still be restorable.`);
22489
+ if (denied?.status === "unguarded" && erased?.outcome.status !== "erased") {
22490
+ throw Object.assign(
22491
+ new Error(`Replica gate was not denied (${denied.code ?? "unknown"}); the replica may still be restorable.`),
22492
+ {
22493
+ code: "REPLICA_PURGE_FAILED",
22494
+ reason: "gate_unavailable",
22495
+ retryNow: erased?.outcome.status === "failed"
22496
+ }
22497
+ );
22498
+ }
22499
+ }
22500
+ /**
22501
+ * Erases the browser local copy after a deny (retry, event and next-load marker live in the lazy
22502
+ * replication authority). Never rejects; `undefined` when replication is off or the storage keeps
22503
+ * no browser database.
22504
+ */
22505
+ async eraseReplicaLocalCopy(trigger, denyStatus) {
22506
+ const replication = this.config.replication;
22507
+ if (!replication?.enabled) return void 0;
22508
+ try {
22509
+ const { eraseReplicaLocalCopy: eraseReplicaLocalCopy2 } = await getNodeReplicationLoaders().authority();
22510
+ const erased = await eraseReplicaLocalCopy2(
22511
+ replication.storage.lifecycle,
22512
+ trigger,
22513
+ denyStatus,
22514
+ this.replicaPurgeFailedHandlers
22515
+ );
22516
+ if (erased?.logoutPending) this.replicaRestoreGate = "logout_pending";
22517
+ return erased;
22518
+ } catch {
22519
+ return void 0;
22384
22520
  }
22385
22521
  }
22386
22522
  /**
@@ -22440,6 +22576,8 @@ var _TinyCloudNode = class _TinyCloudNode {
22440
22576
  this._hooks = void 0;
22441
22577
  this._vault = void 0;
22442
22578
  this._encryption = void 0;
22579
+ this._namedKeyClient = void 0;
22580
+ this._keysUnavailable = [];
22443
22581
  this._baseVaults.clear();
22444
22582
  this._baseSecrets.clear();
22445
22583
  this._secrets.clear();
@@ -22544,6 +22682,10 @@ var _TinyCloudNode = class _TinyCloudNode {
22544
22682
  const priorPrincipal = this.replicaSessionPrincipal ?? (this.address ? pkhDid2(this.address, this._chainId) : void 0);
22545
22683
  if (this.config.replication?.enabled && priorPrincipal && priorPrincipal !== nextPrincipal) {
22546
22684
  const denial = await this.denyReplicaGate({ reason: "account_switch", principal: priorPrincipal, next: nextPrincipal });
22685
+ if (denial) {
22686
+ await this.quiesceReplicaRuntime();
22687
+ await this.eraseReplicaLocalCopy("account_switch", denial.status);
22688
+ }
22547
22689
  this.replicaRestoreGate = denial?.status === "unguarded" ? "gate_unavailable" : "stamp_stale";
22548
22690
  }
22549
22691
  if (address !== this._address || chainId !== this._chainId) {
@@ -22558,6 +22700,8 @@ var _TinyCloudNode = class _TinyCloudNode {
22558
22700
  this._hooks = void 0;
22559
22701
  this._vault = void 0;
22560
22702
  this._encryption = void 0;
22703
+ this._namedKeyClient = void 0;
22704
+ this._keysUnavailable = [];
22561
22705
  this._baseVaults.clear();
22562
22706
  this._baseSecrets.clear();
22563
22707
  this._secrets.clear();
@@ -22610,6 +22754,26 @@ var _TinyCloudNode = class _TinyCloudNode {
22610
22754
  this.assertSessionEpoch(epoch, "Sign-in");
22611
22755
  await this.ensureRequestedEncryptionNetworks();
22612
22756
  this.assertSessionEpoch(epoch, "Sign-in");
22757
+ this._keysUnavailable = this.auth?.unavailableKeyPaths ?? [];
22758
+ if (this._keysUnavailable.length > 0) {
22759
+ this.notificationHandler.warning(`Named keys unavailable: ${this._keysUnavailable.join(", ")}`);
22760
+ }
22761
+ if (this.nodeFeatures.includes("encryption-named-keys-v1")) {
22762
+ for (const manifest of this.auth?.capabilityRequest?.manifests ?? []) {
22763
+ for (const declaration of manifest.keys ?? []) {
22764
+ if ("path" in declaration && declaration.abilities.includes("key.create") && !this._keysUnavailable.includes(declaration.path)) {
22765
+ try {
22766
+ await this.keys.ensureKey(declaration.path);
22767
+ } catch (error) {
22768
+ this._keysUnavailable.push(declaration.path);
22769
+ const code = error && typeof error === "object" && "code" in error && typeof error.code === "string" && /^[A-Z_]+$/.test(error.code) ? error.code : "UNKNOWN";
22770
+ this.notificationHandler.warning(`Named key unavailable: ${declaration.path} (${code})`);
22771
+ }
22772
+ this.assertSessionEpoch(epoch, "Sign-in");
22773
+ }
22774
+ }
22775
+ }
22776
+ }
22613
22777
  if (!bootstrapped && this.config.manifest === void 0 && this.config.capabilityRequest === void 0) {
22614
22778
  await this.ensureOwnedSpaceHostedById(this.ownedSpaceId(SECRETS_SPACE2));
22615
22779
  }
@@ -23397,7 +23561,8 @@ var _TinyCloudNode = class _TinyCloudNode {
23397
23561
  const networkIds = /* @__PURE__ */ new Set();
23398
23562
  for (const resource of request.resources) {
23399
23563
  if (resource.service === ENCRYPTION_PERMISSION_SERVICE2 && resource.path.startsWith("urn:tinycloud:encryption:") && resource.actions.includes(DECRYPT_ACTION2)) {
23400
- networkIds.add(resource.path);
23564
+ const parsed = resource.path.includes("/") ? parseEncryptionResource2(resource.path) : { ...parseNetworkId2(resource.path), kind: "network" };
23565
+ if (parsed.kind === "network") networkIds.add(resource.path);
23401
23566
  }
23402
23567
  }
23403
23568
  return [...networkIds];
@@ -23947,6 +24112,8 @@ var _TinyCloudNode = class _TinyCloudNode {
23947
24112
  this._hooks = stagedGraph.hooks;
23948
24113
  this._vault = stagedGraph.vault;
23949
24114
  this._encryption = stagedGraph.encryption;
24115
+ this._namedKeyClient = void 0;
24116
+ this._keysUnavailable = [];
23950
24117
  this._capabilityRegistry = stagedGraph.capabilityRegistry;
23951
24118
  this._keyProvider = stagedGraph.keyProvider;
23952
24119
  this._sharingService = stagedGraph.sharingService;
@@ -25300,7 +25467,7 @@ var _TinyCloudNode = class _TinyCloudNode {
25300
25467
  * Sign a wallet (CACAO) revocation of the delegation `cid` for the node's
25301
25468
  * `POST /revoke`, and return its Authorization header value. The node
25302
25469
  * accepts it when the owner delegated `cid` or owns a space its abilities
25303
- * target, whichever key issued it. Valid for 60 seconds. Requires the
25470
+ * target, whichever key issued it. Valid for 10 minutes. Requires the
25304
25471
  * owner wallet signer.
25305
25472
  */
25306
25473
  async signOwnerRevocation(cid) {
@@ -25316,7 +25483,7 @@ var _TinyCloudNode = class _TinyCloudNode {
25316
25483
  chainId: session.chainId,
25317
25484
  nonce: generateNonce(),
25318
25485
  issuedAt: issuedAt.toISOString(),
25319
- expirationTime: new Date(issuedAt.getTime() + 6e4).toISOString()
25486
+ expirationTime: new Date(issuedAt.getTime() + OWNER_REVOCATION_WINDOW_MS).toISOString()
25320
25487
  }).prepareMessage();
25321
25488
  const signature2 = await this.signer.signMessage(siwe);
25322
25489
  return this.wasmBindings.siweToDelegationHeaders({ siwe, signature: signature2 }).Authorization;
@@ -25543,6 +25710,40 @@ var _TinyCloudNode = class _TinyCloudNode {
25543
25710
  get encryption() {
25544
25711
  return this.getEncryptionService();
25545
25712
  }
25713
+ /** Named keys bound to the current session. */
25714
+ get keys() {
25715
+ return new Proxy({}, {
25716
+ get: (_target, property) => {
25717
+ if (property === "refreshNodeInfo") {
25718
+ return () => {
25719
+ void this._namedKeyClient?.then((client) => client.refreshNodeInfo());
25720
+ };
25721
+ }
25722
+ if (typeof property !== "string" || ![
25723
+ "getPublicKey",
25724
+ "describeKey",
25725
+ "createKey",
25726
+ "blockKey",
25727
+ "unblockKey",
25728
+ "ensureKey",
25729
+ "encrypt",
25730
+ "decrypt",
25731
+ "decryptMany"
25732
+ ].includes(property)) return void 0;
25733
+ return (...args) => {
25734
+ this._namedKeyClient ?? (this._namedKeyClient = import("./encryption-keys.js").then(({ createNamedKeyClient }) => createNamedKeyClient(this)));
25735
+ return this._namedKeyClient.then((client) => {
25736
+ const method = client[property];
25737
+ return method.apply(client, args);
25738
+ });
25739
+ };
25740
+ }
25741
+ });
25742
+ }
25743
+ /** Manifest key paths unavailable during the latest `signIn()` attempt. */
25744
+ get keysUnavailable() {
25745
+ return this._keysUnavailable;
25746
+ }
25546
25747
  async getEncryptionNetwork(nameOrNetworkId = this.getDefaultEncryptionNetworkId()) {
25547
25748
  const networkId = nameOrNetworkId.startsWith("urn:tinycloud:encryption:") ? nameOrNetworkId : this.getDefaultEncryptionNetworkId(nameOrNetworkId);
25548
25749
  return this.fetchEncryptionNetworkAt(
@@ -28035,7 +28236,7 @@ import {
28035
28236
  CaveatedDelegationUnsupportedError as CaveatedDelegationUnsupportedError3,
28036
28237
  PermissionNotInManifestError as PermissionNotInManifestError2,
28037
28238
  SessionExpiredError as SessionExpiredError2,
28038
- ManifestValidationError,
28239
+ ManifestValidationError as ManifestValidationError2,
28039
28240
  composeManifestRequest as composeManifestRequest2,
28040
28241
  resolveManifest as resolveManifest2,
28041
28242
  validateManifest,
@@ -29180,7 +29381,8 @@ var SqliteReplicaHandle = class {
29180
29381
  options.signal.addEventListener("abort", onAbort, { once: true });
29181
29382
  const engine = new (__privateGet(this, _replica)).Replica({
29182
29383
  store: __privateGet(this, _store),
29183
- transportFor
29384
+ transportFor,
29385
+ ...this.spec.contentFetch === void 0 ? {} : { contentFetch: this.spec.contentFetch }
29184
29386
  });
29185
29387
  const running = engine.sync({ signal: abort.signal });
29186
29388
  const registration = { promise: running, abort: () => abort.abort() };
@@ -30699,7 +30901,7 @@ export {
30699
30901
  InvalidRestoredSessionError,
30700
30902
  KVService4 as KVService,
30701
30903
  MAX_SECRET_SCOPE_LENGTH,
30702
- ManifestValidationError,
30904
+ ManifestValidationError2 as ManifestValidationError,
30703
30905
  MemorySessionStorage,
30704
30906
  NETWORK_NAME_PATTERN,
30705
30907
  NetworkIdError,