@tinycloud/node-sdk 2.11.0 → 2.11.1-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.
@@ -1,4 +1,4 @@
1
- import { ISessionStorage, PersistedSessionData, AutoSignStrategy, AutoRejectStrategy, CallbackStrategy, IUserAuthorization, ISigner, ISpaceCreationHandler, LocalNodeIdentityStore, IWasmBindings, ISessionManager, SiweConfig, Manifest, ComposedManifestRequest, ClientSession, TinyCloudSession, Extension, SignRequest, SignInOptions, CapabilityPresentationEnvelopeV1, Delegation, DelegatedResource, PermissionEntry, TelemetryConfig, IKVService, ISQLService, IDuckDbService, IHooksService, CreateOwnerDelegationParams as CreateOwnerDelegationParams$1, OwnerDelegationReceipt as OwnerDelegationReceipt$1, INotificationHandler, IENSResolver, AccountService, InvokeAnyFunction as InvokeAnyFunction$1, RegisterOwnerSharePolicyParams, OwnerSharePolicyRegistrationReceipt, ShareDeliveryAuthorizationReceipt, IDataVaultService, IEncryptionService, NetworkDescriptor, ISecretsService, ICapabilityKeyRegistry, DelegationManager, ISpaceService, ISpace, ISharingService, CreateDelegationParams, DelegationResult, DelegationRevocationReceipt, DelegationStatus, ResolvedDelegate, KeyProvider, JWK } from '@tinycloud/sdk-core';
1
+ import { ISessionStorage, PersistedSessionData, AutoSignStrategy, AutoRejectStrategy, CallbackStrategy, IUserAuthorization, ISigner, ISpaceCreationHandler, LocalNodeIdentityStore, IWasmBindings, ISessionManager, SiweConfig, Manifest, ComposedManifestRequest, ClientSession, TinyCloudSession, Extension, SignRequest, SignInOptions, CapabilityPresentationEnvelopeV1, Delegation, DelegatedResource, PermissionEntry, TelemetryConfig, IKVService, ISQLService, IDuckDbService, IHooksService, CreateOwnerDelegationParams as CreateOwnerDelegationParams$1, OwnerDelegationReceipt as OwnerDelegationReceipt$1, INotificationHandler, IENSResolver, AccountService, InvokeAnyFunction as InvokeAnyFunction$1, UnifiedPolicyCapability, RegisterOwnerSharePolicyParams, OwnerSharePolicyRegistrationReceipt, ShareDeliveryAuthorizationReceipt, IDataVaultService, IEncryptionService, NetworkDescriptor, ISecretsService, ICapabilityKeyRegistry, DelegationManager, ISpaceService, ISpace, ISharingService, CreateDelegationParams, DelegationResult, DelegationRevocationReceipt, DelegationStatus, ResolvedDelegate, KeyProvider, JWK } from '@tinycloud/sdk-core';
2
2
  import { EventEmitter } from 'events';
3
3
  import { InvokeFunction, InvokeAnyFunction } from '@tinycloud/sdk-services';
4
4
 
@@ -828,6 +828,13 @@ interface ValidatedRuntimeDelegation {
828
828
  /** Host selected for, and used by, the runtime activation. */
829
829
  readonly host: string;
830
830
  }
831
+ interface CompactRuntimeDelegationInput {
832
+ readonly authorization: string;
833
+ readonly cid: string;
834
+ readonly host: string;
835
+ readonly ownerAddress: string;
836
+ readonly chainId: number;
837
+ }
831
838
  /**
832
839
  * CID-bind and activate one compact runtime delegation.
833
840
  *
@@ -839,6 +846,12 @@ interface ValidatedRuntimeDelegation {
839
846
  declare function activateValidatedRuntimeDelegation(node: RuntimeDelegationActivator, delegation: PortableDelegation, options: {
840
847
  host: string;
841
848
  }): Promise<ValidatedRuntimeDelegation>;
849
+ /**
850
+ * Import compact UCAN bytes returned by an authority ceremony through the
851
+ * ordinary runtime-delegation activation path. All transport projections are
852
+ * derived from signed bytes before `/delegate` is called.
853
+ */
854
+ declare function activateCompactRuntimeDelegation(node: RuntimeDelegationActivator, input: CompactRuntimeDelegationInput): Promise<ValidatedRuntimeDelegation>;
842
855
  /**
843
856
  * Turn a delegation REQUEST into a signed GRANT.
844
857
  *
@@ -1020,6 +1033,32 @@ type SecretReadResult = {
1020
1033
  status: "invalid_payload";
1021
1034
  };
1022
1035
  type CreateOwnerDelegationParams = CreateOwnerDelegationParams$1;
1036
+ interface UnifiedOwnerRootInput {
1037
+ readonly ownerDid: string;
1038
+ readonly role: "policy-authority" | "policy-enforcement";
1039
+ readonly audienceDid: string;
1040
+ readonly policyId: string;
1041
+ readonly policyDigestHex: string;
1042
+ readonly policyCid: string;
1043
+ readonly contentSourceDigestHex: string;
1044
+ readonly capabilityCeilingHashHex: string;
1045
+ readonly nativeProjectionHashHex: string;
1046
+ readonly notBefore: Date;
1047
+ readonly expiresAt: Date;
1048
+ readonly nodeAudience: string;
1049
+ readonly capabilities: readonly UnifiedPolicyCapability[];
1050
+ }
1051
+ interface UnifiedOwnerRootReceipt {
1052
+ readonly cid: string;
1053
+ readonly delegationHeader: {
1054
+ readonly Authorization: string;
1055
+ };
1056
+ readonly delegateDID: string;
1057
+ readonly spaceId: string;
1058
+ readonly path: string;
1059
+ readonly actions: readonly string[];
1060
+ readonly expiry: Date;
1061
+ }
1023
1062
  interface OwnerDelegationReceipt extends OwnerDelegationReceipt$1 {
1024
1063
  readonly delegation: Delegation;
1025
1064
  readonly nodeReceipt: {
@@ -1251,6 +1290,9 @@ declare class TinyCloudNode {
1251
1290
  * hosting is confirmed against the session that was active at the time.
1252
1291
  */
1253
1292
  private readonly confirmedHostedSpaceIds;
1293
+ /** Serializes account-registry writes for the active node instance. */
1294
+ private accountRegistryTail;
1295
+ private pendingAccountRegistrySync?;
1254
1296
  /**
1255
1297
  * TinyCloudSession captured by {@link restoreSession} when there's no
1256
1298
  * auth-layer signer available (session-only mode used by OpenKey-backed
@@ -1457,6 +1499,7 @@ declare class TinyCloudNode {
1457
1499
  private registerPrimarySessionGrant;
1458
1500
  private writeManifestRegistryRecords;
1459
1501
  private scheduleAccountRegistrySync;
1502
+ private enqueueAccountRegistryOperation;
1460
1503
  /**
1461
1504
  * Whether the current primary session may invoke `tinycloud.space/list`.
1462
1505
  *
@@ -1648,6 +1691,8 @@ declare class TinyCloudNode {
1648
1691
  invokeAny(entries: Parameters<InvokeAnyFunction$1>[1], facts?: Parameters<InvokeAnyFunction$1>[2]): ReturnType<InvokeAnyFunction$1>;
1649
1692
  /** Sign protocol bytes with the established in-memory session key. */
1650
1693
  signSessionBytes(bytes: Uint8Array): Promise<Uint8Array>;
1694
+ /** Author a proofless Policy/v3 owner root with the authenticated holder key. */
1695
+ createUnifiedOwnerRoot(input: UnifiedOwnerRootInput): Promise<UnifiedOwnerRootReceipt>;
1651
1696
  /** Apply only an already-enabled signing policy to the exact credential request. */
1652
1697
  autoSignCredentialBytes(bytes: Uint8Array): Promise<Uint8Array | undefined>;
1653
1698
  /** Invoke the configured interactive approval strategy before session signing. */
@@ -2445,4 +2490,4 @@ declare class WasmKeyProvider implements KeyProvider {
2445
2490
  */
2446
2491
  declare function createWasmKeyProvider(sessionManager: SessionManagerWithListing): WasmKeyProvider;
2447
2492
 
2448
- export { ACCEPTED_MARKER_VERSIONS as A, BOOTSTRAP_COMPLETION_MARKER_KEY as B, type CreateOwnerDelegationParams as C, type DelegateToOptions as D, type EnsureEncryptionNetworkOptions as E, FileSessionStorage as F, MemorySessionStorage as M, type NodeEventEmitterStrategy as N, type OwnerDelegationReceipt as O, type PortableDelegation as P, type RestorableSession as R, type SecretPermissionHint as S, TinyCloudNode as T, UnsupportedSessionRestoreError as U, type ValidatedRuntimeDelegation as V, WasmKeyProvider as W, type AuthDelegationArtifact as a, type AuthRequestArtifact as b, BOOTSTRAP_COMPLETION_MARKER_VERSION as c, type BootstrapCompletionMarker as d, type BootstrapWarning as e, type DelegateToResult as f, DelegatedAccess as g, type DelegationAuthority as h, NodeUserAuthorization as i, type NodeUserAuthorizationConfig as j, type RuntimeDelegationActivator as k, type RuntimePermissionGrantOptions as l, type SecretReadInput as m, type SecretReadResult as n, type SignStrategy as o, type TinyCloudNodeConfig as p, type WasmKeyProviderConfig as q, activateValidatedRuntimeDelegation as r, createWasmKeyProvider as s, defaultSignStrategy as t, deserializeDelegation as u, grantAuthRequest as v, serializeDelegation as w };
2493
+ export { ACCEPTED_MARKER_VERSIONS as A, BOOTSTRAP_COMPLETION_MARKER_KEY as B, type CompactRuntimeDelegationInput as C, type DelegateToOptions as D, type EnsureEncryptionNetworkOptions as E, FileSessionStorage as F, serializeDelegation as G, MemorySessionStorage as M, type NodeEventEmitterStrategy as N, type OwnerDelegationReceipt as O, type PortableDelegation as P, type RestorableSession as R, type SecretPermissionHint as S, TinyCloudNode as T, type UnifiedOwnerRootInput as U, type ValidatedRuntimeDelegation as V, WasmKeyProvider as W, type AuthDelegationArtifact as a, type AuthRequestArtifact as b, BOOTSTRAP_COMPLETION_MARKER_VERSION as c, type BootstrapCompletionMarker as d, type BootstrapWarning as e, type CreateOwnerDelegationParams as f, type DelegateToResult as g, DelegatedAccess as h, type DelegationAuthority as i, NodeUserAuthorization as j, type NodeUserAuthorizationConfig as k, type RuntimeDelegationActivator as l, type RuntimePermissionGrantOptions as m, type SecretReadInput as n, type SecretReadResult as o, type SignStrategy as p, type TinyCloudNodeConfig as q, type UnifiedOwnerRootReceipt as r, UnsupportedSessionRestoreError as s, type WasmKeyProviderConfig as t, activateCompactRuntimeDelegation as u, activateValidatedRuntimeDelegation as v, createWasmKeyProvider as w, defaultSignStrategy as x, deserializeDelegation as y, grantAuthRequest as z };
@@ -1,4 +1,4 @@
1
- import { ISessionStorage, PersistedSessionData, AutoSignStrategy, AutoRejectStrategy, CallbackStrategy, IUserAuthorization, ISigner, ISpaceCreationHandler, LocalNodeIdentityStore, IWasmBindings, ISessionManager, SiweConfig, Manifest, ComposedManifestRequest, ClientSession, TinyCloudSession, Extension, SignRequest, SignInOptions, CapabilityPresentationEnvelopeV1, Delegation, DelegatedResource, PermissionEntry, TelemetryConfig, IKVService, ISQLService, IDuckDbService, IHooksService, CreateOwnerDelegationParams as CreateOwnerDelegationParams$1, OwnerDelegationReceipt as OwnerDelegationReceipt$1, INotificationHandler, IENSResolver, AccountService, InvokeAnyFunction as InvokeAnyFunction$1, RegisterOwnerSharePolicyParams, OwnerSharePolicyRegistrationReceipt, ShareDeliveryAuthorizationReceipt, IDataVaultService, IEncryptionService, NetworkDescriptor, ISecretsService, ICapabilityKeyRegistry, DelegationManager, ISpaceService, ISpace, ISharingService, CreateDelegationParams, DelegationResult, DelegationRevocationReceipt, DelegationStatus, ResolvedDelegate, KeyProvider, JWK } from '@tinycloud/sdk-core';
1
+ import { ISessionStorage, PersistedSessionData, AutoSignStrategy, AutoRejectStrategy, CallbackStrategy, IUserAuthorization, ISigner, ISpaceCreationHandler, LocalNodeIdentityStore, IWasmBindings, ISessionManager, SiweConfig, Manifest, ComposedManifestRequest, ClientSession, TinyCloudSession, Extension, SignRequest, SignInOptions, CapabilityPresentationEnvelopeV1, Delegation, DelegatedResource, PermissionEntry, TelemetryConfig, IKVService, ISQLService, IDuckDbService, IHooksService, CreateOwnerDelegationParams as CreateOwnerDelegationParams$1, OwnerDelegationReceipt as OwnerDelegationReceipt$1, INotificationHandler, IENSResolver, AccountService, InvokeAnyFunction as InvokeAnyFunction$1, UnifiedPolicyCapability, RegisterOwnerSharePolicyParams, OwnerSharePolicyRegistrationReceipt, ShareDeliveryAuthorizationReceipt, IDataVaultService, IEncryptionService, NetworkDescriptor, ISecretsService, ICapabilityKeyRegistry, DelegationManager, ISpaceService, ISpace, ISharingService, CreateDelegationParams, DelegationResult, DelegationRevocationReceipt, DelegationStatus, ResolvedDelegate, KeyProvider, JWK } from '@tinycloud/sdk-core';
2
2
  import { EventEmitter } from 'events';
3
3
  import { InvokeFunction, InvokeAnyFunction } from '@tinycloud/sdk-services';
4
4
 
@@ -828,6 +828,13 @@ interface ValidatedRuntimeDelegation {
828
828
  /** Host selected for, and used by, the runtime activation. */
829
829
  readonly host: string;
830
830
  }
831
+ interface CompactRuntimeDelegationInput {
832
+ readonly authorization: string;
833
+ readonly cid: string;
834
+ readonly host: string;
835
+ readonly ownerAddress: string;
836
+ readonly chainId: number;
837
+ }
831
838
  /**
832
839
  * CID-bind and activate one compact runtime delegation.
833
840
  *
@@ -839,6 +846,12 @@ interface ValidatedRuntimeDelegation {
839
846
  declare function activateValidatedRuntimeDelegation(node: RuntimeDelegationActivator, delegation: PortableDelegation, options: {
840
847
  host: string;
841
848
  }): Promise<ValidatedRuntimeDelegation>;
849
+ /**
850
+ * Import compact UCAN bytes returned by an authority ceremony through the
851
+ * ordinary runtime-delegation activation path. All transport projections are
852
+ * derived from signed bytes before `/delegate` is called.
853
+ */
854
+ declare function activateCompactRuntimeDelegation(node: RuntimeDelegationActivator, input: CompactRuntimeDelegationInput): Promise<ValidatedRuntimeDelegation>;
842
855
  /**
843
856
  * Turn a delegation REQUEST into a signed GRANT.
844
857
  *
@@ -1020,6 +1033,32 @@ type SecretReadResult = {
1020
1033
  status: "invalid_payload";
1021
1034
  };
1022
1035
  type CreateOwnerDelegationParams = CreateOwnerDelegationParams$1;
1036
+ interface UnifiedOwnerRootInput {
1037
+ readonly ownerDid: string;
1038
+ readonly role: "policy-authority" | "policy-enforcement";
1039
+ readonly audienceDid: string;
1040
+ readonly policyId: string;
1041
+ readonly policyDigestHex: string;
1042
+ readonly policyCid: string;
1043
+ readonly contentSourceDigestHex: string;
1044
+ readonly capabilityCeilingHashHex: string;
1045
+ readonly nativeProjectionHashHex: string;
1046
+ readonly notBefore: Date;
1047
+ readonly expiresAt: Date;
1048
+ readonly nodeAudience: string;
1049
+ readonly capabilities: readonly UnifiedPolicyCapability[];
1050
+ }
1051
+ interface UnifiedOwnerRootReceipt {
1052
+ readonly cid: string;
1053
+ readonly delegationHeader: {
1054
+ readonly Authorization: string;
1055
+ };
1056
+ readonly delegateDID: string;
1057
+ readonly spaceId: string;
1058
+ readonly path: string;
1059
+ readonly actions: readonly string[];
1060
+ readonly expiry: Date;
1061
+ }
1023
1062
  interface OwnerDelegationReceipt extends OwnerDelegationReceipt$1 {
1024
1063
  readonly delegation: Delegation;
1025
1064
  readonly nodeReceipt: {
@@ -1251,6 +1290,9 @@ declare class TinyCloudNode {
1251
1290
  * hosting is confirmed against the session that was active at the time.
1252
1291
  */
1253
1292
  private readonly confirmedHostedSpaceIds;
1293
+ /** Serializes account-registry writes for the active node instance. */
1294
+ private accountRegistryTail;
1295
+ private pendingAccountRegistrySync?;
1254
1296
  /**
1255
1297
  * TinyCloudSession captured by {@link restoreSession} when there's no
1256
1298
  * auth-layer signer available (session-only mode used by OpenKey-backed
@@ -1457,6 +1499,7 @@ declare class TinyCloudNode {
1457
1499
  private registerPrimarySessionGrant;
1458
1500
  private writeManifestRegistryRecords;
1459
1501
  private scheduleAccountRegistrySync;
1502
+ private enqueueAccountRegistryOperation;
1460
1503
  /**
1461
1504
  * Whether the current primary session may invoke `tinycloud.space/list`.
1462
1505
  *
@@ -1648,6 +1691,8 @@ declare class TinyCloudNode {
1648
1691
  invokeAny(entries: Parameters<InvokeAnyFunction$1>[1], facts?: Parameters<InvokeAnyFunction$1>[2]): ReturnType<InvokeAnyFunction$1>;
1649
1692
  /** Sign protocol bytes with the established in-memory session key. */
1650
1693
  signSessionBytes(bytes: Uint8Array): Promise<Uint8Array>;
1694
+ /** Author a proofless Policy/v3 owner root with the authenticated holder key. */
1695
+ createUnifiedOwnerRoot(input: UnifiedOwnerRootInput): Promise<UnifiedOwnerRootReceipt>;
1651
1696
  /** Apply only an already-enabled signing policy to the exact credential request. */
1652
1697
  autoSignCredentialBytes(bytes: Uint8Array): Promise<Uint8Array | undefined>;
1653
1698
  /** Invoke the configured interactive approval strategy before session signing. */
@@ -2445,4 +2490,4 @@ declare class WasmKeyProvider implements KeyProvider {
2445
2490
  */
2446
2491
  declare function createWasmKeyProvider(sessionManager: SessionManagerWithListing): WasmKeyProvider;
2447
2492
 
2448
- export { ACCEPTED_MARKER_VERSIONS as A, BOOTSTRAP_COMPLETION_MARKER_KEY as B, type CreateOwnerDelegationParams as C, type DelegateToOptions as D, type EnsureEncryptionNetworkOptions as E, FileSessionStorage as F, MemorySessionStorage as M, type NodeEventEmitterStrategy as N, type OwnerDelegationReceipt as O, type PortableDelegation as P, type RestorableSession as R, type SecretPermissionHint as S, TinyCloudNode as T, UnsupportedSessionRestoreError as U, type ValidatedRuntimeDelegation as V, WasmKeyProvider as W, type AuthDelegationArtifact as a, type AuthRequestArtifact as b, BOOTSTRAP_COMPLETION_MARKER_VERSION as c, type BootstrapCompletionMarker as d, type BootstrapWarning as e, type DelegateToResult as f, DelegatedAccess as g, type DelegationAuthority as h, NodeUserAuthorization as i, type NodeUserAuthorizationConfig as j, type RuntimeDelegationActivator as k, type RuntimePermissionGrantOptions as l, type SecretReadInput as m, type SecretReadResult as n, type SignStrategy as o, type TinyCloudNodeConfig as p, type WasmKeyProviderConfig as q, activateValidatedRuntimeDelegation as r, createWasmKeyProvider as s, defaultSignStrategy as t, deserializeDelegation as u, grantAuthRequest as v, serializeDelegation as w };
2493
+ export { ACCEPTED_MARKER_VERSIONS as A, BOOTSTRAP_COMPLETION_MARKER_KEY as B, type CompactRuntimeDelegationInput as C, type DelegateToOptions as D, type EnsureEncryptionNetworkOptions as E, FileSessionStorage as F, serializeDelegation as G, MemorySessionStorage as M, type NodeEventEmitterStrategy as N, type OwnerDelegationReceipt as O, type PortableDelegation as P, type RestorableSession as R, type SecretPermissionHint as S, TinyCloudNode as T, type UnifiedOwnerRootInput as U, type ValidatedRuntimeDelegation as V, WasmKeyProvider as W, type AuthDelegationArtifact as a, type AuthRequestArtifact as b, BOOTSTRAP_COMPLETION_MARKER_VERSION as c, type BootstrapCompletionMarker as d, type BootstrapWarning as e, type CreateOwnerDelegationParams as f, type DelegateToResult as g, DelegatedAccess as h, type DelegationAuthority as i, NodeUserAuthorization as j, type NodeUserAuthorizationConfig as k, type RuntimeDelegationActivator as l, type RuntimePermissionGrantOptions as m, type SecretReadInput as n, type SecretReadResult as o, type SignStrategy as p, type TinyCloudNodeConfig as q, type UnifiedOwnerRootReceipt as r, UnsupportedSessionRestoreError as s, type WasmKeyProviderConfig as t, activateCompactRuntimeDelegation as u, activateValidatedRuntimeDelegation as v, createWasmKeyProvider as w, defaultSignStrategy as x, deserializeDelegation as y, grantAuthRequest as z };