@tinycloud/node-sdk 2.1.0 → 2.2.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/core.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { ISessionStorage, PersistedSessionData, AutoSignStrategy, AutoRejectStrategy, CallbackStrategy, IUserAuthorization, ISigner, ISpaceCreationHandler, IWasmBindings, SiweConfig, Manifest, ClientSession, TinyCloudSession, Extension, SignInOptions, Delegation, DelegatedResource, IKVService, ISQLService, IDuckDbService, IHooksService, INotificationHandler, IENSResolver, IDataVaultService, ICapabilityKeyRegistry, DelegationManager, ISpaceService, ISharingService, CreateDelegationParams, DelegationResult, PermissionEntry, KeyProvider, ISessionManager, JWK } from '@tinycloud/sdk-core';
2
- export { AutoApproveSpaceCreationHandler, AutoRejectStrategy, AutoSignStrategy, BatchOptions, BatchResponse, CallbackStrategy, CapabilityEntry, CapabilityKeyRegistry, CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, ClientSession, ColumnInfo, CreateDelegationParams, DataVaultConfig, DataVaultService, DatabaseHandle, Delegation, DelegationChain, DelegationChainV2, DelegationDirection, DelegationError, DelegationErrorCode, DelegationErrorCodes, DelegationFilters, DelegationManager, DelegationManagerConfig, DelegationRecord, DelegationResult, DuckDbAction, DuckDbActionType, DuckDbBatchOptions, DuckDbBatchResponse, DuckDbDatabaseHandle, DuckDbExecuteOptions, DuckDbExecuteResponse, DuckDbOptions, DuckDbQueryOptions, DuckDbQueryResponse, DuckDbService, DuckDbServiceConfig, DuckDbStatement, DuckDbValue, EncodedShareData, ExecuteOptions, ExecuteResponse, Extension, FetchFunction, GenerateShareParams, ICapabilityKeyRegistry, IDataVaultService, IDatabaseHandle, IDuckDbDatabaseHandle, IDuckDbService, IENSResolver, IKVService, INotificationHandler, IPrefixedKVService, ISQLService, ISessionManager, ISessionStorage, ISharingService, ISigner, ISpace, ISpaceCreationHandler, ISpaceScopedDelegations, ISpaceScopedSharing, ISpaceService, IUserAuthorization, IWasmBindings, IngestOptions, InvokeFunction, JWK, KVResponse, KVService, KVServiceConfig, KeyInfo, KeyProvider, KeyType, Manifest, ManifestDefaults, ManifestDelegation, ManifestValidationError, PermissionEntry, PermissionNotInManifestError, PersistedSessionData, PrefixedKVService, ProtocolMismatchError, QueryOptions, QueryResponse, ReceiveOptions, ResolvedCapabilities, ResolvedDelegate, ResourceCapability, SQLAction, SQLActionType, SQLService, SQLServiceConfig, SchemaInfo, ServiceContext, ServiceContextConfig, ServiceSession, SessionExpiredError, ShareAccess, ShareLink, ShareLinkData, ShareSchema, SharingService, SharingServiceConfig, SignCallback, SignInOptions, SignRequest, SignResponse, SilentNotificationHandler, Space, SpaceConfig, SpaceCreationContext, SpaceErrorCode, SpaceErrorCodes, SpaceInfo, SpaceOwnership, SpaceService, SpaceServiceConfig, SqlStatement, SqlValue, StoredDelegationChain, TableInfo, TinyCloud, TinyCloudConfig, TinyCloudSession, UnsupportedFeatureError, VaultCrypto, VaultEntry, VaultError, VaultGetOptions, VaultGrantOptions, VaultHeaders, VaultListOptions, VaultPublicSpaceKVActions, VaultPutOptions, VersionCheckError, ViewInfo, WasmVaultFunctions, buildSpaceUri, checkNodeInfo, createCapabilityKeyRegistry, createSharingService, createSpaceService, createVaultCrypto, defaultSpaceCreationHandler, expandActionShortNames, isCapabilitySubset, loadManifest, makePublicSpaceId, parseExpiry, parseSpaceUri, resolveManifest, validateManifest } from '@tinycloud/sdk-core';
1
+ import { ISessionStorage, PersistedSessionData, AutoSignStrategy, AutoRejectStrategy, CallbackStrategy, IUserAuthorization, ISigner, ISpaceCreationHandler, IWasmBindings, SiweConfig, Manifest, ComposedManifestRequest, ClientSession, TinyCloudSession, Extension, SignInOptions, Delegation, DelegatedResource, IKVService, ISQLService, IDuckDbService, IHooksService, INotificationHandler, IENSResolver, IDataVaultService, ICapabilityKeyRegistry, DelegationManager, ISpaceService, ISharingService, CreateDelegationParams, DelegationResult, PermissionEntry, ResolvedDelegate, KeyProvider, ISessionManager, JWK } from '@tinycloud/sdk-core';
2
+ export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, AutoApproveSpaceCreationHandler, AutoRejectStrategy, AutoSignStrategy, BatchOptions, BatchResponse, CallbackStrategy, CapabilityEntry, CapabilityKeyRegistry, CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, ClientSession, ColumnInfo, ComposeManifestOptions, ComposedManifestRequest, CreateDelegationParams, DEFAULT_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, DataVaultConfig, DataVaultService, DatabaseHandle, Delegation, DelegationChain, DelegationChainV2, DelegationDirection, DelegationError, DelegationErrorCode, DelegationErrorCodes, DelegationFilters, DelegationManager, DelegationManagerConfig, DelegationRecord, DelegationResult, DuckDbAction, DuckDbActionType, DuckDbBatchOptions, DuckDbBatchResponse, DuckDbDatabaseHandle, DuckDbExecuteOptions, DuckDbExecuteResponse, DuckDbOptions, DuckDbQueryOptions, DuckDbQueryResponse, DuckDbService, DuckDbServiceConfig, DuckDbStatement, DuckDbValue, EncodedShareData, ExecuteOptions, ExecuteResponse, Extension, FetchFunction, GenerateShareParams, ICapabilityKeyRegistry, IDataVaultService, IDatabaseHandle, IDuckDbDatabaseHandle, IDuckDbService, IENSResolver, IKVService, INotificationHandler, IPrefixedKVService, ISQLService, ISessionManager, ISessionStorage, ISharingService, ISigner, ISpace, ISpaceCreationHandler, ISpaceScopedDelegations, ISpaceScopedSharing, ISpaceService, IUserAuthorization, IWasmBindings, IngestOptions, InvokeFunction, JWK, KVResponse, KVService, KVServiceConfig, KeyInfo, KeyProvider, KeyType, Manifest, ManifestDefaults, ManifestRegistryRecord, ManifestValidationError, PermissionEntry, PermissionNotInManifestError, PersistedSessionData, PrefixedKVService, ProtocolMismatchError, QueryOptions, QueryResponse, ReceiveOptions, ResolvedCapabilities, ResolvedDelegate, ResourceCapability, SQLAction, SQLActionType, SQLService, SQLServiceConfig, SchemaInfo, ServiceContext, ServiceContextConfig, ServiceSession, SessionExpiredError, ShareAccess, ShareLink, ShareLinkData, ShareSchema, SharingService, SharingServiceConfig, SignCallback, SignInOptions, SignRequest, SignResponse, SilentNotificationHandler, Space, SpaceAbilitiesMap, SpaceConfig, SpaceCreationContext, SpaceErrorCode, SpaceErrorCodes, SpaceInfo, SpaceOwnership, SpaceService, SpaceServiceConfig, SqlStatement, SqlValue, StoredDelegationChain, TableInfo, TinyCloud, TinyCloudConfig, TinyCloudSession, UnsupportedFeatureError, VaultCrypto, VaultEntry, VaultError, VaultGetOptions, VaultGrantOptions, VaultHeaders, VaultListOptions, VaultPublicSpaceKVActions, VaultPutOptions, VersionCheckError, ViewInfo, WasmVaultFunctions, buildSpaceUri, checkNodeInfo, composeManifestRequest, createCapabilityKeyRegistry, createSharingService, createSpaceService, createVaultCrypto, defaultSpaceCreationHandler, expandActionShortNames, isCapabilitySubset, loadManifest, makePublicSpaceId, parseExpiry, parseSpaceUri, resolveManifest, resourceCapabilitiesToSpaceAbilitiesMap, validateManifest } from '@tinycloud/sdk-core';
3
3
  import { EventEmitter } from 'events';
4
4
  import { InvokeFunction } from '@tinycloud/sdk-services';
5
5
 
@@ -221,7 +221,11 @@ interface NodeUserAuthorizationConfig {
221
221
  * When omitted, `signIn` falls back to `defaultActions` for
222
222
  * backwards compatibility.
223
223
  */
224
- manifest?: Manifest;
224
+ manifest?: Manifest | Manifest[];
225
+ /** Pre-composed manifest request. Takes precedence over `manifest`. */
226
+ capabilityRequest?: ComposedManifestRequest;
227
+ /** Include implicit account registry permissions when composing `manifest`. Default true. */
228
+ includeAccountRegistryPermissions?: boolean;
225
229
  }
226
230
  /**
227
231
  * Node.js implementation of IUserAuthorization.
@@ -278,6 +282,8 @@ declare class NodeUserAuthorization implements IUserAuthorization {
278
282
  * of falling back to {@link defaultActions}.
279
283
  */
280
284
  private _manifest?;
285
+ private _capabilityRequest?;
286
+ private readonly includeAccountRegistryPermissions;
281
287
  private sessionManager;
282
288
  private extensions;
283
289
  private _session?;
@@ -292,12 +298,14 @@ declare class NodeUserAuthorization implements IUserAuthorization {
292
298
  * internals to surface the manifest for requestPermissions flows
293
299
  * without forcing the caller to track it separately.
294
300
  */
295
- get manifest(): Manifest | undefined;
301
+ get manifest(): Manifest | Manifest[] | undefined;
302
+ get capabilityRequest(): ComposedManifestRequest | undefined;
296
303
  /**
297
304
  * Install or replace the stored manifest. Takes effect on the next
298
305
  * `signIn()` call — the current session (if any) is not touched.
299
306
  */
300
- setManifest(manifest: Manifest | undefined): void;
307
+ setManifest(manifest: Manifest | Manifest[] | undefined): void;
308
+ setCapabilityRequest(request: ComposedManifestRequest | undefined): void;
301
309
  /**
302
310
  * The current active session (web-core compatible).
303
311
  */
@@ -334,7 +342,9 @@ declare class NodeUserAuthorization implements IUserAuthorization {
334
342
  *
335
343
  * @internal
336
344
  */
337
- private resolveSignInAbilities;
345
+ private getCapabilityRequest;
346
+ private resolveSpaceName;
347
+ private resolveSignInCapabilities;
338
348
  /**
339
349
  * Build SIWE overrides from the top-level nonce and siweConfig.
340
350
  * - Top-level `nonce` is seeded first so `siweConfig.nonce` wins if both are set.
@@ -363,6 +373,11 @@ declare class NodeUserAuthorization implements IUserAuthorization {
363
373
  * Used for lazy creation of additional spaces (e.g., public).
364
374
  */
365
375
  hostPublicSpace(spaceId: string): Promise<boolean>;
376
+ /**
377
+ * Create a specific owned space on the server via host delegation.
378
+ * Used by manifest registry setup for the account space.
379
+ */
380
+ hostOwnedSpace(spaceId: string): Promise<boolean>;
366
381
  /**
367
382
  * Ensure the user's space exists on the TinyCloud server.
368
383
  * Creates the space if it doesn't exist and autoCreateSpace is enabled.
@@ -645,7 +660,11 @@ interface TinyCloudNodeConfig {
645
660
  * backwards compatibility with callers that pre-date the manifest
646
661
  * flow.
647
662
  */
648
- manifest?: Manifest;
663
+ manifest?: Manifest | Manifest[];
664
+ /** Pre-composed manifest request. Takes precedence over `manifest`. */
665
+ capabilityRequest?: ComposedManifestRequest;
666
+ /** Include implicit account registry permissions when composing `manifest`. Default true. */
667
+ includeAccountRegistryPermissions?: boolean;
649
668
  }
650
669
  /**
651
670
  * Options for {@link TinyCloudNode.delegateTo}.
@@ -758,12 +777,14 @@ declare class TinyCloudNode {
758
777
  * layer (e.g. TinyCloudWeb.setManifest) so the manifest is kept
759
778
  * in sync across the stack.
760
779
  */
761
- setManifest(manifest: Manifest | undefined): void;
780
+ setManifest(manifest: Manifest | Manifest[] | undefined): void;
781
+ setCapabilityRequest(request: ComposedManifestRequest | undefined): void;
762
782
  /**
763
783
  * Return the manifest currently installed on the auth handler,
764
784
  * or `undefined` if none is set.
765
785
  */
766
- get manifest(): Manifest | undefined;
786
+ get manifest(): Manifest | Manifest[] | undefined;
787
+ get capabilityRequest(): ComposedManifestRequest | undefined;
767
788
  /**
768
789
  * Get the primary identity DID for this user.
769
790
  * - If wallet connected and signed in: returns PKH DID (did:pkh:eip155:{chainId}:{address})
@@ -807,6 +828,8 @@ declare class TinyCloudNode {
807
828
  * @param options - Optional per-call SIWE overrides for this sign-in only
808
829
  */
809
830
  signIn(options?: SignInOptions): Promise<void>;
831
+ private ownedSpaceId;
832
+ private writeManifestRegistryRecords;
810
833
  /**
811
834
  * Restore a previously established session from stored delegation data.
812
835
  *
@@ -1176,6 +1199,21 @@ declare class TinyCloudNode {
1176
1199
  * `forceWalletSign` is not set.
1177
1200
  */
1178
1201
  delegateTo(did: string, permissions: PermissionEntry[], options?: DelegateToOptions): Promise<DelegateToResult>;
1202
+ /**
1203
+ * Materialize one manifest-declared delegation using the current session key.
1204
+ * Delivery is intentionally out of band; callers decide how to transmit the
1205
+ * returned UCAN to the delegate.
1206
+ */
1207
+ materializeDelegation(did: string, request?: ComposedManifestRequest | undefined): Promise<DelegateToResult & {
1208
+ target: ResolvedDelegate;
1209
+ }>;
1210
+ /**
1211
+ * Materialize every delegation target declared by the composed manifest
1212
+ * request. This does not deliver the delegations anywhere.
1213
+ */
1214
+ materializeDelegations(request?: ComposedManifestRequest | undefined): Promise<Array<DelegateToResult & {
1215
+ target: ResolvedDelegate;
1216
+ }>>;
1179
1217
  /**
1180
1218
  * Issue a delegation via the session-key UCAN WASM path.
1181
1219
  *
@@ -1192,6 +1230,7 @@ declare class TinyCloudNode {
1192
1230
  * @internal
1193
1231
  */
1194
1232
  private createDelegationViaWasmPath;
1233
+ private resolvePermissionSpace;
1195
1234
  /**
1196
1235
  * Issue a delegation via the legacy wallet-signed SIWE path for a single
1197
1236
  * {@link PermissionEntry}. Shares the implementation with the public
package/dist/core.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { ISessionStorage, PersistedSessionData, AutoSignStrategy, AutoRejectStrategy, CallbackStrategy, IUserAuthorization, ISigner, ISpaceCreationHandler, IWasmBindings, SiweConfig, Manifest, ClientSession, TinyCloudSession, Extension, SignInOptions, Delegation, DelegatedResource, IKVService, ISQLService, IDuckDbService, IHooksService, INotificationHandler, IENSResolver, IDataVaultService, ICapabilityKeyRegistry, DelegationManager, ISpaceService, ISharingService, CreateDelegationParams, DelegationResult, PermissionEntry, KeyProvider, ISessionManager, JWK } from '@tinycloud/sdk-core';
2
- export { AutoApproveSpaceCreationHandler, AutoRejectStrategy, AutoSignStrategy, BatchOptions, BatchResponse, CallbackStrategy, CapabilityEntry, CapabilityKeyRegistry, CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, ClientSession, ColumnInfo, CreateDelegationParams, DataVaultConfig, DataVaultService, DatabaseHandle, Delegation, DelegationChain, DelegationChainV2, DelegationDirection, DelegationError, DelegationErrorCode, DelegationErrorCodes, DelegationFilters, DelegationManager, DelegationManagerConfig, DelegationRecord, DelegationResult, DuckDbAction, DuckDbActionType, DuckDbBatchOptions, DuckDbBatchResponse, DuckDbDatabaseHandle, DuckDbExecuteOptions, DuckDbExecuteResponse, DuckDbOptions, DuckDbQueryOptions, DuckDbQueryResponse, DuckDbService, DuckDbServiceConfig, DuckDbStatement, DuckDbValue, EncodedShareData, ExecuteOptions, ExecuteResponse, Extension, FetchFunction, GenerateShareParams, ICapabilityKeyRegistry, IDataVaultService, IDatabaseHandle, IDuckDbDatabaseHandle, IDuckDbService, IENSResolver, IKVService, INotificationHandler, IPrefixedKVService, ISQLService, ISessionManager, ISessionStorage, ISharingService, ISigner, ISpace, ISpaceCreationHandler, ISpaceScopedDelegations, ISpaceScopedSharing, ISpaceService, IUserAuthorization, IWasmBindings, IngestOptions, InvokeFunction, JWK, KVResponse, KVService, KVServiceConfig, KeyInfo, KeyProvider, KeyType, Manifest, ManifestDefaults, ManifestDelegation, ManifestValidationError, PermissionEntry, PermissionNotInManifestError, PersistedSessionData, PrefixedKVService, ProtocolMismatchError, QueryOptions, QueryResponse, ReceiveOptions, ResolvedCapabilities, ResolvedDelegate, ResourceCapability, SQLAction, SQLActionType, SQLService, SQLServiceConfig, SchemaInfo, ServiceContext, ServiceContextConfig, ServiceSession, SessionExpiredError, ShareAccess, ShareLink, ShareLinkData, ShareSchema, SharingService, SharingServiceConfig, SignCallback, SignInOptions, SignRequest, SignResponse, SilentNotificationHandler, Space, SpaceConfig, SpaceCreationContext, SpaceErrorCode, SpaceErrorCodes, SpaceInfo, SpaceOwnership, SpaceService, SpaceServiceConfig, SqlStatement, SqlValue, StoredDelegationChain, TableInfo, TinyCloud, TinyCloudConfig, TinyCloudSession, UnsupportedFeatureError, VaultCrypto, VaultEntry, VaultError, VaultGetOptions, VaultGrantOptions, VaultHeaders, VaultListOptions, VaultPublicSpaceKVActions, VaultPutOptions, VersionCheckError, ViewInfo, WasmVaultFunctions, buildSpaceUri, checkNodeInfo, createCapabilityKeyRegistry, createSharingService, createSpaceService, createVaultCrypto, defaultSpaceCreationHandler, expandActionShortNames, isCapabilitySubset, loadManifest, makePublicSpaceId, parseExpiry, parseSpaceUri, resolveManifest, validateManifest } from '@tinycloud/sdk-core';
1
+ import { ISessionStorage, PersistedSessionData, AutoSignStrategy, AutoRejectStrategy, CallbackStrategy, IUserAuthorization, ISigner, ISpaceCreationHandler, IWasmBindings, SiweConfig, Manifest, ComposedManifestRequest, ClientSession, TinyCloudSession, Extension, SignInOptions, Delegation, DelegatedResource, IKVService, ISQLService, IDuckDbService, IHooksService, INotificationHandler, IENSResolver, IDataVaultService, ICapabilityKeyRegistry, DelegationManager, ISpaceService, ISharingService, CreateDelegationParams, DelegationResult, PermissionEntry, ResolvedDelegate, KeyProvider, ISessionManager, JWK } from '@tinycloud/sdk-core';
2
+ export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, AutoApproveSpaceCreationHandler, AutoRejectStrategy, AutoSignStrategy, BatchOptions, BatchResponse, CallbackStrategy, CapabilityEntry, CapabilityKeyRegistry, CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, ClientSession, ColumnInfo, ComposeManifestOptions, ComposedManifestRequest, CreateDelegationParams, DEFAULT_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, DataVaultConfig, DataVaultService, DatabaseHandle, Delegation, DelegationChain, DelegationChainV2, DelegationDirection, DelegationError, DelegationErrorCode, DelegationErrorCodes, DelegationFilters, DelegationManager, DelegationManagerConfig, DelegationRecord, DelegationResult, DuckDbAction, DuckDbActionType, DuckDbBatchOptions, DuckDbBatchResponse, DuckDbDatabaseHandle, DuckDbExecuteOptions, DuckDbExecuteResponse, DuckDbOptions, DuckDbQueryOptions, DuckDbQueryResponse, DuckDbService, DuckDbServiceConfig, DuckDbStatement, DuckDbValue, EncodedShareData, ExecuteOptions, ExecuteResponse, Extension, FetchFunction, GenerateShareParams, ICapabilityKeyRegistry, IDataVaultService, IDatabaseHandle, IDuckDbDatabaseHandle, IDuckDbService, IENSResolver, IKVService, INotificationHandler, IPrefixedKVService, ISQLService, ISessionManager, ISessionStorage, ISharingService, ISigner, ISpace, ISpaceCreationHandler, ISpaceScopedDelegations, ISpaceScopedSharing, ISpaceService, IUserAuthorization, IWasmBindings, IngestOptions, InvokeFunction, JWK, KVResponse, KVService, KVServiceConfig, KeyInfo, KeyProvider, KeyType, Manifest, ManifestDefaults, ManifestRegistryRecord, ManifestValidationError, PermissionEntry, PermissionNotInManifestError, PersistedSessionData, PrefixedKVService, ProtocolMismatchError, QueryOptions, QueryResponse, ReceiveOptions, ResolvedCapabilities, ResolvedDelegate, ResourceCapability, SQLAction, SQLActionType, SQLService, SQLServiceConfig, SchemaInfo, ServiceContext, ServiceContextConfig, ServiceSession, SessionExpiredError, ShareAccess, ShareLink, ShareLinkData, ShareSchema, SharingService, SharingServiceConfig, SignCallback, SignInOptions, SignRequest, SignResponse, SilentNotificationHandler, Space, SpaceAbilitiesMap, SpaceConfig, SpaceCreationContext, SpaceErrorCode, SpaceErrorCodes, SpaceInfo, SpaceOwnership, SpaceService, SpaceServiceConfig, SqlStatement, SqlValue, StoredDelegationChain, TableInfo, TinyCloud, TinyCloudConfig, TinyCloudSession, UnsupportedFeatureError, VaultCrypto, VaultEntry, VaultError, VaultGetOptions, VaultGrantOptions, VaultHeaders, VaultListOptions, VaultPublicSpaceKVActions, VaultPutOptions, VersionCheckError, ViewInfo, WasmVaultFunctions, buildSpaceUri, checkNodeInfo, composeManifestRequest, createCapabilityKeyRegistry, createSharingService, createSpaceService, createVaultCrypto, defaultSpaceCreationHandler, expandActionShortNames, isCapabilitySubset, loadManifest, makePublicSpaceId, parseExpiry, parseSpaceUri, resolveManifest, resourceCapabilitiesToSpaceAbilitiesMap, validateManifest } from '@tinycloud/sdk-core';
3
3
  import { EventEmitter } from 'events';
4
4
  import { InvokeFunction } from '@tinycloud/sdk-services';
5
5
 
@@ -221,7 +221,11 @@ interface NodeUserAuthorizationConfig {
221
221
  * When omitted, `signIn` falls back to `defaultActions` for
222
222
  * backwards compatibility.
223
223
  */
224
- manifest?: Manifest;
224
+ manifest?: Manifest | Manifest[];
225
+ /** Pre-composed manifest request. Takes precedence over `manifest`. */
226
+ capabilityRequest?: ComposedManifestRequest;
227
+ /** Include implicit account registry permissions when composing `manifest`. Default true. */
228
+ includeAccountRegistryPermissions?: boolean;
225
229
  }
226
230
  /**
227
231
  * Node.js implementation of IUserAuthorization.
@@ -278,6 +282,8 @@ declare class NodeUserAuthorization implements IUserAuthorization {
278
282
  * of falling back to {@link defaultActions}.
279
283
  */
280
284
  private _manifest?;
285
+ private _capabilityRequest?;
286
+ private readonly includeAccountRegistryPermissions;
281
287
  private sessionManager;
282
288
  private extensions;
283
289
  private _session?;
@@ -292,12 +298,14 @@ declare class NodeUserAuthorization implements IUserAuthorization {
292
298
  * internals to surface the manifest for requestPermissions flows
293
299
  * without forcing the caller to track it separately.
294
300
  */
295
- get manifest(): Manifest | undefined;
301
+ get manifest(): Manifest | Manifest[] | undefined;
302
+ get capabilityRequest(): ComposedManifestRequest | undefined;
296
303
  /**
297
304
  * Install or replace the stored manifest. Takes effect on the next
298
305
  * `signIn()` call — the current session (if any) is not touched.
299
306
  */
300
- setManifest(manifest: Manifest | undefined): void;
307
+ setManifest(manifest: Manifest | Manifest[] | undefined): void;
308
+ setCapabilityRequest(request: ComposedManifestRequest | undefined): void;
301
309
  /**
302
310
  * The current active session (web-core compatible).
303
311
  */
@@ -334,7 +342,9 @@ declare class NodeUserAuthorization implements IUserAuthorization {
334
342
  *
335
343
  * @internal
336
344
  */
337
- private resolveSignInAbilities;
345
+ private getCapabilityRequest;
346
+ private resolveSpaceName;
347
+ private resolveSignInCapabilities;
338
348
  /**
339
349
  * Build SIWE overrides from the top-level nonce and siweConfig.
340
350
  * - Top-level `nonce` is seeded first so `siweConfig.nonce` wins if both are set.
@@ -363,6 +373,11 @@ declare class NodeUserAuthorization implements IUserAuthorization {
363
373
  * Used for lazy creation of additional spaces (e.g., public).
364
374
  */
365
375
  hostPublicSpace(spaceId: string): Promise<boolean>;
376
+ /**
377
+ * Create a specific owned space on the server via host delegation.
378
+ * Used by manifest registry setup for the account space.
379
+ */
380
+ hostOwnedSpace(spaceId: string): Promise<boolean>;
366
381
  /**
367
382
  * Ensure the user's space exists on the TinyCloud server.
368
383
  * Creates the space if it doesn't exist and autoCreateSpace is enabled.
@@ -645,7 +660,11 @@ interface TinyCloudNodeConfig {
645
660
  * backwards compatibility with callers that pre-date the manifest
646
661
  * flow.
647
662
  */
648
- manifest?: Manifest;
663
+ manifest?: Manifest | Manifest[];
664
+ /** Pre-composed manifest request. Takes precedence over `manifest`. */
665
+ capabilityRequest?: ComposedManifestRequest;
666
+ /** Include implicit account registry permissions when composing `manifest`. Default true. */
667
+ includeAccountRegistryPermissions?: boolean;
649
668
  }
650
669
  /**
651
670
  * Options for {@link TinyCloudNode.delegateTo}.
@@ -758,12 +777,14 @@ declare class TinyCloudNode {
758
777
  * layer (e.g. TinyCloudWeb.setManifest) so the manifest is kept
759
778
  * in sync across the stack.
760
779
  */
761
- setManifest(manifest: Manifest | undefined): void;
780
+ setManifest(manifest: Manifest | Manifest[] | undefined): void;
781
+ setCapabilityRequest(request: ComposedManifestRequest | undefined): void;
762
782
  /**
763
783
  * Return the manifest currently installed on the auth handler,
764
784
  * or `undefined` if none is set.
765
785
  */
766
- get manifest(): Manifest | undefined;
786
+ get manifest(): Manifest | Manifest[] | undefined;
787
+ get capabilityRequest(): ComposedManifestRequest | undefined;
767
788
  /**
768
789
  * Get the primary identity DID for this user.
769
790
  * - If wallet connected and signed in: returns PKH DID (did:pkh:eip155:{chainId}:{address})
@@ -807,6 +828,8 @@ declare class TinyCloudNode {
807
828
  * @param options - Optional per-call SIWE overrides for this sign-in only
808
829
  */
809
830
  signIn(options?: SignInOptions): Promise<void>;
831
+ private ownedSpaceId;
832
+ private writeManifestRegistryRecords;
810
833
  /**
811
834
  * Restore a previously established session from stored delegation data.
812
835
  *
@@ -1176,6 +1199,21 @@ declare class TinyCloudNode {
1176
1199
  * `forceWalletSign` is not set.
1177
1200
  */
1178
1201
  delegateTo(did: string, permissions: PermissionEntry[], options?: DelegateToOptions): Promise<DelegateToResult>;
1202
+ /**
1203
+ * Materialize one manifest-declared delegation using the current session key.
1204
+ * Delivery is intentionally out of band; callers decide how to transmit the
1205
+ * returned UCAN to the delegate.
1206
+ */
1207
+ materializeDelegation(did: string, request?: ComposedManifestRequest | undefined): Promise<DelegateToResult & {
1208
+ target: ResolvedDelegate;
1209
+ }>;
1210
+ /**
1211
+ * Materialize every delegation target declared by the composed manifest
1212
+ * request. This does not deliver the delegations anywhere.
1213
+ */
1214
+ materializeDelegations(request?: ComposedManifestRequest | undefined): Promise<Array<DelegateToResult & {
1215
+ target: ResolvedDelegate;
1216
+ }>>;
1179
1217
  /**
1180
1218
  * Issue a delegation via the session-key UCAN WASM path.
1181
1219
  *
@@ -1192,6 +1230,7 @@ declare class TinyCloudNode {
1192
1230
  * @internal
1193
1231
  */
1194
1232
  private createDelegationViaWasmPath;
1233
+ private resolvePermissionSpace;
1195
1234
  /**
1196
1235
  * Issue a delegation via the legacy wallet-signed SIWE path for a single
1197
1236
  * {@link PermissionEntry}. Shares the implementation with the public