@tinycloud/sdk-core 2.4.0-beta.2 → 2.4.0-beta.7

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,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { InvokeFunction, InvokeAnyFunction, ParsedNetworkId, ServiceError, Result as Result$1, ServiceSession, FetchFunction, ServiceConstructor, RetryPolicy, TelemetryConfig, IServiceContext, IService, IKVService, ISQLService, IDuckDbService, IHooksService, IDataVaultService, IEncryptionService } from '@tinycloud/sdk-services';
2
+ import { InvokeFunction, InvokeAnyFunction, ParsedNetworkId, ServiceError, Result as Result$1, ServiceSession, FetchFunction, ServiceConstructor, RetryPolicy, TelemetryConfig, IServiceContext, IService, IKVService, ISQLService, IDuckDbService, IHooksService, IDataVaultService, IEncryptionService, IDatabaseHandle, SqlValue, QueryResponse } from '@tinycloud/sdk-services';
3
3
  export { BatchOptions, BatchResponse, BuildCanonicalDecryptRequestInput, BuildDecryptFactsInput, BuildDecryptInvocationInput, BuiltDecryptInvocation, CanonicalDecryptRequest, CanonicalJson, ColumnInfo, DECRYPT_ACTION, DECRYPT_FACT_TYPE, DECRYPT_RESULT_TYPE, DEFAULT_ENCRYPTION_ALG, DEFAULT_KEY_VERSION, DataVaultConfig, DataVaultService, DatabaseHandle, DecryptCapabilityProof, DecryptEnvelopeOptions, DecryptInvocationFact, DecryptInvocationSigner, DecryptRequestBody, DecryptResponseBody, DecryptTransport, 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, EncryptToNetworkInput, EncryptToNetworkOptions, EncryptToNetworkResult, EncryptionCrypto, EncryptionError, EncryptionErrorInput, EncryptionService, EncryptionServiceConfig, ErrorCode, ErrorCodes, ExecuteOptions, ExecuteResponse, FetchFunction, HookEvent, HookServiceName, HookStreamEvent, HookSubscription, HookWebhookListOptions, HookWebhookRecord, HookWebhookRegistration, HookWebhookScope, HookWebhookUnregisterOptions, HooksService, HooksServiceConfig, IDataVaultService, IDatabaseHandle, IDuckDbDatabaseHandle, IDuckDbService, IEncryptionService, IHooksService, IKVService, IPrefixedKVService, ISQLService, ISecretsService, IService, IServiceContext, InlineEncryptedEnvelope, InvokeAnyEntry, InvokeAnyFunction, InvokeFunction, KVCreateSignedReadUrlOptions, KVDeleteOptions, KVGetOptions, KVHeadOptions, KVListOptions, KVListResponse, KVPutOptions, KVResponse, KVResponseHeaders, KVService, KVServiceConfig, KVSignedReadUrlResponse, NETWORK_NAME_PATTERN, NetworkDescriptor, NetworkIdError, NodeDescriptorFetcher, ParsedNetworkId, PrefixedKVService, QueryOptions, QueryResponse, RandomReceiverKeyInput, ReceiverKeyPair, ReceiverKeySigner, ResolvedSecretPath, Result, RetryPolicy, SECRET_NAME_RE, SQLAction, SQLActionType, SQLService, SQLServiceConfig, SchemaInfo, SecretPayload, SecretScopeOptions, SecretsError, SecretsService, ServiceContext, ServiceContextConfig, ServiceError, ServiceSession, SignedReceiverKeyInput, SqlStatement, SqlValue, SubscribeOptions, TableInfo, TelemetryConfig, TelemetryEventHandler, VaultCrypto, VaultEntry, VaultError, VaultGetOptions, VaultGrantOptions, VaultHeaders, VaultListOptions, VaultPublicSpaceKVActions, VaultPutOptions, VerifyDecryptResponseInput, ViewInfo, WasmVaultFunctions, WellKnownDescriptorFetcher, buildCanonicalDecryptRequest, buildDecryptAttenuation, buildDecryptFacts, buildDecryptInvocation, buildNetworkId, canonicalHashHex, canonicalSignedResponse, canonicalizeEncryptionJson, canonicalizeSecretScope, checkDecryptInvocationInput, createVaultCrypto, decryptEnvelopeWithKey, defaultRetryPolicy, deriveSignedReceiverKey, discoverNetwork, encryptToNetwork, base64Decode as encryptionBase64Decode, base64Encode as encryptionBase64Encode, encryptionError, utf8Decode as encryptionUtf8Decode, utf8Encode as encryptionUtf8Encode, ensureNetworkUsableForDecrypt, err, generateRandomReceiverKey, hexDecode, hexEncode, isNetworkId, networkDiscoveryKey, ok, openWrappedKey, parseNetworkId, resolveSecretListPrefix, resolveSecretPath, serviceError, validateEnvelope, verifyDecryptResponse } from '@tinycloud/sdk-services';
4
4
  export { SiweMessage } from 'siwe';
5
5
 
@@ -3505,63 +3505,6 @@ declare class TinyCloud {
3505
3505
  static readPublicKey<T = unknown>(host: string, address: string, chainId: number, key: string, fetchFn?: FetchFunction): Promise<Result$1<T, ServiceError>>;
3506
3506
  }
3507
3507
 
3508
- /**
3509
- * Shared space utilities for TinyCloud.
3510
- *
3511
- * These functions are platform-agnostic and can be used by both
3512
- * web-sdk and node-sdk for space hosting and session activation.
3513
- */
3514
- /**
3515
- * Result of a space hosting or session activation attempt.
3516
- */
3517
- interface SpaceHostResult {
3518
- /** Whether the operation succeeded (2xx status) */
3519
- success: boolean;
3520
- /** HTTP status code */
3521
- status: number;
3522
- /** Error message if failed */
3523
- error?: string;
3524
- /** Space IDs that were successfully activated */
3525
- activated?: string[];
3526
- /** Space IDs that were skipped (e.g., space doesn't exist yet) */
3527
- skipped?: string[];
3528
- }
3529
- /**
3530
- * Fetch the peer ID from TinyCloud server for space hosting.
3531
- *
3532
- * The peer ID identifies the TinyCloud server instance that will host the space.
3533
- *
3534
- * @param host - TinyCloud server URL (e.g., "https://node.tinycloud.xyz")
3535
- * @param spaceId - The space ID to host
3536
- * @returns The peer ID string
3537
- * @throws Error if the request fails
3538
- */
3539
- declare function fetchPeerId(host: string, spaceId: string): Promise<string>;
3540
- /**
3541
- * Submit a space hosting delegation to TinyCloud server.
3542
- *
3543
- * This registers a new space with the server, allowing the user
3544
- * to store data in it.
3545
- *
3546
- * @param host - TinyCloud server URL
3547
- * @param headers - Delegation headers (from siweToDelegationHeaders)
3548
- * @returns Result indicating success/failure
3549
- */
3550
- declare function submitHostDelegation(host: string, headers: Record<string, string>): Promise<SpaceHostResult>;
3551
- /**
3552
- * Activate a session with TinyCloud server.
3553
- *
3554
- * This submits the session delegation to the server, enabling the session
3555
- * key to perform operations on behalf of the user.
3556
- *
3557
- * @param host - TinyCloud server URL
3558
- * @param delegationHeader - Session delegation header (from session.delegationHeader)
3559
- * @returns Result indicating success/failure (404 means space doesn't exist)
3560
- */
3561
- declare function activateSessionWithHost(host: string, delegationHeader: {
3562
- Authorization: string;
3563
- }): Promise<SpaceHostResult>;
3564
-
3565
3508
  /**
3566
3509
  * DelegationManager - Handles delegation CRUD operations.
3567
3510
  *
@@ -4312,6 +4255,8 @@ interface SpaceServiceConfig {
4312
4255
  * Required for space.delegations.create() to work.
4313
4256
  */
4314
4257
  createDelegation?: CreateDelegationFunction;
4258
+ /** Optional best-effort hook after the SDK discovers or creates a space. */
4259
+ onSpaceRegistered?: (space: SpaceInfo) => void | Promise<void>;
4315
4260
  }
4316
4261
  /**
4317
4262
  * Interface for SpaceService.
@@ -4432,6 +4377,7 @@ declare class SpaceService implements ISpaceService {
4432
4377
  private _userDid?;
4433
4378
  private sharingService?;
4434
4379
  private createDelegationFn?;
4380
+ private onSpaceRegisteredFn?;
4435
4381
  /** Cache of created Space objects */
4436
4382
  private spaceCache;
4437
4383
  /** Cache of space info */
@@ -4489,6 +4435,7 @@ declare class SpaceService implements ISpaceService {
4489
4435
  * @param name - The name for the new space
4490
4436
  */
4491
4437
  create(name: string): Promise<Result$1<SpaceInfo, ServiceError>>;
4438
+ private notifySpaceRegistered;
4492
4439
  /**
4493
4440
  * Get a Space object by name or full URI.
4494
4441
  *
@@ -4535,6 +4482,183 @@ declare class SpaceService implements ISpaceService {
4535
4482
  */
4536
4483
  declare function createSpaceService(config: SpaceServiceConfig): ISpaceService;
4537
4484
 
4485
+ interface AccountApplication {
4486
+ appId: string;
4487
+ manifests: Manifest[];
4488
+ updatedAt?: string;
4489
+ name?: string;
4490
+ description?: string;
4491
+ manifestHash?: string;
4492
+ }
4493
+ interface AccountSpace {
4494
+ spaceId: string;
4495
+ name: string;
4496
+ ownerDid: string;
4497
+ type: "owned" | "delegated" | "discovered";
4498
+ permissions: string[];
4499
+ status: "active" | "archived";
4500
+ registeredAt?: string;
4501
+ updatedAt?: string;
4502
+ expiresAt?: Date;
4503
+ }
4504
+ interface AccountDelegation {
4505
+ cid: string;
4506
+ direction: "granted" | "received";
4507
+ spaceId: string;
4508
+ spaceName?: string;
4509
+ counterpartyDid: string;
4510
+ delegateDid: string;
4511
+ delegatorDid?: string;
4512
+ path: string;
4513
+ actions: string[];
4514
+ expiry: Date;
4515
+ status: "active" | "expired" | "revoked";
4516
+ createdAt?: Date;
4517
+ }
4518
+ interface AccountStatus {
4519
+ did: string;
4520
+ host: string;
4521
+ primarySpaceId?: string;
4522
+ accountSpaceId?: string;
4523
+ applications: number;
4524
+ spaces: number;
4525
+ grantedDelegations: number;
4526
+ receivedDelegations: number;
4527
+ }
4528
+ interface AccountIndexRebuildResult {
4529
+ database: string;
4530
+ applications: number;
4531
+ spaces: number;
4532
+ delegations: number;
4533
+ syncedAt: string;
4534
+ }
4535
+ interface AccountDelegationListOptions {
4536
+ direction?: "granted" | "received" | "all";
4537
+ space?: string;
4538
+ }
4539
+ interface AccountDelegationRevokeOptions {
4540
+ cid: string;
4541
+ space: string;
4542
+ }
4543
+ interface AccountServiceConfig {
4544
+ getDid: () => string;
4545
+ getHost: () => string;
4546
+ getPrimarySpaceId: () => string | undefined;
4547
+ getAccountSpaceId: () => string | undefined;
4548
+ getSpaces: () => ISpaceService;
4549
+ getAccountDb?: () => IDatabaseHandle | undefined;
4550
+ ensureAccountSpaceHosted?: () => Promise<void>;
4551
+ }
4552
+ declare class AccountService {
4553
+ private readonly config;
4554
+ constructor(config: AccountServiceConfig);
4555
+ status(): Promise<Result$1<AccountStatus>>;
4556
+ readonly applications: {
4557
+ list: () => Promise<Result$1<AccountApplication[]>>;
4558
+ get: (appId: string) => Promise<Result$1<AccountApplication>>;
4559
+ register: (manifest: Manifest | Manifest[]) => Promise<Result$1<AccountApplication>>;
4560
+ remove: (appId: string) => Promise<Result$1<void>>;
4561
+ };
4562
+ readonly spaces: {
4563
+ list: () => Promise<Result$1<AccountSpace[]>>;
4564
+ get: (spaceId: string) => Promise<Result$1<AccountSpace>>;
4565
+ register: (space: SpaceInfo | AccountSpace) => Promise<Result$1<AccountSpace>>;
4566
+ syncAccessible: () => Promise<Result$1<AccountSpace[]>>;
4567
+ remove: (spaceId: string) => Promise<Result$1<void>>;
4568
+ };
4569
+ readonly delegations: {
4570
+ list: (options?: AccountDelegationListOptions) => Promise<Result$1<AccountDelegation[]>>;
4571
+ revoke: (options: AccountDelegationRevokeOptions) => Promise<Result$1<void>>;
4572
+ };
4573
+ readonly index: {
4574
+ rebuild: () => Promise<Result$1<AccountIndexRebuildResult>>;
4575
+ applications: {
4576
+ list: () => Promise<Result$1<AccountApplication[]>>;
4577
+ };
4578
+ spaces: {
4579
+ list: () => Promise<Result$1<AccountSpace[]>>;
4580
+ };
4581
+ delegations: {
4582
+ list: (options?: AccountDelegationListOptions) => Promise<Result$1<AccountDelegation[]>>;
4583
+ };
4584
+ query: <T = Record<string, unknown>>(sql: string, params?: SqlValue[]) => Promise<Result$1<QueryResponse<T>>>;
4585
+ status: () => Promise<Result$1<AccountIndexStatus>>;
4586
+ };
4587
+ private accountKV;
4588
+ private accountDb;
4589
+ private indexHasApplicationHash;
4590
+ private upsertApplicationIndex;
4591
+ private deleteApplicationIndex;
4592
+ private upsertSpaceIndex;
4593
+ private deleteSpaceIndex;
4594
+ private resolveSpace;
4595
+ }
4596
+ interface AccountIndexStatus {
4597
+ database: string;
4598
+ sources: Array<{
4599
+ source: string;
4600
+ syncedAt: string;
4601
+ count: number;
4602
+ }>;
4603
+ }
4604
+
4605
+ /**
4606
+ * Shared space utilities for TinyCloud.
4607
+ *
4608
+ * These functions are platform-agnostic and can be used by both
4609
+ * web-sdk and node-sdk for space hosting and session activation.
4610
+ */
4611
+ /**
4612
+ * Result of a space hosting or session activation attempt.
4613
+ */
4614
+ interface SpaceHostResult {
4615
+ /** Whether the operation succeeded (2xx status) */
4616
+ success: boolean;
4617
+ /** HTTP status code */
4618
+ status: number;
4619
+ /** Error message if failed */
4620
+ error?: string;
4621
+ /** Space IDs that were successfully activated */
4622
+ activated?: string[];
4623
+ /** Space IDs that were skipped (e.g., space doesn't exist yet) */
4624
+ skipped?: string[];
4625
+ }
4626
+ /**
4627
+ * Fetch the peer ID from TinyCloud server for space hosting.
4628
+ *
4629
+ * The peer ID identifies the TinyCloud server instance that will host the space.
4630
+ *
4631
+ * @param host - TinyCloud server URL (e.g., "https://node.tinycloud.xyz")
4632
+ * @param spaceId - The space ID to host
4633
+ * @returns The peer ID string
4634
+ * @throws Error if the request fails
4635
+ */
4636
+ declare function fetchPeerId(host: string, spaceId: string): Promise<string>;
4637
+ /**
4638
+ * Submit a space hosting delegation to TinyCloud server.
4639
+ *
4640
+ * This registers a new space with the server, allowing the user
4641
+ * to store data in it.
4642
+ *
4643
+ * @param host - TinyCloud server URL
4644
+ * @param headers - Delegation headers (from siweToDelegationHeaders)
4645
+ * @returns Result indicating success/failure
4646
+ */
4647
+ declare function submitHostDelegation(host: string, headers: Record<string, string>): Promise<SpaceHostResult>;
4648
+ /**
4649
+ * Activate a session with TinyCloud server.
4650
+ *
4651
+ * This submits the session delegation to the server, enabling the session
4652
+ * key to perform operations on behalf of the user.
4653
+ *
4654
+ * @param host - TinyCloud server URL
4655
+ * @param delegationHeader - Session delegation header (from session.delegationHeader)
4656
+ * @returns Result indicating success/failure (404 means space doesn't exist)
4657
+ */
4658
+ declare function activateSessionWithHost(host: string, delegationHeader: {
4659
+ Authorization: string;
4660
+ }): Promise<SpaceHostResult>;
4661
+
4538
4662
  /**
4539
4663
  * Protocol version checking for SDK-to-node compatibility.
4540
4664
  *
@@ -4697,4 +4821,4 @@ declare const EXPIRY: {
4697
4821
  declare const DEFAULT_SIGNED_READ_URL_EXPIRY_MS: number;
4698
4822
  type ExpiryTier = keyof typeof EXPIRY;
4699
4823
 
4700
- export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, type AbilitiesMap, AutoApproveSpaceCreationHandler, type AutoRejectStrategy, type AutoSignStrategy, type Bytes, type CallbackStrategy, type CanonicalAddress, type CanonicalParsedNetworkId, type CapabilityEntry, CapabilityKeyRegistry, type CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, type ClientSession, ClientSessionSchema, CloudLocationResolutionError, type ComposeManifestOptions, type ComposedManifestRequest, type CreateDelegationFunction, type CreateDelegationParams, type CreateDelegationWasmParams, type CreateDelegationWasmResult, DEFAULT_DEFAULTS, DEFAULT_EXPIRY, DEFAULT_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, DEFAULT_SIGNED_READ_URL_EXPIRY_MS, DEFAULT_TINYCLOUD_FALLBACK_HOST, DEFAULT_TINYCLOUD_LOCATION_REGISTRY_URL, type DelegatedResource, type Delegation, type DelegationApiResponse, type DelegationChain, type DelegationChainV2, type DelegationDirection, type DelegationError, type DelegationErrorCode, DelegationErrorCodes, type DelegationFilters, DelegationManager, type DelegationManagerConfig, type DelegationRecord, type Result as DelegationResult, type DidCacheKeyOptions, type DidEqualsOptions, ENCRYPTION_MANIFEST_SPACE, ENCRYPTION_PERMISSION_SERVICE, EXPIRY, type EncodedShareData, type EnsData, EnsDataSchema, type EventEmitterStrategy, type ExpiryTier, type Extension, type GenerateShareParams, type ICapabilityKeyRegistry, type IENSResolver, type INotificationHandler, type ISessionManager, type ISessionStorage, type ISharingService, type ISigner, type ISpace, type ISpaceCreationHandler, type ISpaceScopedDelegations, type ISpaceScopedSharing, type ISpaceService, type IUserAuthorization, type IWasmBindings, IdentityParseError, type IngestOptions, type JWK, type KeyInfo, type KeyProvider, type KeyType, type LocationCandidate, type LocationCandidateInput, type LocationRecord, type LocationRecordPayload, type LocationRecordSigner, LocationRecordValidationError, type LocationResolutionAttempt, type LocationSource, type Manifest, type ManifestDefaults, type ManifestRegistryRecord, type ManifestSecretActions, ManifestValidationError, type NodeInfo, type ParseRecapFromSiwe, type PartialSiweMessage, type PermissionEntry, PermissionNotInManifestError, type PersistedSessionData, type PersistedTinyCloudSession, type PkhDidParts, ProtocolMismatchError, type ReceiveOptions, type ResolveCloudLocationOptions, type ResolveTinyCloudHostsOptions, type ResolvedCapabilities, type ResolvedCloudLocation, type ResolvedDelegate, type ResolvedTinyCloudHosts, type ResourceCapability, SERVICE_LONG_TO_SHORT, SERVICE_SHORT_TO_LONG, type ServerHost, SessionExpiredError, type ShareAccess, type ShareLink, type ShareLinkData, type ShareSchema, SharingService, type SharingServiceConfig, type SignCallback, type SignInOptions, type SignRequest, type SignResponse, type SignStrategy, SilentNotificationHandler, type SiweConfig, SiweConfigSchema, Space, type SpaceAbilitiesMap, type SpaceConfig, type SpaceCreationContext, type SpaceDelegationParams, type SpaceErrorCode, SpaceErrorCodes, type SpaceHostResult, type SpaceInfo, type SpaceOwnership, SpaceService, type SpaceServiceConfig, type StoredDelegationChain, type SubsetCheckResult, TinyCloud, type TinyCloudConfig, type TinyCloudSession, UnsupportedFeatureError, type UserAuthorizationConfig, VAULT_PERMISSION_SERVICE, type ValidationError, VersionCheckError, type WasmRecapEntry, activateSessionWithHost, addressStorageKey, applyPrefix, buildSpaceUri, canonicalLocationPayload, canonicalizeAddress, canonicalizeDid, canonicalizeDidUrl, canonicalizeNetworkId, checkNodeInfo, composeManifestRequest, createCapabilityKeyRegistry, createSharingService, createSpaceService, defaultSignStrategy, defaultSpaceCreationHandler, didCacheKey, didEquals, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, fetchLocationRecord, fetchPeerId, httpUrlToMultiaddr, isCapabilitySubset, isEvmAddress, loadManifest, locationPayloadForRecord, makePkhSpaceId, makePublicSpaceId, manifestAbilitiesUnion, multiaddrToHttpUrl, normalizeDefaults, parseCanonicalNetworkId, parseExpiry, parsePkhDid, parseRecapCapabilities, parseSpaceUri, pkhDid, principalDid, principalDidEquals, resolveCloudLocation, resolveManifest, resolveTinyCloudHosts, resourceCapabilitiesToAbilitiesMap, resourceCapabilitiesToSpaceAbilitiesMap, signLocationRecord, submitHostDelegation, validateClientSession, validateLocationRecord, validateLocationRecordPayload, validateManifest, validatePersistedSessionData, verifyDidKeyEd25519Signature, verifyLocationRecord };
4824
+ export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, type AbilitiesMap, type AccountApplication, type AccountDelegation, type AccountDelegationListOptions, type AccountDelegationRevokeOptions, type AccountIndexRebuildResult, type AccountIndexStatus, AccountService, type AccountServiceConfig, type AccountSpace, type AccountStatus, AutoApproveSpaceCreationHandler, type AutoRejectStrategy, type AutoSignStrategy, type Bytes, type CallbackStrategy, type CanonicalAddress, type CanonicalParsedNetworkId, type CapabilityEntry, CapabilityKeyRegistry, type CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, type ClientSession, ClientSessionSchema, CloudLocationResolutionError, type ComposeManifestOptions, type ComposedManifestRequest, type CreateDelegationFunction, type CreateDelegationParams, type CreateDelegationWasmParams, type CreateDelegationWasmResult, DEFAULT_DEFAULTS, DEFAULT_EXPIRY, DEFAULT_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, DEFAULT_SIGNED_READ_URL_EXPIRY_MS, DEFAULT_TINYCLOUD_FALLBACK_HOST, DEFAULT_TINYCLOUD_LOCATION_REGISTRY_URL, type DelegatedResource, type Delegation, type DelegationApiResponse, type DelegationChain, type DelegationChainV2, type DelegationDirection, type DelegationError, type DelegationErrorCode, DelegationErrorCodes, type DelegationFilters, DelegationManager, type DelegationManagerConfig, type DelegationRecord, type Result as DelegationResult, type DidCacheKeyOptions, type DidEqualsOptions, ENCRYPTION_MANIFEST_SPACE, ENCRYPTION_PERMISSION_SERVICE, EXPIRY, type EncodedShareData, type EnsData, EnsDataSchema, type EventEmitterStrategy, type ExpiryTier, type Extension, type GenerateShareParams, type ICapabilityKeyRegistry, type IENSResolver, type INotificationHandler, type ISessionManager, type ISessionStorage, type ISharingService, type ISigner, type ISpace, type ISpaceCreationHandler, type ISpaceScopedDelegations, type ISpaceScopedSharing, type ISpaceService, type IUserAuthorization, type IWasmBindings, IdentityParseError, type IngestOptions, type JWK, type KeyInfo, type KeyProvider, type KeyType, type LocationCandidate, type LocationCandidateInput, type LocationRecord, type LocationRecordPayload, type LocationRecordSigner, LocationRecordValidationError, type LocationResolutionAttempt, type LocationSource, type Manifest, type ManifestDefaults, type ManifestRegistryRecord, type ManifestSecretActions, ManifestValidationError, type NodeInfo, type ParseRecapFromSiwe, type PartialSiweMessage, type PermissionEntry, PermissionNotInManifestError, type PersistedSessionData, type PersistedTinyCloudSession, type PkhDidParts, ProtocolMismatchError, type ReceiveOptions, type ResolveCloudLocationOptions, type ResolveTinyCloudHostsOptions, type ResolvedCapabilities, type ResolvedCloudLocation, type ResolvedDelegate, type ResolvedTinyCloudHosts, type ResourceCapability, SERVICE_LONG_TO_SHORT, SERVICE_SHORT_TO_LONG, type ServerHost, SessionExpiredError, type ShareAccess, type ShareLink, type ShareLinkData, type ShareSchema, SharingService, type SharingServiceConfig, type SignCallback, type SignInOptions, type SignRequest, type SignResponse, type SignStrategy, SilentNotificationHandler, type SiweConfig, SiweConfigSchema, Space, type SpaceAbilitiesMap, type SpaceConfig, type SpaceCreationContext, type SpaceDelegationParams, type SpaceErrorCode, SpaceErrorCodes, type SpaceHostResult, type SpaceInfo, type SpaceOwnership, SpaceService, type SpaceServiceConfig, type StoredDelegationChain, type SubsetCheckResult, TinyCloud, type TinyCloudConfig, type TinyCloudSession, UnsupportedFeatureError, type UserAuthorizationConfig, VAULT_PERMISSION_SERVICE, type ValidationError, VersionCheckError, type WasmRecapEntry, activateSessionWithHost, addressStorageKey, applyPrefix, buildSpaceUri, canonicalLocationPayload, canonicalizeAddress, canonicalizeDid, canonicalizeDidUrl, canonicalizeNetworkId, checkNodeInfo, composeManifestRequest, createCapabilityKeyRegistry, createSharingService, createSpaceService, defaultSignStrategy, defaultSpaceCreationHandler, didCacheKey, didEquals, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, fetchLocationRecord, fetchPeerId, httpUrlToMultiaddr, isCapabilitySubset, isEvmAddress, loadManifest, locationPayloadForRecord, makePkhSpaceId, makePublicSpaceId, manifestAbilitiesUnion, multiaddrToHttpUrl, normalizeDefaults, parseCanonicalNetworkId, parseExpiry, parsePkhDid, parseRecapCapabilities, parseSpaceUri, pkhDid, principalDid, principalDidEquals, resolveCloudLocation, resolveManifest, resolveTinyCloudHosts, resourceCapabilitiesToAbilitiesMap, resourceCapabilitiesToSpaceAbilitiesMap, signLocationRecord, submitHostDelegation, validateClientSession, validateLocationRecord, validateLocationRecordPayload, validateManifest, validatePersistedSessionData, verifyDidKeyEd25519Signature, verifyLocationRecord };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { InvokeFunction, InvokeAnyFunction, ParsedNetworkId, ServiceError, Result as Result$1, ServiceSession, FetchFunction, ServiceConstructor, RetryPolicy, TelemetryConfig, IServiceContext, IService, IKVService, ISQLService, IDuckDbService, IHooksService, IDataVaultService, IEncryptionService } from '@tinycloud/sdk-services';
2
+ import { InvokeFunction, InvokeAnyFunction, ParsedNetworkId, ServiceError, Result as Result$1, ServiceSession, FetchFunction, ServiceConstructor, RetryPolicy, TelemetryConfig, IServiceContext, IService, IKVService, ISQLService, IDuckDbService, IHooksService, IDataVaultService, IEncryptionService, IDatabaseHandle, SqlValue, QueryResponse } from '@tinycloud/sdk-services';
3
3
  export { BatchOptions, BatchResponse, BuildCanonicalDecryptRequestInput, BuildDecryptFactsInput, BuildDecryptInvocationInput, BuiltDecryptInvocation, CanonicalDecryptRequest, CanonicalJson, ColumnInfo, DECRYPT_ACTION, DECRYPT_FACT_TYPE, DECRYPT_RESULT_TYPE, DEFAULT_ENCRYPTION_ALG, DEFAULT_KEY_VERSION, DataVaultConfig, DataVaultService, DatabaseHandle, DecryptCapabilityProof, DecryptEnvelopeOptions, DecryptInvocationFact, DecryptInvocationSigner, DecryptRequestBody, DecryptResponseBody, DecryptTransport, 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, EncryptToNetworkInput, EncryptToNetworkOptions, EncryptToNetworkResult, EncryptionCrypto, EncryptionError, EncryptionErrorInput, EncryptionService, EncryptionServiceConfig, ErrorCode, ErrorCodes, ExecuteOptions, ExecuteResponse, FetchFunction, HookEvent, HookServiceName, HookStreamEvent, HookSubscription, HookWebhookListOptions, HookWebhookRecord, HookWebhookRegistration, HookWebhookScope, HookWebhookUnregisterOptions, HooksService, HooksServiceConfig, IDataVaultService, IDatabaseHandle, IDuckDbDatabaseHandle, IDuckDbService, IEncryptionService, IHooksService, IKVService, IPrefixedKVService, ISQLService, ISecretsService, IService, IServiceContext, InlineEncryptedEnvelope, InvokeAnyEntry, InvokeAnyFunction, InvokeFunction, KVCreateSignedReadUrlOptions, KVDeleteOptions, KVGetOptions, KVHeadOptions, KVListOptions, KVListResponse, KVPutOptions, KVResponse, KVResponseHeaders, KVService, KVServiceConfig, KVSignedReadUrlResponse, NETWORK_NAME_PATTERN, NetworkDescriptor, NetworkIdError, NodeDescriptorFetcher, ParsedNetworkId, PrefixedKVService, QueryOptions, QueryResponse, RandomReceiverKeyInput, ReceiverKeyPair, ReceiverKeySigner, ResolvedSecretPath, Result, RetryPolicy, SECRET_NAME_RE, SQLAction, SQLActionType, SQLService, SQLServiceConfig, SchemaInfo, SecretPayload, SecretScopeOptions, SecretsError, SecretsService, ServiceContext, ServiceContextConfig, ServiceError, ServiceSession, SignedReceiverKeyInput, SqlStatement, SqlValue, SubscribeOptions, TableInfo, TelemetryConfig, TelemetryEventHandler, VaultCrypto, VaultEntry, VaultError, VaultGetOptions, VaultGrantOptions, VaultHeaders, VaultListOptions, VaultPublicSpaceKVActions, VaultPutOptions, VerifyDecryptResponseInput, ViewInfo, WasmVaultFunctions, WellKnownDescriptorFetcher, buildCanonicalDecryptRequest, buildDecryptAttenuation, buildDecryptFacts, buildDecryptInvocation, buildNetworkId, canonicalHashHex, canonicalSignedResponse, canonicalizeEncryptionJson, canonicalizeSecretScope, checkDecryptInvocationInput, createVaultCrypto, decryptEnvelopeWithKey, defaultRetryPolicy, deriveSignedReceiverKey, discoverNetwork, encryptToNetwork, base64Decode as encryptionBase64Decode, base64Encode as encryptionBase64Encode, encryptionError, utf8Decode as encryptionUtf8Decode, utf8Encode as encryptionUtf8Encode, ensureNetworkUsableForDecrypt, err, generateRandomReceiverKey, hexDecode, hexEncode, isNetworkId, networkDiscoveryKey, ok, openWrappedKey, parseNetworkId, resolveSecretListPrefix, resolveSecretPath, serviceError, validateEnvelope, verifyDecryptResponse } from '@tinycloud/sdk-services';
4
4
  export { SiweMessage } from 'siwe';
5
5
 
@@ -3505,63 +3505,6 @@ declare class TinyCloud {
3505
3505
  static readPublicKey<T = unknown>(host: string, address: string, chainId: number, key: string, fetchFn?: FetchFunction): Promise<Result$1<T, ServiceError>>;
3506
3506
  }
3507
3507
 
3508
- /**
3509
- * Shared space utilities for TinyCloud.
3510
- *
3511
- * These functions are platform-agnostic and can be used by both
3512
- * web-sdk and node-sdk for space hosting and session activation.
3513
- */
3514
- /**
3515
- * Result of a space hosting or session activation attempt.
3516
- */
3517
- interface SpaceHostResult {
3518
- /** Whether the operation succeeded (2xx status) */
3519
- success: boolean;
3520
- /** HTTP status code */
3521
- status: number;
3522
- /** Error message if failed */
3523
- error?: string;
3524
- /** Space IDs that were successfully activated */
3525
- activated?: string[];
3526
- /** Space IDs that were skipped (e.g., space doesn't exist yet) */
3527
- skipped?: string[];
3528
- }
3529
- /**
3530
- * Fetch the peer ID from TinyCloud server for space hosting.
3531
- *
3532
- * The peer ID identifies the TinyCloud server instance that will host the space.
3533
- *
3534
- * @param host - TinyCloud server URL (e.g., "https://node.tinycloud.xyz")
3535
- * @param spaceId - The space ID to host
3536
- * @returns The peer ID string
3537
- * @throws Error if the request fails
3538
- */
3539
- declare function fetchPeerId(host: string, spaceId: string): Promise<string>;
3540
- /**
3541
- * Submit a space hosting delegation to TinyCloud server.
3542
- *
3543
- * This registers a new space with the server, allowing the user
3544
- * to store data in it.
3545
- *
3546
- * @param host - TinyCloud server URL
3547
- * @param headers - Delegation headers (from siweToDelegationHeaders)
3548
- * @returns Result indicating success/failure
3549
- */
3550
- declare function submitHostDelegation(host: string, headers: Record<string, string>): Promise<SpaceHostResult>;
3551
- /**
3552
- * Activate a session with TinyCloud server.
3553
- *
3554
- * This submits the session delegation to the server, enabling the session
3555
- * key to perform operations on behalf of the user.
3556
- *
3557
- * @param host - TinyCloud server URL
3558
- * @param delegationHeader - Session delegation header (from session.delegationHeader)
3559
- * @returns Result indicating success/failure (404 means space doesn't exist)
3560
- */
3561
- declare function activateSessionWithHost(host: string, delegationHeader: {
3562
- Authorization: string;
3563
- }): Promise<SpaceHostResult>;
3564
-
3565
3508
  /**
3566
3509
  * DelegationManager - Handles delegation CRUD operations.
3567
3510
  *
@@ -4312,6 +4255,8 @@ interface SpaceServiceConfig {
4312
4255
  * Required for space.delegations.create() to work.
4313
4256
  */
4314
4257
  createDelegation?: CreateDelegationFunction;
4258
+ /** Optional best-effort hook after the SDK discovers or creates a space. */
4259
+ onSpaceRegistered?: (space: SpaceInfo) => void | Promise<void>;
4315
4260
  }
4316
4261
  /**
4317
4262
  * Interface for SpaceService.
@@ -4432,6 +4377,7 @@ declare class SpaceService implements ISpaceService {
4432
4377
  private _userDid?;
4433
4378
  private sharingService?;
4434
4379
  private createDelegationFn?;
4380
+ private onSpaceRegisteredFn?;
4435
4381
  /** Cache of created Space objects */
4436
4382
  private spaceCache;
4437
4383
  /** Cache of space info */
@@ -4489,6 +4435,7 @@ declare class SpaceService implements ISpaceService {
4489
4435
  * @param name - The name for the new space
4490
4436
  */
4491
4437
  create(name: string): Promise<Result$1<SpaceInfo, ServiceError>>;
4438
+ private notifySpaceRegistered;
4492
4439
  /**
4493
4440
  * Get a Space object by name or full URI.
4494
4441
  *
@@ -4535,6 +4482,183 @@ declare class SpaceService implements ISpaceService {
4535
4482
  */
4536
4483
  declare function createSpaceService(config: SpaceServiceConfig): ISpaceService;
4537
4484
 
4485
+ interface AccountApplication {
4486
+ appId: string;
4487
+ manifests: Manifest[];
4488
+ updatedAt?: string;
4489
+ name?: string;
4490
+ description?: string;
4491
+ manifestHash?: string;
4492
+ }
4493
+ interface AccountSpace {
4494
+ spaceId: string;
4495
+ name: string;
4496
+ ownerDid: string;
4497
+ type: "owned" | "delegated" | "discovered";
4498
+ permissions: string[];
4499
+ status: "active" | "archived";
4500
+ registeredAt?: string;
4501
+ updatedAt?: string;
4502
+ expiresAt?: Date;
4503
+ }
4504
+ interface AccountDelegation {
4505
+ cid: string;
4506
+ direction: "granted" | "received";
4507
+ spaceId: string;
4508
+ spaceName?: string;
4509
+ counterpartyDid: string;
4510
+ delegateDid: string;
4511
+ delegatorDid?: string;
4512
+ path: string;
4513
+ actions: string[];
4514
+ expiry: Date;
4515
+ status: "active" | "expired" | "revoked";
4516
+ createdAt?: Date;
4517
+ }
4518
+ interface AccountStatus {
4519
+ did: string;
4520
+ host: string;
4521
+ primarySpaceId?: string;
4522
+ accountSpaceId?: string;
4523
+ applications: number;
4524
+ spaces: number;
4525
+ grantedDelegations: number;
4526
+ receivedDelegations: number;
4527
+ }
4528
+ interface AccountIndexRebuildResult {
4529
+ database: string;
4530
+ applications: number;
4531
+ spaces: number;
4532
+ delegations: number;
4533
+ syncedAt: string;
4534
+ }
4535
+ interface AccountDelegationListOptions {
4536
+ direction?: "granted" | "received" | "all";
4537
+ space?: string;
4538
+ }
4539
+ interface AccountDelegationRevokeOptions {
4540
+ cid: string;
4541
+ space: string;
4542
+ }
4543
+ interface AccountServiceConfig {
4544
+ getDid: () => string;
4545
+ getHost: () => string;
4546
+ getPrimarySpaceId: () => string | undefined;
4547
+ getAccountSpaceId: () => string | undefined;
4548
+ getSpaces: () => ISpaceService;
4549
+ getAccountDb?: () => IDatabaseHandle | undefined;
4550
+ ensureAccountSpaceHosted?: () => Promise<void>;
4551
+ }
4552
+ declare class AccountService {
4553
+ private readonly config;
4554
+ constructor(config: AccountServiceConfig);
4555
+ status(): Promise<Result$1<AccountStatus>>;
4556
+ readonly applications: {
4557
+ list: () => Promise<Result$1<AccountApplication[]>>;
4558
+ get: (appId: string) => Promise<Result$1<AccountApplication>>;
4559
+ register: (manifest: Manifest | Manifest[]) => Promise<Result$1<AccountApplication>>;
4560
+ remove: (appId: string) => Promise<Result$1<void>>;
4561
+ };
4562
+ readonly spaces: {
4563
+ list: () => Promise<Result$1<AccountSpace[]>>;
4564
+ get: (spaceId: string) => Promise<Result$1<AccountSpace>>;
4565
+ register: (space: SpaceInfo | AccountSpace) => Promise<Result$1<AccountSpace>>;
4566
+ syncAccessible: () => Promise<Result$1<AccountSpace[]>>;
4567
+ remove: (spaceId: string) => Promise<Result$1<void>>;
4568
+ };
4569
+ readonly delegations: {
4570
+ list: (options?: AccountDelegationListOptions) => Promise<Result$1<AccountDelegation[]>>;
4571
+ revoke: (options: AccountDelegationRevokeOptions) => Promise<Result$1<void>>;
4572
+ };
4573
+ readonly index: {
4574
+ rebuild: () => Promise<Result$1<AccountIndexRebuildResult>>;
4575
+ applications: {
4576
+ list: () => Promise<Result$1<AccountApplication[]>>;
4577
+ };
4578
+ spaces: {
4579
+ list: () => Promise<Result$1<AccountSpace[]>>;
4580
+ };
4581
+ delegations: {
4582
+ list: (options?: AccountDelegationListOptions) => Promise<Result$1<AccountDelegation[]>>;
4583
+ };
4584
+ query: <T = Record<string, unknown>>(sql: string, params?: SqlValue[]) => Promise<Result$1<QueryResponse<T>>>;
4585
+ status: () => Promise<Result$1<AccountIndexStatus>>;
4586
+ };
4587
+ private accountKV;
4588
+ private accountDb;
4589
+ private indexHasApplicationHash;
4590
+ private upsertApplicationIndex;
4591
+ private deleteApplicationIndex;
4592
+ private upsertSpaceIndex;
4593
+ private deleteSpaceIndex;
4594
+ private resolveSpace;
4595
+ }
4596
+ interface AccountIndexStatus {
4597
+ database: string;
4598
+ sources: Array<{
4599
+ source: string;
4600
+ syncedAt: string;
4601
+ count: number;
4602
+ }>;
4603
+ }
4604
+
4605
+ /**
4606
+ * Shared space utilities for TinyCloud.
4607
+ *
4608
+ * These functions are platform-agnostic and can be used by both
4609
+ * web-sdk and node-sdk for space hosting and session activation.
4610
+ */
4611
+ /**
4612
+ * Result of a space hosting or session activation attempt.
4613
+ */
4614
+ interface SpaceHostResult {
4615
+ /** Whether the operation succeeded (2xx status) */
4616
+ success: boolean;
4617
+ /** HTTP status code */
4618
+ status: number;
4619
+ /** Error message if failed */
4620
+ error?: string;
4621
+ /** Space IDs that were successfully activated */
4622
+ activated?: string[];
4623
+ /** Space IDs that were skipped (e.g., space doesn't exist yet) */
4624
+ skipped?: string[];
4625
+ }
4626
+ /**
4627
+ * Fetch the peer ID from TinyCloud server for space hosting.
4628
+ *
4629
+ * The peer ID identifies the TinyCloud server instance that will host the space.
4630
+ *
4631
+ * @param host - TinyCloud server URL (e.g., "https://node.tinycloud.xyz")
4632
+ * @param spaceId - The space ID to host
4633
+ * @returns The peer ID string
4634
+ * @throws Error if the request fails
4635
+ */
4636
+ declare function fetchPeerId(host: string, spaceId: string): Promise<string>;
4637
+ /**
4638
+ * Submit a space hosting delegation to TinyCloud server.
4639
+ *
4640
+ * This registers a new space with the server, allowing the user
4641
+ * to store data in it.
4642
+ *
4643
+ * @param host - TinyCloud server URL
4644
+ * @param headers - Delegation headers (from siweToDelegationHeaders)
4645
+ * @returns Result indicating success/failure
4646
+ */
4647
+ declare function submitHostDelegation(host: string, headers: Record<string, string>): Promise<SpaceHostResult>;
4648
+ /**
4649
+ * Activate a session with TinyCloud server.
4650
+ *
4651
+ * This submits the session delegation to the server, enabling the session
4652
+ * key to perform operations on behalf of the user.
4653
+ *
4654
+ * @param host - TinyCloud server URL
4655
+ * @param delegationHeader - Session delegation header (from session.delegationHeader)
4656
+ * @returns Result indicating success/failure (404 means space doesn't exist)
4657
+ */
4658
+ declare function activateSessionWithHost(host: string, delegationHeader: {
4659
+ Authorization: string;
4660
+ }): Promise<SpaceHostResult>;
4661
+
4538
4662
  /**
4539
4663
  * Protocol version checking for SDK-to-node compatibility.
4540
4664
  *
@@ -4697,4 +4821,4 @@ declare const EXPIRY: {
4697
4821
  declare const DEFAULT_SIGNED_READ_URL_EXPIRY_MS: number;
4698
4822
  type ExpiryTier = keyof typeof EXPIRY;
4699
4823
 
4700
- export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, type AbilitiesMap, AutoApproveSpaceCreationHandler, type AutoRejectStrategy, type AutoSignStrategy, type Bytes, type CallbackStrategy, type CanonicalAddress, type CanonicalParsedNetworkId, type CapabilityEntry, CapabilityKeyRegistry, type CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, type ClientSession, ClientSessionSchema, CloudLocationResolutionError, type ComposeManifestOptions, type ComposedManifestRequest, type CreateDelegationFunction, type CreateDelegationParams, type CreateDelegationWasmParams, type CreateDelegationWasmResult, DEFAULT_DEFAULTS, DEFAULT_EXPIRY, DEFAULT_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, DEFAULT_SIGNED_READ_URL_EXPIRY_MS, DEFAULT_TINYCLOUD_FALLBACK_HOST, DEFAULT_TINYCLOUD_LOCATION_REGISTRY_URL, type DelegatedResource, type Delegation, type DelegationApiResponse, type DelegationChain, type DelegationChainV2, type DelegationDirection, type DelegationError, type DelegationErrorCode, DelegationErrorCodes, type DelegationFilters, DelegationManager, type DelegationManagerConfig, type DelegationRecord, type Result as DelegationResult, type DidCacheKeyOptions, type DidEqualsOptions, ENCRYPTION_MANIFEST_SPACE, ENCRYPTION_PERMISSION_SERVICE, EXPIRY, type EncodedShareData, type EnsData, EnsDataSchema, type EventEmitterStrategy, type ExpiryTier, type Extension, type GenerateShareParams, type ICapabilityKeyRegistry, type IENSResolver, type INotificationHandler, type ISessionManager, type ISessionStorage, type ISharingService, type ISigner, type ISpace, type ISpaceCreationHandler, type ISpaceScopedDelegations, type ISpaceScopedSharing, type ISpaceService, type IUserAuthorization, type IWasmBindings, IdentityParseError, type IngestOptions, type JWK, type KeyInfo, type KeyProvider, type KeyType, type LocationCandidate, type LocationCandidateInput, type LocationRecord, type LocationRecordPayload, type LocationRecordSigner, LocationRecordValidationError, type LocationResolutionAttempt, type LocationSource, type Manifest, type ManifestDefaults, type ManifestRegistryRecord, type ManifestSecretActions, ManifestValidationError, type NodeInfo, type ParseRecapFromSiwe, type PartialSiweMessage, type PermissionEntry, PermissionNotInManifestError, type PersistedSessionData, type PersistedTinyCloudSession, type PkhDidParts, ProtocolMismatchError, type ReceiveOptions, type ResolveCloudLocationOptions, type ResolveTinyCloudHostsOptions, type ResolvedCapabilities, type ResolvedCloudLocation, type ResolvedDelegate, type ResolvedTinyCloudHosts, type ResourceCapability, SERVICE_LONG_TO_SHORT, SERVICE_SHORT_TO_LONG, type ServerHost, SessionExpiredError, type ShareAccess, type ShareLink, type ShareLinkData, type ShareSchema, SharingService, type SharingServiceConfig, type SignCallback, type SignInOptions, type SignRequest, type SignResponse, type SignStrategy, SilentNotificationHandler, type SiweConfig, SiweConfigSchema, Space, type SpaceAbilitiesMap, type SpaceConfig, type SpaceCreationContext, type SpaceDelegationParams, type SpaceErrorCode, SpaceErrorCodes, type SpaceHostResult, type SpaceInfo, type SpaceOwnership, SpaceService, type SpaceServiceConfig, type StoredDelegationChain, type SubsetCheckResult, TinyCloud, type TinyCloudConfig, type TinyCloudSession, UnsupportedFeatureError, type UserAuthorizationConfig, VAULT_PERMISSION_SERVICE, type ValidationError, VersionCheckError, type WasmRecapEntry, activateSessionWithHost, addressStorageKey, applyPrefix, buildSpaceUri, canonicalLocationPayload, canonicalizeAddress, canonicalizeDid, canonicalizeDidUrl, canonicalizeNetworkId, checkNodeInfo, composeManifestRequest, createCapabilityKeyRegistry, createSharingService, createSpaceService, defaultSignStrategy, defaultSpaceCreationHandler, didCacheKey, didEquals, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, fetchLocationRecord, fetchPeerId, httpUrlToMultiaddr, isCapabilitySubset, isEvmAddress, loadManifest, locationPayloadForRecord, makePkhSpaceId, makePublicSpaceId, manifestAbilitiesUnion, multiaddrToHttpUrl, normalizeDefaults, parseCanonicalNetworkId, parseExpiry, parsePkhDid, parseRecapCapabilities, parseSpaceUri, pkhDid, principalDid, principalDidEquals, resolveCloudLocation, resolveManifest, resolveTinyCloudHosts, resourceCapabilitiesToAbilitiesMap, resourceCapabilitiesToSpaceAbilitiesMap, signLocationRecord, submitHostDelegation, validateClientSession, validateLocationRecord, validateLocationRecordPayload, validateManifest, validatePersistedSessionData, verifyDidKeyEd25519Signature, verifyLocationRecord };
4824
+ export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, type AbilitiesMap, type AccountApplication, type AccountDelegation, type AccountDelegationListOptions, type AccountDelegationRevokeOptions, type AccountIndexRebuildResult, type AccountIndexStatus, AccountService, type AccountServiceConfig, type AccountSpace, type AccountStatus, AutoApproveSpaceCreationHandler, type AutoRejectStrategy, type AutoSignStrategy, type Bytes, type CallbackStrategy, type CanonicalAddress, type CanonicalParsedNetworkId, type CapabilityEntry, CapabilityKeyRegistry, type CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, type ClientSession, ClientSessionSchema, CloudLocationResolutionError, type ComposeManifestOptions, type ComposedManifestRequest, type CreateDelegationFunction, type CreateDelegationParams, type CreateDelegationWasmParams, type CreateDelegationWasmResult, DEFAULT_DEFAULTS, DEFAULT_EXPIRY, DEFAULT_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, DEFAULT_SIGNED_READ_URL_EXPIRY_MS, DEFAULT_TINYCLOUD_FALLBACK_HOST, DEFAULT_TINYCLOUD_LOCATION_REGISTRY_URL, type DelegatedResource, type Delegation, type DelegationApiResponse, type DelegationChain, type DelegationChainV2, type DelegationDirection, type DelegationError, type DelegationErrorCode, DelegationErrorCodes, type DelegationFilters, DelegationManager, type DelegationManagerConfig, type DelegationRecord, type Result as DelegationResult, type DidCacheKeyOptions, type DidEqualsOptions, ENCRYPTION_MANIFEST_SPACE, ENCRYPTION_PERMISSION_SERVICE, EXPIRY, type EncodedShareData, type EnsData, EnsDataSchema, type EventEmitterStrategy, type ExpiryTier, type Extension, type GenerateShareParams, type ICapabilityKeyRegistry, type IENSResolver, type INotificationHandler, type ISessionManager, type ISessionStorage, type ISharingService, type ISigner, type ISpace, type ISpaceCreationHandler, type ISpaceScopedDelegations, type ISpaceScopedSharing, type ISpaceService, type IUserAuthorization, type IWasmBindings, IdentityParseError, type IngestOptions, type JWK, type KeyInfo, type KeyProvider, type KeyType, type LocationCandidate, type LocationCandidateInput, type LocationRecord, type LocationRecordPayload, type LocationRecordSigner, LocationRecordValidationError, type LocationResolutionAttempt, type LocationSource, type Manifest, type ManifestDefaults, type ManifestRegistryRecord, type ManifestSecretActions, ManifestValidationError, type NodeInfo, type ParseRecapFromSiwe, type PartialSiweMessage, type PermissionEntry, PermissionNotInManifestError, type PersistedSessionData, type PersistedTinyCloudSession, type PkhDidParts, ProtocolMismatchError, type ReceiveOptions, type ResolveCloudLocationOptions, type ResolveTinyCloudHostsOptions, type ResolvedCapabilities, type ResolvedCloudLocation, type ResolvedDelegate, type ResolvedTinyCloudHosts, type ResourceCapability, SERVICE_LONG_TO_SHORT, SERVICE_SHORT_TO_LONG, type ServerHost, SessionExpiredError, type ShareAccess, type ShareLink, type ShareLinkData, type ShareSchema, SharingService, type SharingServiceConfig, type SignCallback, type SignInOptions, type SignRequest, type SignResponse, type SignStrategy, SilentNotificationHandler, type SiweConfig, SiweConfigSchema, Space, type SpaceAbilitiesMap, type SpaceConfig, type SpaceCreationContext, type SpaceDelegationParams, type SpaceErrorCode, SpaceErrorCodes, type SpaceHostResult, type SpaceInfo, type SpaceOwnership, SpaceService, type SpaceServiceConfig, type StoredDelegationChain, type SubsetCheckResult, TinyCloud, type TinyCloudConfig, type TinyCloudSession, UnsupportedFeatureError, type UserAuthorizationConfig, VAULT_PERMISSION_SERVICE, type ValidationError, VersionCheckError, type WasmRecapEntry, activateSessionWithHost, addressStorageKey, applyPrefix, buildSpaceUri, canonicalLocationPayload, canonicalizeAddress, canonicalizeDid, canonicalizeDidUrl, canonicalizeNetworkId, checkNodeInfo, composeManifestRequest, createCapabilityKeyRegistry, createSharingService, createSpaceService, defaultSignStrategy, defaultSpaceCreationHandler, didCacheKey, didEquals, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, fetchLocationRecord, fetchPeerId, httpUrlToMultiaddr, isCapabilitySubset, isEvmAddress, loadManifest, locationPayloadForRecord, makePkhSpaceId, makePublicSpaceId, manifestAbilitiesUnion, multiaddrToHttpUrl, normalizeDefaults, parseCanonicalNetworkId, parseExpiry, parsePkhDid, parseRecapCapabilities, parseSpaceUri, pkhDid, principalDid, principalDidEquals, resolveCloudLocation, resolveManifest, resolveTinyCloudHosts, resourceCapabilitiesToAbilitiesMap, resourceCapabilitiesToSpaceAbilitiesMap, signLocationRecord, submitHostDelegation, validateClientSession, validateLocationRecord, validateLocationRecordPayload, validateManifest, validatePersistedSessionData, verifyDidKeyEd25519Signature, verifyLocationRecord };