@tinycloud/node-sdk 3.3.0-beta.22 → 3.3.0-beta.24

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-S-huUKlr.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-Cm8kblSj.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-CPSGMw2l.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-Cm8kblSj.js';
9
9
  import '@tinycloud/sdk-services';
10
10
  import 'events';
11
11
 
package/dist/core.js CHANGED
@@ -34,7 +34,7 @@ import {
34
34
  principalDidEquals as principalDidEquals4,
35
35
  parseCanonicalNetworkId,
36
36
  TinyCloudDebugLogger,
37
- tinyCloudDebugLogger,
37
+ tinyCloudDebugLogger as tinyCloudDebugLogger2,
38
38
  enableTinyCloudDebug,
39
39
  disableTinyCloudDebug,
40
40
  getTinyCloudDebugLogs,
@@ -2621,7 +2621,8 @@ import {
2621
2621
  serviceError
2622
2622
  } from "@tinycloud/sdk-core";
2623
2623
  import {
2624
- parsePermissionHint
2624
+ parsePermissionHint,
2625
+ tinyCloudDebugLogger
2625
2626
  } from "@tinycloud/sdk-services";
2626
2627
 
2627
2628
  // src/account/AccountService.ts
@@ -3355,6 +3356,12 @@ function describeHostFailure2(result) {
3355
3356
  const text = result.error?.trim();
3356
3357
  return text ? `${result.status} - ${text}` : `${result.status}`;
3357
3358
  }
3359
+ function assertDelegationActivated(result, delegation, requireActivation) {
3360
+ const skipped = requireActivation ? (delegation.resources?.map((r) => r.space) ?? [delegation.spaceId]).filter((space) => result.skipped?.includes(space)) : [];
3361
+ if (result.success && skipped.length === 0) return;
3362
+ const detail = result.success ? `the node skipped ${[...new Set(skipped)].join(", ")} (space not hosted on the node)` : describeHostFailure2(result);
3363
+ throw Object.assign(new Error(`Failed to activate delegation with host: ${detail}`), { cause: result });
3364
+ }
3358
3365
  function ownerDelegationPermissions(params) {
3359
3366
  const hasPermissions = Object.prototype.hasOwnProperty.call(params, "permissions");
3360
3367
  const hasLegacy = Object.prototype.hasOwnProperty.call(params, "path") || Object.prototype.hasOwnProperty.call(params, "actions");
@@ -3988,7 +3995,6 @@ var _TinyCloudNode = class _TinyCloudNode {
3988
3995
  if (!this.wasmBindings.computeCid) throw new Error("computeCid is unavailable");
3989
3996
  return this.wasmBindings.computeCid(data, codec);
3990
3997
  },
3991
- // delegationManager: undefined - not needed for receive()
3992
3998
  createKVService: (config) => {
3993
3999
  const prefix = config.pathPrefix?.replace(/\/$/, "");
3994
4000
  const kvService = new KVService2({ prefix });
@@ -5107,6 +5113,10 @@ var _TinyCloudNode = class _TinyCloudNode {
5107
5113
  return;
5108
5114
  }
5109
5115
  if (!this.currentSessionCoversAccountRegistry()) {
5116
+ if (!_TinyCloudNode.accountRegistrySkipLogged) {
5117
+ _TinyCloudNode.accountRegistrySkipLogged = true;
5118
+ tinyCloudDebugLogger.log("registry.skip");
5119
+ }
5110
5120
  return;
5111
5121
  }
5112
5122
  const controller = new AbortController();
@@ -6072,7 +6082,6 @@ var _TinyCloudNode = class _TinyCloudNode {
6072
6082
  });
6073
6083
  sharingService.updateConfig({
6074
6084
  session: input.serviceSession,
6075
- delegationManager,
6076
6085
  sessionExpiry: input.sessionExpiry,
6077
6086
  createDelegationWasm: (params) => {
6078
6087
  graph.assertActive();
@@ -7012,7 +7021,6 @@ var _TinyCloudNode = class _TinyCloudNode {
7012
7021
  assertActive: () => graph.assertActive(),
7013
7022
  keyProvider: this._keyProvider,
7014
7023
  registry: this._capabilityRegistry,
7015
- delegationManager: this._delegationManager,
7016
7024
  sessionExpiry: this.getSessionExpiry(),
7017
7025
  createDelegationWasm: (params) => {
7018
7026
  graph.assertActive();
@@ -7995,16 +8003,8 @@ var _TinyCloudNode = class _TinyCloudNode {
7995
8003
  * ```typescript
7996
8004
  * const delegations = alice.delegationManager;
7997
8005
  *
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();
8006
+ * // Query account delegations
8007
+ * const page = await delegations.query();
8008
8008
  *
8009
8009
  * // Revoke a delegation
8010
8010
  * await delegations.revoke(delegationCid);
@@ -8205,32 +8205,6 @@ var _TinyCloudNode = class _TinyCloudNode {
8205
8205
  // ===========================================================================
8206
8206
  // v2 Delegation Convenience Methods
8207
8207
  // ===========================================================================
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
8208
  /**
8235
8209
  * Revoke a delegation with the owner wallet when available. Session-only
8236
8210
  * clients continue to use their delegated revocation authority.
@@ -8256,14 +8230,6 @@ var _TinyCloudNode = class _TinyCloudNode {
8256
8230
  0x55n
8257
8231
  );
8258
8232
  }
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
8233
  /**
8268
8234
  * Check if the current session has permission for a path and action.
8269
8235
  *
@@ -8391,7 +8357,8 @@ var _TinyCloudNode = class _TinyCloudNode {
8391
8357
  plan.grant,
8392
8358
  plan.operations,
8393
8359
  onPrepared,
8394
- options?.disableSubDelegation === true
8360
+ options?.disableSubDelegation === true,
8361
+ options?.requireActivation === true
8395
8362
  );
8396
8363
  return { delegation: delegation2, prompted: false };
8397
8364
  }
@@ -8401,7 +8368,8 @@ var _TinyCloudNode = class _TinyCloudNode {
8401
8368
  effectiveExpiration,
8402
8369
  session,
8403
8370
  onPrepared,
8404
- options?.disableSubDelegation === true
8371
+ options?.disableSubDelegation === true,
8372
+ options?.requireActivation === true
8405
8373
  );
8406
8374
  return { delegation, prompted: false };
8407
8375
  }
@@ -8632,7 +8600,7 @@ var _TinyCloudNode = class _TinyCloudNode {
8632
8600
  *
8633
8601
  * @internal
8634
8602
  */
8635
- async createDelegationViaWasmPath(did, entries, expirationTime, session, onPrepared, disableSubDelegation = false) {
8603
+ async createDelegationViaWasmPath(did, entries, expirationTime, session, onPrepared, disableSubDelegation = false, requireActivation = false) {
8636
8604
  if (entries.length === 0) {
8637
8605
  throw new Error(
8638
8606
  "createDelegationViaWasmPath requires a non-empty entries array"
@@ -8716,15 +8684,10 @@ var _TinyCloudNode = class _TinyCloudNode {
8716
8684
  this.config.host,
8717
8685
  delegationHeader
8718
8686
  );
8719
- if (!activateResult.success) {
8720
- throw Object.assign(
8721
- new Error(`Failed to activate delegation with host: ${describeHostFailure2(activateResult)}`),
8722
- { cause: activateResult }
8723
- );
8724
- }
8687
+ assertDelegationActivated(activateResult, delegation, requireActivation);
8725
8688
  return delegation;
8726
8689
  }
8727
- async createDelegationViaRuntimeGrant(did, entries, expirationTime, grant, requestedOperations, onPrepared, disableSubDelegation = false) {
8690
+ async createDelegationViaRuntimeGrant(did, entries, expirationTime, grant, requestedOperations, onPrepared, disableSubDelegation = false, requireActivation = false) {
8728
8691
  this.assertRuntimeGrantCaveatsPreservable(entries, requestedOperations, grant);
8729
8692
  this.assertDelegationCaveatsPreservable(entries);
8730
8693
  const result = this.createDelegationWrapper({
@@ -8758,12 +8721,7 @@ var _TinyCloudNode = class _TinyCloudNode {
8758
8721
  targetHost,
8759
8722
  delegationHeader
8760
8723
  );
8761
- if (!activateResult.success) {
8762
- throw Object.assign(
8763
- new Error(`Failed to activate delegation with host: ${describeHostFailure2(activateResult)}`),
8764
- { cause: activateResult }
8765
- );
8766
- }
8724
+ assertDelegationActivated(activateResult, delegation, requireActivation);
8767
8725
  return delegation;
8768
8726
  }
8769
8727
  resolvePermissionSpace(space, session) {
@@ -9710,6 +9668,8 @@ var _TinyCloudNode = class _TinyCloudNode {
9710
9668
  };
9711
9669
  }
9712
9670
  };
9671
+ /** Set once per process: the registry sync was skipped for want of account access. */
9672
+ _TinyCloudNode.accountRegistrySkipLogged = false;
9713
9673
  // ===========================================================================
9714
9674
  // Capability-chain delegation (spec: .claude/specs/capability-chain.md)
9715
9675
  // ===========================================================================
@@ -9894,7 +9854,7 @@ export {
9894
9854
  resolveSecretPath3 as resolveSecretPath,
9895
9855
  resourceCapabilitiesToSpaceAbilitiesMap2 as resourceCapabilitiesToSpaceAbilitiesMap,
9896
9856
  serializeDelegation,
9897
- tinyCloudDebugLogger,
9857
+ tinyCloudDebugLogger2 as tinyCloudDebugLogger,
9898
9858
  validateManifest
9899
9859
  };
9900
9860
  //# sourceMappingURL=core.js.map