@tinycloud/node-sdk 3.3.0-beta.21 → 3.3.0-beta.23

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,11 +1,11 @@
1
1
  import { ReplicationOptions } from '@tinycloud/sdk-core';
2
2
  export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, AccountApplication, AccountApplicationListOptions, AccountApplicationRegisterOptions, AccountDelegation, AccountDelegationListOptions, AccountDelegationRevokeOptions, AccountIndexEnsureResult, AccountIndexRebuildResult, AccountIndexStatus, AccountIndexedReadOptions, AccountService, AccountServiceConfig, AccountSpace, AccountSpaceListOptions, AccountStatus, AuthorityRefusal, AutoApproveSpaceCreationHandler, AutoRejectStrategy, AutoSignStrategy, BatchOptions, BatchResponse, CallbackStrategy, CanonicalAddress, CanonicalParsedNetworkId, CapabilityEntry, CapabilityKeyRegistry, CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, CaveatedDelegationUnsupportedError, ClientSession, ColumnInfo, ComposeManifestOptions, ComposedManifestRequest, CreateDelegationParams, DEFAULT_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, DEFAULT_SIGNED_READ_URL_EXPIRY_MS, DataVaultConfig, DataVaultService, DatabaseHandle, DelegateReceivedShareParams, DelegatedShareAccess, Delegation, DelegationChain, DelegationChainV2, DelegationDirection, DelegationError, DelegationErrorCode, DelegationErrorCodes, DelegationFilters, DelegationManager, DelegationManagerConfig, DelegationRecord, DelegationResult, DidCacheKeyOptions, DidEqualsOptions, 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, ISecretsService, ISessionManager, ISessionStorage, ISharingService, ISigner, ISpace, ISpaceCreationHandler, ISpaceScopedDelegations, ISpaceScopedSharing, ISpaceService, IUserAuthorization, IWasmBindings, IdentityParseError, IngestOptions, InvokeFunction, JWK, KVBatchReadResponse, KVCreateSignedReadUrlOptions, KVListPage, KVReadThrough, KVReplicaHandle, KVReplicaSpec, KVReplicaStorage, KVReplicationController, KVReplicationDeps, KVResponse, KVService, KVServiceConfig, KVSignedReadUrlResponse, KeyInfo, KeyProvider, KeyType, LocalGetResult, LocalListResult, LocalReadMeta, LocalReplicaStatus, LocalSyncResult, Manifest, ManifestDefaults, ManifestRegistryRecord, ManifestSecretActions, ManifestValidationError, OpenKeyCallbackStrategy, OpenKeySigningRequestBody, OpenKeySigningResponseBody, OpenKeySigningStrategyOptions, ParsedSecretCatalogKey, PendingWriteRecord, PendingWriteState, PendingWriteStore, PermissionEntry, PermissionNotInManifestError, PersistedSessionData, PinnedKey, PkhDidParts, PrefixedKVService, ProtocolMismatchError, PurgeTarget, QueryOptions, QueryResponse, ReceiveOptions, RegisterBatchSuccess, RegisterPolicyV3Input, RegisterPolicyV3Receipt, ReplicaAuthorityState, ReplicaCoverage, ReplicaDevice, ReplicaGatedHandle, ReplicaGrantInfo, ReplicaInspectedStatus, ReplicaState, ReplicaStatusEntry, ReplicationAuthority, ReplicationControl, ReplicationEvent, ReplicationIdentity, ReplicationOptions, ReplicationPurgeReport, ReplicationReason, ReplicationScheduler, ResolvedCapabilities, ResolvedDelegate, ResolvedReplicationOptions, ResolvedSecretPath, ResourceCapability, SECRET_NAME_RE, SQLAction, SQLActionType, SQLService, SQLServiceConfig, SchemaInfo, SecretCatalogEntry, SecretPayload, SecretScopeOptions, SecretsError, SecretsService, 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, TelemetryConfig, TelemetryEventHandler, TinyCloud, TinyCloudConfig, TinyCloudDebugEnableOptions, TinyCloudDebugEvent, TinyCloudDebugLevel, TinyCloudDebugLogger, TinyCloudDebugTimer, TinyCloudSession, UnsupportedFeatureError, VAULT_PERMISSION_SERVICE, VaultCrypto, VaultEntry, VaultError, VaultGetOptions, VaultGrantOptions, VaultHeaders, VaultListOptions, VaultNetworkReadResult, VaultPublicSpaceKVActions, VaultPutOptions, VersionCheckError, ViewInfo, WasmVaultFunctions, addressStorageKey, buildSpaceUri, canonicalizeAddress, canonicalizeDid, canonicalizeDidUrl, canonicalizeNetworkId, canonicalizeSecretScope, checkNodeInfo, clearTinyCloudDebugLogs, composeManifestRequest, createCapabilityKeyRegistry, createOpenKeyCallbackSigningStrategy, createSharingService, createSpaceService, createVaultCrypto, defaultSpaceCreationHandler, didCacheKey, didEquals, disableTinyCloudDebug, enableTinyCloudDebug, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, getTinyCloudDebugLogs, installTinyCloudDebugGlobals, isCapabilitySubset, isEvmAddress, loadManifest, makePkhSpaceId, makePublicSpaceId, parseCanonicalNetworkId, parseExpiry, parsePkhDid, parseSecretCatalogKey, parseSpaceUri, pkhDid, principalDid, principalDidEquals, resolveManifest, resolveSecretListPrefix, resolveSecretPath, resourceCapabilitiesToSpaceAbilitiesMap, tinyCloudDebugLogger, validateManifest } from '@tinycloud/sdk-core';
3
3
  import { _ as __gated_network } from './gated-network-BEF2XSTC.cjs';
4
- import { _ as __authority } from './authority-21H2cKmO.cjs';
4
+ import { _ as __authority } from './authority-DVbN0Tqt.cjs';
5
5
  import { _ as __runtime } from './runtime-D1o9Eybt.cjs';
6
6
  import { ReplicaDenyInput } from '@tinycloud/sdk-services/kv/replication';
7
7
  export { F as FileSessionStorage, M as MemorySessionStorage, W as WasmKeyProvider, a as WasmKeyProviderConfig, c as createWasmKeyProvider } from './WasmKeyProvider-5Ee7fcAw.cjs';
8
- export { e as BootstrapWarning, C as CompactRuntimeDelegationInput, f as CreateOwnerDelegationParams, D as DelegateToOptions, g as DelegateToResult, h as DelegatedAccess, E as EnsureEncryptionNetworkOptions, I as InvalidRestoredSessionError, N as NodeEventEmitterStrategy, j as NodeUserAuthorization, l as NodeUserAuthorizationConfig, p as OwnerDelegationReceipt, P as PortableDelegation, u as RuntimePermissionGrantOptions, S as SecretPermissionHint, v as SecretReadInput, w as SecretReadResult, y as SignStrategy, T as TinyCloudNode, z as TinyCloudNodeConfig, U as UnifiedOwnerRootInput, F as UnifiedOwnerRootReceipt, G as UnsupportedSessionRestoreError, V as ValidatedRuntimeDelegation, J as activateCompactRuntimeDelegation, L as defaultSignStrategy, M as deserializeDelegation, W as serializeDelegation } from './TinyCloudNode-BPDOmuf6.cjs';
8
+ export { e as BootstrapWarning, C as CompactRuntimeDelegationInput, f as CreateOwnerDelegationParams, D as DelegateToOptions, g as DelegateToResult, h as DelegatedAccess, E as EnsureEncryptionNetworkOptions, I as InvalidRestoredSessionError, N as NodeEventEmitterStrategy, j as NodeUserAuthorization, l as NodeUserAuthorizationConfig, p as OwnerDelegationReceipt, P as PortableDelegation, u as RuntimePermissionGrantOptions, S as SecretPermissionHint, v as SecretReadInput, w as SecretReadResult, y as SignStrategy, T as TinyCloudNode, z as TinyCloudNodeConfig, U as UnifiedOwnerRootInput, F as UnifiedOwnerRootReceipt, G as UnsupportedSessionRestoreError, V as ValidatedRuntimeDelegation, J as activateCompactRuntimeDelegation, L as defaultSignStrategy, M as deserializeDelegation, W as serializeDelegation } from './TinyCloudNode-Dxdmw48u.cjs';
9
9
  import '@tinycloud/sdk-services';
10
10
  import 'events';
11
11
 
package/dist/core.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import { ReplicationOptions } from '@tinycloud/sdk-core';
2
2
  export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, AccountApplication, AccountApplicationListOptions, AccountApplicationRegisterOptions, AccountDelegation, AccountDelegationListOptions, AccountDelegationRevokeOptions, AccountIndexEnsureResult, AccountIndexRebuildResult, AccountIndexStatus, AccountIndexedReadOptions, AccountService, AccountServiceConfig, AccountSpace, AccountSpaceListOptions, AccountStatus, AuthorityRefusal, AutoApproveSpaceCreationHandler, AutoRejectStrategy, AutoSignStrategy, BatchOptions, BatchResponse, CallbackStrategy, CanonicalAddress, CanonicalParsedNetworkId, CapabilityEntry, CapabilityKeyRegistry, CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, CaveatedDelegationUnsupportedError, ClientSession, ColumnInfo, ComposeManifestOptions, ComposedManifestRequest, CreateDelegationParams, DEFAULT_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, DEFAULT_SIGNED_READ_URL_EXPIRY_MS, DataVaultConfig, DataVaultService, DatabaseHandle, DelegateReceivedShareParams, DelegatedShareAccess, Delegation, DelegationChain, DelegationChainV2, DelegationDirection, DelegationError, DelegationErrorCode, DelegationErrorCodes, DelegationFilters, DelegationManager, DelegationManagerConfig, DelegationRecord, DelegationResult, DidCacheKeyOptions, DidEqualsOptions, 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, ISecretsService, ISessionManager, ISessionStorage, ISharingService, ISigner, ISpace, ISpaceCreationHandler, ISpaceScopedDelegations, ISpaceScopedSharing, ISpaceService, IUserAuthorization, IWasmBindings, IdentityParseError, IngestOptions, InvokeFunction, JWK, KVBatchReadResponse, KVCreateSignedReadUrlOptions, KVListPage, KVReadThrough, KVReplicaHandle, KVReplicaSpec, KVReplicaStorage, KVReplicationController, KVReplicationDeps, KVResponse, KVService, KVServiceConfig, KVSignedReadUrlResponse, KeyInfo, KeyProvider, KeyType, LocalGetResult, LocalListResult, LocalReadMeta, LocalReplicaStatus, LocalSyncResult, Manifest, ManifestDefaults, ManifestRegistryRecord, ManifestSecretActions, ManifestValidationError, OpenKeyCallbackStrategy, OpenKeySigningRequestBody, OpenKeySigningResponseBody, OpenKeySigningStrategyOptions, ParsedSecretCatalogKey, PendingWriteRecord, PendingWriteState, PendingWriteStore, PermissionEntry, PermissionNotInManifestError, PersistedSessionData, PinnedKey, PkhDidParts, PrefixedKVService, ProtocolMismatchError, PurgeTarget, QueryOptions, QueryResponse, ReceiveOptions, RegisterBatchSuccess, RegisterPolicyV3Input, RegisterPolicyV3Receipt, ReplicaAuthorityState, ReplicaCoverage, ReplicaDevice, ReplicaGatedHandle, ReplicaGrantInfo, ReplicaInspectedStatus, ReplicaState, ReplicaStatusEntry, ReplicationAuthority, ReplicationControl, ReplicationEvent, ReplicationIdentity, ReplicationOptions, ReplicationPurgeReport, ReplicationReason, ReplicationScheduler, ResolvedCapabilities, ResolvedDelegate, ResolvedReplicationOptions, ResolvedSecretPath, ResourceCapability, SECRET_NAME_RE, SQLAction, SQLActionType, SQLService, SQLServiceConfig, SchemaInfo, SecretCatalogEntry, SecretPayload, SecretScopeOptions, SecretsError, SecretsService, 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, TelemetryConfig, TelemetryEventHandler, TinyCloud, TinyCloudConfig, TinyCloudDebugEnableOptions, TinyCloudDebugEvent, TinyCloudDebugLevel, TinyCloudDebugLogger, TinyCloudDebugTimer, TinyCloudSession, UnsupportedFeatureError, VAULT_PERMISSION_SERVICE, VaultCrypto, VaultEntry, VaultError, VaultGetOptions, VaultGrantOptions, VaultHeaders, VaultListOptions, VaultNetworkReadResult, VaultPublicSpaceKVActions, VaultPutOptions, VersionCheckError, ViewInfo, WasmVaultFunctions, addressStorageKey, buildSpaceUri, canonicalizeAddress, canonicalizeDid, canonicalizeDidUrl, canonicalizeNetworkId, canonicalizeSecretScope, checkNodeInfo, clearTinyCloudDebugLogs, composeManifestRequest, createCapabilityKeyRegistry, createOpenKeyCallbackSigningStrategy, createSharingService, createSpaceService, createVaultCrypto, defaultSpaceCreationHandler, didCacheKey, didEquals, disableTinyCloudDebug, enableTinyCloudDebug, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, getTinyCloudDebugLogs, installTinyCloudDebugGlobals, isCapabilitySubset, isEvmAddress, loadManifest, makePkhSpaceId, makePublicSpaceId, parseCanonicalNetworkId, parseExpiry, parsePkhDid, parseSecretCatalogKey, parseSpaceUri, pkhDid, principalDid, principalDidEquals, resolveManifest, resolveSecretListPrefix, resolveSecretPath, resourceCapabilitiesToSpaceAbilitiesMap, tinyCloudDebugLogger, validateManifest } from '@tinycloud/sdk-core';
3
3
  import { _ as __gated_network } from './gated-network-BEF2XSTC.js';
4
- import { _ as __authority } from './authority-C-pzOYXq.js';
4
+ import { _ as __authority } from './authority-CT9_mApq.js';
5
5
  import { _ as __runtime } from './runtime-v62FzQHz.js';
6
6
  import { ReplicaDenyInput } from '@tinycloud/sdk-services/kv/replication';
7
7
  export { F as FileSessionStorage, M as MemorySessionStorage, W as WasmKeyProvider, a as WasmKeyProviderConfig, c as createWasmKeyProvider } from './WasmKeyProvider-5Ee7fcAw.js';
8
- export { e as BootstrapWarning, C as CompactRuntimeDelegationInput, f as CreateOwnerDelegationParams, D as DelegateToOptions, g as DelegateToResult, h as DelegatedAccess, E as EnsureEncryptionNetworkOptions, I as InvalidRestoredSessionError, N as NodeEventEmitterStrategy, j as NodeUserAuthorization, l as NodeUserAuthorizationConfig, p as OwnerDelegationReceipt, P as PortableDelegation, u as RuntimePermissionGrantOptions, S as SecretPermissionHint, v as SecretReadInput, w as SecretReadResult, y as SignStrategy, T as TinyCloudNode, z as TinyCloudNodeConfig, U as UnifiedOwnerRootInput, F as UnifiedOwnerRootReceipt, G as UnsupportedSessionRestoreError, V as ValidatedRuntimeDelegation, J as activateCompactRuntimeDelegation, L as defaultSignStrategy, M as deserializeDelegation, W as serializeDelegation } from './TinyCloudNode-BPDOmuf6.js';
8
+ export { e as BootstrapWarning, C as CompactRuntimeDelegationInput, f as CreateOwnerDelegationParams, D as DelegateToOptions, g as DelegateToResult, h as DelegatedAccess, E as EnsureEncryptionNetworkOptions, I as InvalidRestoredSessionError, N as NodeEventEmitterStrategy, j as NodeUserAuthorization, l as NodeUserAuthorizationConfig, p as OwnerDelegationReceipt, P as PortableDelegation, u as RuntimePermissionGrantOptions, S as SecretPermissionHint, v as SecretReadInput, w as SecretReadResult, y as SignStrategy, T as TinyCloudNode, z as TinyCloudNodeConfig, U as UnifiedOwnerRootInput, F as UnifiedOwnerRootReceipt, G as UnsupportedSessionRestoreError, V as ValidatedRuntimeDelegation, J as activateCompactRuntimeDelegation, L as defaultSignStrategy, M as deserializeDelegation, W as serializeDelegation } from './TinyCloudNode-Dxdmw48u.js';
9
9
  import '@tinycloud/sdk-services';
10
10
  import 'events';
11
11
 
package/dist/core.js CHANGED
@@ -3355,6 +3355,12 @@ function describeHostFailure2(result) {
3355
3355
  const text = result.error?.trim();
3356
3356
  return text ? `${result.status} - ${text}` : `${result.status}`;
3357
3357
  }
3358
+ function assertDelegationActivated(result, delegation, requireActivation) {
3359
+ const skipped = requireActivation ? (delegation.resources?.map((r) => r.space) ?? [delegation.spaceId]).filter((space) => result.skipped?.includes(space)) : [];
3360
+ if (result.success && skipped.length === 0) return;
3361
+ const detail = result.success ? `the node skipped ${[...new Set(skipped)].join(", ")} (space not hosted on the node)` : describeHostFailure2(result);
3362
+ throw Object.assign(new Error(`Failed to activate delegation with host: ${detail}`), { cause: result });
3363
+ }
3358
3364
  function ownerDelegationPermissions(params) {
3359
3365
  const hasPermissions = Object.prototype.hasOwnProperty.call(params, "permissions");
3360
3366
  const hasLegacy = Object.prototype.hasOwnProperty.call(params, "path") || Object.prototype.hasOwnProperty.call(params, "actions");
@@ -3988,7 +3994,6 @@ var _TinyCloudNode = class _TinyCloudNode {
3988
3994
  if (!this.wasmBindings.computeCid) throw new Error("computeCid is unavailable");
3989
3995
  return this.wasmBindings.computeCid(data, codec);
3990
3996
  },
3991
- // delegationManager: undefined - not needed for receive()
3992
3997
  createKVService: (config) => {
3993
3998
  const prefix = config.pathPrefix?.replace(/\/$/, "");
3994
3999
  const kvService = new KVService2({ prefix });
@@ -6072,7 +6077,6 @@ var _TinyCloudNode = class _TinyCloudNode {
6072
6077
  });
6073
6078
  sharingService.updateConfig({
6074
6079
  session: input.serviceSession,
6075
- delegationManager,
6076
6080
  sessionExpiry: input.sessionExpiry,
6077
6081
  createDelegationWasm: (params) => {
6078
6082
  graph.assertActive();
@@ -7012,7 +7016,6 @@ var _TinyCloudNode = class _TinyCloudNode {
7012
7016
  assertActive: () => graph.assertActive(),
7013
7017
  keyProvider: this._keyProvider,
7014
7018
  registry: this._capabilityRegistry,
7015
- delegationManager: this._delegationManager,
7016
7019
  sessionExpiry: this.getSessionExpiry(),
7017
7020
  createDelegationWasm: (params) => {
7018
7021
  graph.assertActive();
@@ -7995,16 +7998,8 @@ var _TinyCloudNode = class _TinyCloudNode {
7995
7998
  * ```typescript
7996
7999
  * const delegations = alice.delegationManager;
7997
8000
  *
7998
- * // Create a delegation
7999
- * const result = await delegations.create({
8000
- * delegateDID: bob.did,
8001
- * path: "shared/",
8002
- * actions: ["tinycloud.kv/get", "tinycloud.kv/put"],
8003
- * expiry: new Date(Date.now() + 24 * 60 * 60 * 1000), // 24 hours
8004
- * });
8005
- *
8006
- * // List delegations
8007
- * const listResult = await delegations.list();
8001
+ * // Query account delegations
8002
+ * const page = await delegations.query();
8008
8003
  *
8009
8004
  * // Revoke a delegation
8010
8005
  * await delegations.revoke(delegationCid);
@@ -8205,32 +8200,6 @@ var _TinyCloudNode = class _TinyCloudNode {
8205
8200
  // ===========================================================================
8206
8201
  // v2 Delegation Convenience Methods
8207
8202
  // ===========================================================================
8208
- /**
8209
- * Create a delegation using the v2 DelegationManager.
8210
- *
8211
- * This is a convenience method that wraps DelegationManager.create().
8212
- * For more control, use `this.delegationManager` directly.
8213
- *
8214
- * @param params - Delegation parameters
8215
- * @returns Result containing the created Delegation
8216
- *
8217
- * @example
8218
- * ```typescript
8219
- * const result = await alice.delegate({
8220
- * delegateDID: bob.did,
8221
- * path: "shared/",
8222
- * actions: ["tinycloud.kv/get", "tinycloud.kv/put"],
8223
- * expiry: new Date(Date.now() + 24 * 60 * 60 * 1000),
8224
- * });
8225
- *
8226
- * if (result.ok) {
8227
- * console.log("Delegation created:", result.data.cid);
8228
- * }
8229
- * ```
8230
- */
8231
- async delegate(params) {
8232
- return this.delegationManager.create(params);
8233
- }
8234
8203
  /**
8235
8204
  * Revoke a delegation with the owner wallet when available. Session-only
8236
8205
  * clients continue to use their delegated revocation authority.
@@ -8256,14 +8225,6 @@ var _TinyCloudNode = class _TinyCloudNode {
8256
8225
  0x55n
8257
8226
  );
8258
8227
  }
8259
- /**
8260
- * List all delegations for the current session's space.
8261
- *
8262
- * @returns Result containing an array of Delegations
8263
- */
8264
- async listDelegations() {
8265
- return this.delegationManager.list();
8266
- }
8267
8228
  /**
8268
8229
  * Check if the current session has permission for a path and action.
8269
8230
  *
@@ -8391,7 +8352,8 @@ var _TinyCloudNode = class _TinyCloudNode {
8391
8352
  plan.grant,
8392
8353
  plan.operations,
8393
8354
  onPrepared,
8394
- options?.disableSubDelegation === true
8355
+ options?.disableSubDelegation === true,
8356
+ options?.requireActivation === true
8395
8357
  );
8396
8358
  return { delegation: delegation2, prompted: false };
8397
8359
  }
@@ -8401,7 +8363,8 @@ var _TinyCloudNode = class _TinyCloudNode {
8401
8363
  effectiveExpiration,
8402
8364
  session,
8403
8365
  onPrepared,
8404
- options?.disableSubDelegation === true
8366
+ options?.disableSubDelegation === true,
8367
+ options?.requireActivation === true
8405
8368
  );
8406
8369
  return { delegation, prompted: false };
8407
8370
  }
@@ -8632,7 +8595,7 @@ var _TinyCloudNode = class _TinyCloudNode {
8632
8595
  *
8633
8596
  * @internal
8634
8597
  */
8635
- async createDelegationViaWasmPath(did, entries, expirationTime, session, onPrepared, disableSubDelegation = false) {
8598
+ async createDelegationViaWasmPath(did, entries, expirationTime, session, onPrepared, disableSubDelegation = false, requireActivation = false) {
8636
8599
  if (entries.length === 0) {
8637
8600
  throw new Error(
8638
8601
  "createDelegationViaWasmPath requires a non-empty entries array"
@@ -8716,15 +8679,10 @@ var _TinyCloudNode = class _TinyCloudNode {
8716
8679
  this.config.host,
8717
8680
  delegationHeader
8718
8681
  );
8719
- if (!activateResult.success) {
8720
- throw Object.assign(
8721
- new Error(`Failed to activate delegation with host: ${describeHostFailure2(activateResult)}`),
8722
- { cause: activateResult }
8723
- );
8724
- }
8682
+ assertDelegationActivated(activateResult, delegation, requireActivation);
8725
8683
  return delegation;
8726
8684
  }
8727
- async createDelegationViaRuntimeGrant(did, entries, expirationTime, grant, requestedOperations, onPrepared, disableSubDelegation = false) {
8685
+ async createDelegationViaRuntimeGrant(did, entries, expirationTime, grant, requestedOperations, onPrepared, disableSubDelegation = false, requireActivation = false) {
8728
8686
  this.assertRuntimeGrantCaveatsPreservable(entries, requestedOperations, grant);
8729
8687
  this.assertDelegationCaveatsPreservable(entries);
8730
8688
  const result = this.createDelegationWrapper({
@@ -8758,12 +8716,7 @@ var _TinyCloudNode = class _TinyCloudNode {
8758
8716
  targetHost,
8759
8717
  delegationHeader
8760
8718
  );
8761
- if (!activateResult.success) {
8762
- throw Object.assign(
8763
- new Error(`Failed to activate delegation with host: ${describeHostFailure2(activateResult)}`),
8764
- { cause: activateResult }
8765
- );
8766
- }
8719
+ assertDelegationActivated(activateResult, delegation, requireActivation);
8767
8720
  return delegation;
8768
8721
  }
8769
8722
  resolvePermissionSpace(space, session) {