@tinycloud/node-sdk 3.8.0-beta.3 → 3.8.0-beta.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/dist/index.d.cts CHANGED
@@ -1,12 +1,13 @@
1
1
  import { ISigner, Bytes, IWasmBindings, PersistedSessionProof, ISessionManager } from '@tinycloud/sdk-core';
2
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-CVO41O12.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-CxRHpusk.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
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';
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
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-B6VOBrCb.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-BKFo3t4u.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
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';
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
@@ -18783,9 +18783,9 @@ import {
18783
18783
  tinyCloudDebugLogger
18784
18784
  } from "@tinycloud/sdk-services";
18785
18785
  import { RequestLog, observeReplicaReads, readOnlyRequestLog } from "@tinycloud/sdk-services/telemetry/requestLog";
18786
+ import { parseEncryptionResource as parseEncryptionResource2 } from "@tinycloud/sdk-services/encryption/resource";
18786
18787
 
18787
18788
  // src/authorization/NodeUserAuthorization.ts
18788
- init_authority_sign_in();
18789
18789
  import { createHash } from "crypto";
18790
18790
  import { SiweMessage } from "siwe";
18791
18791
  import {
@@ -18794,10 +18794,10 @@ import {
18794
18794
  activateSessionWithHost,
18795
18795
  checkNodeInfo,
18796
18796
  AutoApproveSpaceCreationHandler,
18797
+ ManifestValidationError,
18797
18798
  DEFAULT_MANIFEST_SPACE,
18798
18799
  ENCRYPTION_PERMISSION_SERVICE,
18799
18800
  composeManifestRequest,
18800
- parseNetworkId,
18801
18801
  principalDidEquals as principalDidEquals2,
18802
18802
  resourceCapabilitiesToAbilitiesMap,
18803
18803
  resourceCapabilitiesToSpaceAbilitiesMap,
@@ -18825,6 +18825,35 @@ import {
18825
18825
  HOOKS,
18826
18826
  ENCRYPTION
18827
18827
  } from "@tinycloud/sdk-core";
18828
+ import { parseEncryptionResource } from "@tinycloud/sdk-services/encryption/resource";
18829
+ import { parseNetworkId } from "@tinycloud/sdk-services";
18830
+
18831
+ // src/authorization/appKeyHostBinding.ts
18832
+ var DOMAIN_LABEL = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/;
18833
+ var IPV4 = /^\d+\.\d+\.\d+\.\d+$/;
18834
+ var APP_ID = /^[a-z0-9][a-z0-9._-]{0,63}$/;
18835
+ function appKeyHostBinding(domain, appId) {
18836
+ if (!APP_ID.test(appId)) return false;
18837
+ if (domain.endsWith(":")) return false;
18838
+ let url;
18839
+ try {
18840
+ url = new URL(`https://${domain}`);
18841
+ } catch {
18842
+ return false;
18843
+ }
18844
+ if (url.protocol !== "https:" || url.port !== "" || url.username !== "" || url.password !== "") return false;
18845
+ if (url.pathname !== "/" || url.search !== "" || url.hash !== "") return false;
18846
+ const host = url.hostname;
18847
+ if (host.startsWith("[") || host.endsWith(".") || IPV4.test(host)) return false;
18848
+ const labels = host.split(".");
18849
+ if (labels.length < 2 || labels[labels.length - 1] === "localhost") return false;
18850
+ if (!labels.every((label) => DOMAIN_LABEL.test(label))) return false;
18851
+ const reversed = labels.reverse().join(".");
18852
+ return appId === reversed || appId.startsWith(`${reversed}.`);
18853
+ }
18854
+
18855
+ // src/authorization/NodeUserAuthorization.ts
18856
+ init_authority_sign_in();
18828
18857
 
18829
18858
  // src/authorization/caveatRefusal.ts
18830
18859
  import {
@@ -19338,6 +19367,23 @@ var NodeUserAuthorization = class {
19338
19367
  );
19339
19368
  return this._capabilityRequest;
19340
19369
  }
19370
+ async refreshNamedKeyFeatureForSignIn(address, chainId) {
19371
+ const request = this.getCapabilityRequest();
19372
+ const siweDomain = this.siweConfig?.domain ?? this.domain;
19373
+ const hasNamedKeys = request?.manifests.some((manifest) => manifest.keys?.length && appKeyHostBinding(siweDomain, manifest.keys_app_id ?? manifest.app_id));
19374
+ if (hasNamedKeys) {
19375
+ await this.resolveTinyCloudHostsForSignIn(address, chainId);
19376
+ await this.refreshNodeInfo();
19377
+ }
19378
+ }
19379
+ /** Manifest key paths that this sign-in cannot grant. */
19380
+ get unavailableKeyPaths() {
19381
+ const request = this.getCapabilityRequest();
19382
+ const siweDomain = this.siweConfig?.domain ?? this.domain;
19383
+ return (request?.manifests ?? []).flatMap(
19384
+ (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)
19385
+ );
19386
+ }
19341
19387
  resolveSpaceName(space, address, chainId) {
19342
19388
  if (space.startsWith("tinycloud:")) {
19343
19389
  return space;
@@ -19529,15 +19575,31 @@ var NodeUserAuthorization = class {
19529
19575
  }
19530
19576
  const rawAbilities = {};
19531
19577
  const currentDid = pkhDid(address, chainId);
19578
+ if (this._nodeFeatures.includes("encryption-named-keys-v1")) {
19579
+ const siweDomain = this.siweConfig?.domain ?? this.domain;
19580
+ for (const manifest of request.manifests) {
19581
+ if (!appKeyHostBinding(siweDomain, manifest.keys_app_id ?? manifest.app_id)) continue;
19582
+ for (const declaration of manifest.keys ?? []) {
19583
+ const path = "path" in declaration ? declaration.path : declaration.prefix;
19584
+ const resource = `urn:tinycloud:encryption:${currentDid}:default/${path}`;
19585
+ for (const ability of declaration.abilities) {
19586
+ addRawAbility(rawAbilities, resource, `tinycloud.encryption/${ability}`);
19587
+ }
19588
+ }
19589
+ }
19590
+ }
19532
19591
  const spaceResources = request.resources.filter((entry) => {
19533
19592
  if (entry.service !== ENCRYPTION_PERMISSION_SERVICE) {
19534
19593
  return true;
19535
19594
  }
19595
+ const parsed = entry.path.includes("/") ? parseEncryptionResource(entry.path) : { ...parseNetworkId(entry.path), kind: "network" };
19596
+ if (parsed.kind !== "network") {
19597
+ throw new ManifestValidationError("named keys go in manifest.keys");
19598
+ }
19536
19599
  for (const action of entry.actions) {
19537
19600
  addRawAbility(rawAbilities, entry.path, action);
19538
19601
  }
19539
- if (entry.actions.includes(DECRYPT_ACTION)) {
19540
- const parsed = parseNetworkId(entry.path);
19602
+ if (entry.actions.includes(DECRYPT_ACTION) && parsed.kind === "network") {
19541
19603
  if (didPrincipalMatches(parsed.ownerDid, currentDid)) {
19542
19604
  addRawAbility(rawAbilities, entry.path, NETWORK_CREATE_ACTION);
19543
19605
  }
@@ -19933,6 +19995,8 @@ var NodeUserAuthorization = class {
19933
19995
  this._chainId = chainId;
19934
19996
  await this.resolveTinyCloudHostsForSignIn(address, chainId);
19935
19997
  this.assertSignInCurrent(generation);
19998
+ await this.refreshNamedKeyFeatureForSignIn(address, chainId);
19999
+ this.assertSignInCurrent(generation);
19936
20000
  const keyId = `session-${Date.now()}`;
19937
20001
  this.sessionManager.renameSessionKeyId(this.activeSessionKeyId, keyId);
19938
20002
  this.activeSessionKeyId = keyId;
@@ -20079,6 +20143,7 @@ var NodeUserAuthorization = class {
20079
20143
  refuseCaveated(this.getCapabilityRequest()?.manifests);
20080
20144
  const address = canonicalizeAddress(await this.signer.getAddress());
20081
20145
  const chainId = await this.signer.getChainId();
20146
+ await this.refreshNamedKeyFeatureForSignIn(address, chainId);
20082
20147
  const keyId = `session-${Date.now()}`;
20083
20148
  this.sessionManager.renameSessionKeyId(this.activeSessionKeyId, keyId);
20084
20149
  this.activeSessionKeyId = keyId;
@@ -21678,6 +21743,7 @@ var _TinyCloudNode = class _TinyCloudNode {
21678
21743
  return void 0;
21679
21744
  }
21680
21745
  };
21746
+ this._keysUnavailable = [];
21681
21747
  this._baseVaults = /* @__PURE__ */ new Map();
21682
21748
  this._baseSecrets = /* @__PURE__ */ new Map();
21683
21749
  this._secrets = /* @__PURE__ */ new Map();
@@ -22505,6 +22571,8 @@ var _TinyCloudNode = class _TinyCloudNode {
22505
22571
  this._hooks = void 0;
22506
22572
  this._vault = void 0;
22507
22573
  this._encryption = void 0;
22574
+ this._namedKeyClient = void 0;
22575
+ this._keysUnavailable = [];
22508
22576
  this._baseVaults.clear();
22509
22577
  this._baseSecrets.clear();
22510
22578
  this._secrets.clear();
@@ -22627,6 +22695,8 @@ var _TinyCloudNode = class _TinyCloudNode {
22627
22695
  this._hooks = void 0;
22628
22696
  this._vault = void 0;
22629
22697
  this._encryption = void 0;
22698
+ this._namedKeyClient = void 0;
22699
+ this._keysUnavailable = [];
22630
22700
  this._baseVaults.clear();
22631
22701
  this._baseSecrets.clear();
22632
22702
  this._secrets.clear();
@@ -22679,6 +22749,26 @@ var _TinyCloudNode = class _TinyCloudNode {
22679
22749
  this.assertSessionEpoch(epoch, "Sign-in");
22680
22750
  await this.ensureRequestedEncryptionNetworks();
22681
22751
  this.assertSessionEpoch(epoch, "Sign-in");
22752
+ this._keysUnavailable = this.auth?.unavailableKeyPaths ?? [];
22753
+ if (this._keysUnavailable.length > 0) {
22754
+ this.notificationHandler.warning(`Named keys unavailable: ${this._keysUnavailable.join(", ")}`);
22755
+ }
22756
+ if (this.nodeFeatures.includes("encryption-named-keys-v1")) {
22757
+ for (const manifest of this.auth?.capabilityRequest?.manifests ?? []) {
22758
+ for (const declaration of manifest.keys ?? []) {
22759
+ if ("path" in declaration && declaration.abilities.includes("key.create") && !this._keysUnavailable.includes(declaration.path)) {
22760
+ try {
22761
+ await this.keys.ensureKey(declaration.path);
22762
+ } catch (error) {
22763
+ this._keysUnavailable.push(declaration.path);
22764
+ const code = error && typeof error === "object" && "code" in error && typeof error.code === "string" && /^[A-Z_]+$/.test(error.code) ? error.code : "UNKNOWN";
22765
+ this.notificationHandler.warning(`Named key unavailable: ${declaration.path} (${code})`);
22766
+ }
22767
+ this.assertSessionEpoch(epoch, "Sign-in");
22768
+ }
22769
+ }
22770
+ }
22771
+ }
22682
22772
  if (!bootstrapped && this.config.manifest === void 0 && this.config.capabilityRequest === void 0) {
22683
22773
  await this.ensureOwnedSpaceHostedById(this.ownedSpaceId(SECRETS_SPACE2));
22684
22774
  }
@@ -23466,7 +23556,8 @@ var _TinyCloudNode = class _TinyCloudNode {
23466
23556
  const networkIds = /* @__PURE__ */ new Set();
23467
23557
  for (const resource of request.resources) {
23468
23558
  if (resource.service === ENCRYPTION_PERMISSION_SERVICE2 && resource.path.startsWith("urn:tinycloud:encryption:") && resource.actions.includes(DECRYPT_ACTION2)) {
23469
- networkIds.add(resource.path);
23559
+ const parsed = resource.path.includes("/") ? parseEncryptionResource2(resource.path) : { ...parseNetworkId2(resource.path), kind: "network" };
23560
+ if (parsed.kind === "network") networkIds.add(resource.path);
23470
23561
  }
23471
23562
  }
23472
23563
  return [...networkIds];
@@ -24016,6 +24107,8 @@ var _TinyCloudNode = class _TinyCloudNode {
24016
24107
  this._hooks = stagedGraph.hooks;
24017
24108
  this._vault = stagedGraph.vault;
24018
24109
  this._encryption = stagedGraph.encryption;
24110
+ this._namedKeyClient = void 0;
24111
+ this._keysUnavailable = [];
24019
24112
  this._capabilityRegistry = stagedGraph.capabilityRegistry;
24020
24113
  this._keyProvider = stagedGraph.keyProvider;
24021
24114
  this._sharingService = stagedGraph.sharingService;
@@ -25612,6 +25705,40 @@ var _TinyCloudNode = class _TinyCloudNode {
25612
25705
  get encryption() {
25613
25706
  return this.getEncryptionService();
25614
25707
  }
25708
+ /** Named keys bound to the current session. */
25709
+ get keys() {
25710
+ return new Proxy({}, {
25711
+ get: (_target, property) => {
25712
+ if (property === "refreshNodeInfo") {
25713
+ return () => {
25714
+ void this._namedKeyClient?.then((client) => client.refreshNodeInfo());
25715
+ };
25716
+ }
25717
+ if (typeof property !== "string" || ![
25718
+ "getPublicKey",
25719
+ "describeKey",
25720
+ "createKey",
25721
+ "blockKey",
25722
+ "unblockKey",
25723
+ "ensureKey",
25724
+ "encrypt",
25725
+ "decrypt",
25726
+ "decryptMany"
25727
+ ].includes(property)) return void 0;
25728
+ return (...args) => {
25729
+ this._namedKeyClient ?? (this._namedKeyClient = import("./encryption-keys.js").then(({ createNamedKeyClient }) => createNamedKeyClient(this)));
25730
+ return this._namedKeyClient.then((client) => {
25731
+ const method = client[property];
25732
+ return method.apply(client, args);
25733
+ });
25734
+ };
25735
+ }
25736
+ });
25737
+ }
25738
+ /** Manifest key paths unavailable during the latest `signIn()` attempt. */
25739
+ get keysUnavailable() {
25740
+ return this._keysUnavailable;
25741
+ }
25615
25742
  async getEncryptionNetwork(nameOrNetworkId = this.getDefaultEncryptionNetworkId()) {
25616
25743
  const networkId = nameOrNetworkId.startsWith("urn:tinycloud:encryption:") ? nameOrNetworkId : this.getDefaultEncryptionNetworkId(nameOrNetworkId);
25617
25744
  return this.fetchEncryptionNetworkAt(
@@ -28104,7 +28231,7 @@ import {
28104
28231
  CaveatedDelegationUnsupportedError as CaveatedDelegationUnsupportedError3,
28105
28232
  PermissionNotInManifestError as PermissionNotInManifestError2,
28106
28233
  SessionExpiredError as SessionExpiredError2,
28107
- ManifestValidationError,
28234
+ ManifestValidationError as ManifestValidationError2,
28108
28235
  composeManifestRequest as composeManifestRequest2,
28109
28236
  resolveManifest as resolveManifest2,
28110
28237
  validateManifest,
@@ -30768,7 +30895,7 @@ export {
30768
30895
  InvalidRestoredSessionError,
30769
30896
  KVService4 as KVService,
30770
30897
  MAX_SECRET_SCOPE_LENGTH,
30771
- ManifestValidationError,
30898
+ ManifestValidationError2 as ManifestValidationError,
30772
30899
  MemorySessionStorage,
30773
30900
  NETWORK_NAME_PATTERN,
30774
30901
  NetworkIdError,