@tinycloud/sdk-core 2.7.0-beta.2 → 2.7.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { z } from 'zod';
2
2
  import { InvokeFunction, InvokeAnyFunction, ParsedNetworkId, ServiceError, Result as Result$1, ServiceSession, FetchFunction, ServiceConstructor, RetryPolicy, TelemetryConfig, IServiceContext, IService, IKVService, ISQLService, IDuckDbService, IHooksService, IDataVaultService, IEncryptionService, ISecretsService, IDatabaseHandle, SqlValue, QueryResponse } from '@tinycloud/sdk-services';
3
- export { BatchOptions, BatchResponse, BuildCanonicalDecryptRequestInput, BuildDecryptFactsInput, BuildDecryptInvocationInput, BuiltDecryptInvocation, CanonicalDecryptRequest, CanonicalJson, ColumnInfo, DECRYPT_ACTION, DECRYPT_FACT_TYPE, DECRYPT_RESULT_TYPE, DEFAULT_ENCRYPTION_ALG, DEFAULT_KEY_VERSION, DataVaultConfig, DataVaultService, DatabaseHandle, DecryptCapabilityProof, DecryptEnvelopeOptions, DecryptInvocationFact, DecryptInvocationSigner, DecryptRequestBody, DecryptResponseBody, DecryptTransport, DiscoverNetworkInput, DiscoveredNetwork, DiscoverySource, DuckDbAction, DuckDbActionType, DuckDbBatchOptions, DuckDbBatchResponse, DuckDbDatabaseHandle, DuckDbExecuteOptions, DuckDbExecuteResponse, DuckDbOptions, DuckDbQueryOptions, DuckDbQueryResponse, DuckDbService, DuckDbServiceConfig, DuckDbStatement, DuckDbValue, ENCRYPTION_NETWORK_URN_PREFIX, ENCRYPTION_SERVICE, ENCRYPTION_SERVICE_SHORT, ENVELOPE_VERSION, EncryptToNetworkInput, EncryptToNetworkOptions, EncryptToNetworkResult, EncryptionCrypto, EncryptionError, EncryptionErrorInput, EncryptionService, EncryptionServiceConfig, ErrorCode, ErrorCodes, ExecuteOptions, ExecuteResponse, FetchFunction, HookEvent, HookServiceName, HookStreamEvent, HookSubscription, HookWebhookListOptions, HookWebhookRecord, HookWebhookRegistration, HookWebhookScope, HookWebhookUnregisterOptions, HooksService, HooksServiceConfig, IDataVaultService, IDatabaseHandle, IDuckDbDatabaseHandle, IDuckDbService, IEncryptionService, IHooksService, IKVService, IPrefixedKVService, ISQLService, ISecretsService, IService, IServiceContext, InlineEncryptedEnvelope, InvokeAnyEntry, InvokeAnyFunction, InvokeFunction, KVCreateSignedReadUrlOptions, KVDeleteOptions, KVGetOptions, KVHeadOptions, KVListOptions, KVListResponse, KVPutOptions, KVResponse, KVResponseHeaders, KVService, KVServiceConfig, KVSignedReadUrlResponse, NETWORK_NAME_PATTERN, NetworkDescriptor, NetworkIdError, NodeDescriptorFetcher, ParsedNetworkId, PrefixedKVService, QueryOptions, QueryResponse, RandomReceiverKeyInput, ReceiverKeyPair, ReceiverKeySigner, ResolvedSecretPath, Result, RetryPolicy, SECRET_NAME_RE, SQLAction, SQLActionType, SQLService, SQLServiceConfig, SchemaInfo, SecretPayload, SecretScopeOptions, SecretsError, SecretsService, ServiceContext, ServiceContextConfig, ServiceError, ServiceSession, SignedReceiverKeyInput, SqlStatement, SqlValue, SubscribeOptions, TableInfo, TelemetryConfig, TelemetryEventHandler, TinyCloudDebugEnableOptions, TinyCloudDebugEvent, TinyCloudDebugLevel, TinyCloudDebugLogger, TinyCloudDebugTimer, VaultCrypto, VaultEntry, VaultError, VaultGetOptions, VaultGrantOptions, VaultHeaders, VaultListOptions, VaultPublicSpaceKVActions, VaultPutOptions, VerifyDecryptResponseInput, ViewInfo, WasmVaultFunctions, WellKnownDescriptorFetcher, buildCanonicalDecryptRequest, buildDecryptAttenuation, buildDecryptFacts, buildDecryptInvocation, buildNetworkId, canonicalHashHex, canonicalSignedResponse, canonicalizeEncryptionJson, canonicalizeSecretScope, checkDecryptInvocationInput, clearTinyCloudDebugLogs, createVaultCrypto, decryptEnvelopeWithKey, defaultRetryPolicy, deriveSignedReceiverKey, disableTinyCloudDebug, discoverNetwork, enableTinyCloudDebug, encryptToNetwork, base64Decode as encryptionBase64Decode, base64Encode as encryptionBase64Encode, encryptionError, utf8Decode as encryptionUtf8Decode, utf8Encode as encryptionUtf8Encode, ensureNetworkUsableForDecrypt, err, generateRandomReceiverKey, getTinyCloudDebugLogs, hexDecode, hexEncode, installTinyCloudDebugGlobals, isNetworkId, networkDiscoveryKey, ok, openWrappedKey, parseNetworkId, resolveSecretListPrefix, resolveSecretPath, serviceError, tinyCloudDebugLogger, validateEnvelope, verifyDecryptResponse } from '@tinycloud/sdk-services';
3
+ export { BatchOptions, BatchResponse, BuildCanonicalDecryptRequestInput, BuildDecryptFactsInput, BuildDecryptInvocationInput, BuiltDecryptInvocation, CanonicalDecryptRequest, CanonicalJson, ColumnInfo, DECRYPT_ACTION, DECRYPT_FACT_TYPE, DECRYPT_RESULT_TYPE, DEFAULT_ENCRYPTION_ALG, DEFAULT_KEY_VERSION, DataVaultConfig, DataVaultService, DatabaseHandle, DecryptCapabilityProof, DecryptEnvelopeOptions, DecryptInvocationFact, DecryptInvocationSigner, DecryptRequestBody, DecryptResponseBody, DecryptTransport, DecryptTransportResponseError, DiscoverNetworkInput, DiscoveredNetwork, DiscoverySource, DuckDbAction, DuckDbActionType, DuckDbBatchOptions, DuckDbBatchResponse, DuckDbDatabaseHandle, DuckDbExecuteOptions, DuckDbExecuteResponse, DuckDbOptions, DuckDbQueryOptions, DuckDbQueryResponse, DuckDbService, DuckDbServiceConfig, DuckDbStatement, DuckDbValue, ENCRYPTION_NETWORK_URN_PREFIX, ENCRYPTION_SERVICE, ENCRYPTION_SERVICE_SHORT, ENVELOPE_VERSION, EncryptToNetworkInput, EncryptToNetworkOptions, EncryptToNetworkResult, EncryptionCrypto, EncryptionError, EncryptionErrorInput, EncryptionService, EncryptionServiceConfig, ErrorCode, ErrorCodes, ExecuteOptions, ExecuteResponse, FetchFunction, HookEvent, HookServiceName, HookStreamEvent, HookSubscription, HookWebhookListOptions, HookWebhookRecord, HookWebhookRegistration, HookWebhookScope, HookWebhookUnregisterOptions, HooksService, HooksServiceConfig, IDataVaultService, IDatabaseHandle, IDuckDbDatabaseHandle, IDuckDbService, IEncryptionService, IHooksService, IKVService, IPrefixedKVService, ISQLService, ISecretsService, IService, IServiceContext, InlineEncryptedEnvelope, InvokeAnyEntry, InvokeAnyFunction, InvokeFunction, KVCreateSignedReadUrlOptions, KVDeleteOptions, KVGetOptions, KVHeadOptions, KVListOptions, KVListResponse, KVPutOptions, KVResponse, KVResponseHeaders, KVService, KVServiceConfig, KVSignedReadUrlResponse, NETWORK_NAME_PATTERN, NetworkDescriptor, NetworkIdError, NodeDescriptorFetcher, ParsedNetworkId, PrefixedKVService, QueryOptions, QueryResponse, RandomReceiverKeyInput, ReceiverKeyPair, ReceiverKeySigner, ResolvedSecretPath, Result, RetryPolicy, SECRET_NAME_RE, SQLAction, SQLActionType, SQLService, SQLServiceConfig, SchemaInfo, SecretPayload, SecretScopeOptions, SecretsError, SecretsService, ServiceContext, ServiceContextConfig, ServiceError, ServiceSession, SignedReceiverKeyInput, SqlStatement, SqlValue, SubscribeOptions, TableInfo, TelemetryConfig, TelemetryEventHandler, TinyCloudDebugEnableOptions, TinyCloudDebugEvent, TinyCloudDebugLevel, TinyCloudDebugLogger, TinyCloudDebugTimer, VaultCrypto, VaultEntry, VaultError, VaultGetOptions, VaultGrantOptions, VaultHeaders, VaultListOptions, VaultNetworkReadResult, VaultPublicSpaceKVActions, VaultPutOptions, VerifyDecryptResponseInput, ViewInfo, WasmVaultFunctions, WellKnownDescriptorFetcher, buildCanonicalDecryptRequest, buildDecryptAttenuation, buildDecryptFacts, buildDecryptInvocation, buildNetworkId, canonicalHashHex, canonicalSignedResponse, canonicalizeEncryptionJson, canonicalizeSecretScope, checkDecryptInvocationInput, clearTinyCloudDebugLogs, createVaultCrypto, decryptEnvelopeWithKey, defaultRetryPolicy, deriveSignedReceiverKey, disableTinyCloudDebug, discoverNetwork, enableTinyCloudDebug, encryptToNetwork, base64Decode as encryptionBase64Decode, base64Encode as encryptionBase64Encode, encryptionError, utf8Decode as encryptionUtf8Decode, utf8Encode as encryptionUtf8Encode, ensureNetworkUsableForDecrypt, err, generateRandomReceiverKey, getTinyCloudDebugLogs, hexDecode, hexEncode, installTinyCloudDebugGlobals, isNetworkId, networkDiscoveryKey, ok, openWrappedKey, parseNetworkId, resolveSecretListPrefix, resolveSecretPath, serviceError, tinyCloudDebugLogger, validateEnvelope, verifyDecryptResponse } from '@tinycloud/sdk-services';
4
4
  export { HOLDER_KEY_BINDING_PRESENTATION_SCHEMA, HolderKeyBindingPresentation, LISTEN_SQL_STATEMENT_CATALOG, ListenSqlStatementName, POLICY_ENGINE_CHALLENGE_REQUEST_SCHEMA, POLICY_ENGINE_CHALLENGE_RESPONSE_SCHEMA, POLICY_ENGINE_DENIAL_SCHEMA, POLICY_ENGINE_GRANT_PRESENTATION_DENIAL_CODES, POLICY_ENGINE_RESOLVE_REQUEST_SCHEMA, PORTABLE_DELEGATION_SCHEMA, PolicyEngineGrantPresentationDenialCode, PortableDelegation, REQUESTER_ENGINE_RETRY_ATTEMPTS, REQUESTER_ENGINE_RETRY_MAX_DELAY_MS, REQUESTER_NEAR_EXPIRY_SECONDS, RequesterEndpointResolution, RequesterHttpRequest, RequesterHttpResponse, RequesterInvocationCapability, RequesterSigningCapability, RequesterTransport, TranscriptRequester, TranscriptRequesterError, TranscriptRequesterErrorCode, TranscriptRequesterErrorState, TranscriptRequesterOptions, TranscriptRequesterReadKvResult, TranscriptRequesterReadSqlResult, createTranscriptRequester, deriveDelegationCid, parseNodeNativePortableDelegation } from './requester/index.js';
5
5
  export { ACCOUNT_INDEX_SCHEMA, BOOTSTRAP_ALLOWLIST, BOOTSTRAP_DEFAULT_SPACE, BOOTSTRAP_ENCRYPTION_NETWORK_NAME, BOOTSTRAP_ENCRYPTION_NETWORK_RESOURCE_TEMPLATE, BOOTSTRAP_MANIFEST, BOOTSTRAP_PERSISTED_APPLICATION_MANIFESTS, BOOTSTRAP_PUBLIC_SPACE, BOOTSTRAP_SESSION_REQUESTS, BOOTSTRAP_SPACE_MANIFESTS, BOOTSTRAP_SPACE_NAMES, BootstrapAllowlistEntry, BootstrapAllowlistKind, BootstrapEncryptionNetworkStep, BootstrapManifest, BootstrapRawAbilityAllowlistEntry, BootstrapSchemaStep, BootstrapSeedApplicationsStep, BootstrapSeedSpacesStep, BootstrapSpaceDescriptor, BootstrapSpaceName, BootstrapSpaceStep, BootstrapStep, BootstrapStepKind, CAPABILITIES, CAPABILITY_REGISTRY, CapabilityRegistryEntry, CapabilityStatus, DUCKDB, ENCRYPTION, HOOKS, KV, SECRET_RECORDS_SCHEMA, SPACE, SQL, TINYCLOUD_ACCOUNT_SPACE_MANIFEST, TINYCLOUD_APPLICATIONS_SPACE_MANIFEST, TINYCLOUD_DEFAULT_SPACE_MANIFEST, TINYCLOUD_PUBLIC_SPACE_MANIFEST, TINYCLOUD_SECRETS_BOOTSTRAP_MANIFEST, bootstrapEncryptionNetworkId, bootstrapSpaceId, bootstrapSteps, composeBootstrapSpaceManifest } from '@tinycloud/bootstrap';
6
- export { E as ED25519_JCS_SIGNATURE_SUITE, b as EIP191_JCS_SIGNATURE_SUITE, J as JsonObject, c as POLICY_ENGINE_RECORD_SCHEMA, d as POLICY_SCHEMA, e as POLICY_STATUS_SCHEMA, a as Policy, P as PolicyEngineRecord, f as PolicyStatus, g as SignatureMaterialError, h as SignatureSuite, i as SignatureVerificationError, j as SignedObjectCanonicalizationError, k as SignedObjectDigestError, l as SignedObjectErrorCode, m as SignedObjectIdError, n as SignedObjectKind, o as SignedObjectMaterial, p as SignedObjectProfileError, q as SignedObjectSchemaError, r as SignedObjectSignature, S as SignedObjectSigner, s as SignedObjectVerificationResult, t as SignedPolicyObject, u as SigningKeyBindingError, v as UnsignedPolicy, U as UnsignedPolicyEngineRecord, w as UnsignedPolicyObject, x as UnsignedPolicyStatus, y as UnsupportedSignatureSuiteError, z as canonicalizeSignedObjectUnsigned, A as createAndSignPolicy, B as createAndSignPolicyEngineRecord, C as createAndSignPolicyStatus, D as createAndSignSignedObject, F as deriveSignedObjectMaterial, G as signedObjectIdFor, H as toSignedObjectError, I as validatePolicyEngineRecordSigned, K as validatePolicyEngineRecordSignedShape, L as validatePolicyEngineRecordUnsigned, M as validatePolicySigned, N as validatePolicySignedShape, O as validatePolicyStatusSigned, Q as validatePolicyStatusSignedShape, R as validatePolicyStatusUnsigned, T as validatePolicyUnsigned, V as verifyPolicy, W as verifyPolicyEngineRecord, X as verifyPolicyStatus, Y as verifySignedObject } from './signed-object-C9Gur3ZY.js';
7
- export { a as JsonValue, j as jcsCanonicalize, n as normalizeJson, s as serializeJcsJson } from './capability-Dbx-xqUh.js';
6
+ export { E as ED25519_JCS_SIGNATURE_SUITE, b as EIP191_JCS_SIGNATURE_SUITE, J as JsonObject, c as POLICY_ENGINE_RECORD_SCHEMA, d as POLICY_SCHEMA, e as POLICY_STATUS_SCHEMA, a as Policy, P as PolicyEngineRecord, f as PolicyStatus, g as SignatureMaterialError, h as SignatureSuite, i as SignatureVerificationError, j as SignedObjectCanonicalizationError, k as SignedObjectDigestError, l as SignedObjectErrorCode, m as SignedObjectIdError, n as SignedObjectKind, o as SignedObjectMaterial, p as SignedObjectProfileError, q as SignedObjectSchemaError, r as SignedObjectSignature, S as SignedObjectSigner, s as SignedObjectVerificationResult, t as SignedPolicyObject, u as SigningKeyBindingError, v as UnsignedPolicy, U as UnsignedPolicyEngineRecord, w as UnsignedPolicyObject, x as UnsignedPolicyStatus, y as UnsupportedSignatureSuiteError, z as canonicalizeSignedObjectUnsigned, A as createAndSignPolicy, B as createAndSignPolicyEngineRecord, C as createAndSignPolicyStatus, D as createAndSignSignedObject, F as deriveSignedObjectMaterial, G as signedObjectIdFor, H as toSignedObjectError, I as validatePolicyEngineRecordSigned, K as validatePolicyEngineRecordSignedShape, L as validatePolicyEngineRecordUnsigned, M as validatePolicySigned, N as validatePolicySignedShape, O as validatePolicyStatusSigned, Q as validatePolicyStatusSignedShape, R as validatePolicyStatusUnsigned, T as validatePolicyUnsigned, V as verifyPolicy, W as verifyPolicyEngineRecord, X as verifyPolicyStatus, Y as verifySignedObject } from './signed-object-C6mWbTbB.js';
7
+ export { a as JsonValue, j as jcsCanonicalize, n as normalizeJson, s as serializeJcsJson } from './capability-BjzXwtNw.js';
8
8
  export { SiweMessage } from 'siwe';
9
9
 
10
10
  /**
@@ -227,6 +227,8 @@ interface PermissionEntry {
227
227
  * Already-expanded URNs are passed through unchanged.
228
228
  */
229
229
  actions: string[];
230
+ /** Exact ReCap caveat branches when this authority came from a signed ReCap. */
231
+ caveats?: Record<string, unknown>[];
230
232
  /** When true, the manifest prefix is NOT prepended to `path`. Default false. */
231
233
  skipPrefix?: boolean;
232
234
  /** Per-entry expiry override, ms-format. */
@@ -646,6 +648,17 @@ declare class SessionExpiredError extends Error {
646
648
  readonly expiredAt: Date;
647
649
  constructor(expiredAt: Date);
648
650
  }
651
+ /**
652
+ * Thrown when the installed WASM delegation boundary cannot encode every
653
+ * constrained ReCap branch in a requested child delegation.
654
+ */
655
+ declare class CaveatedDelegationUnsupportedError extends Error {
656
+ /** Stable machine-readable error code for fail-closed caveated delegation. */
657
+ code: "CAVEATED_DELEGATION_UNSUPPORTED";
658
+ /** Requested entries whose constrained ReCap branches cannot be preserved. */
659
+ entries: PermissionEntry[];
660
+ constructor(entries: PermissionEntry[]);
661
+ }
649
662
  interface SubsetCheckResult {
650
663
  /** True when every requested entry is covered by a granted entry. */
651
664
  subset: boolean;
@@ -673,6 +686,23 @@ interface SubsetCheckResult {
673
686
  * or `expandActionShortNames` to normalize inputs first.
674
687
  */
675
688
  declare function isCapabilitySubset(requested: readonly PermissionEntry[], granted: readonly PermissionEntry[]): SubsetCheckResult;
689
+ /**
690
+ * Compare ReCap caveat branch sets without losing signed branch structure.
691
+ *
692
+ * ReCap represents an unconstrained ability as `[{}]`, while SDK callers can
693
+ * represent that same authority as `undefined` or `[]`. Those three forms are
694
+ * equivalent. Every other branch, including an unconstrained branch mixed
695
+ * with a constrained one, remains part of the canonical comparison.
696
+ */
697
+ declare function recapCaveatsEqual(left: readonly Record<string, unknown>[] | undefined, right: readonly Record<string, unknown>[] | undefined): boolean;
698
+ /**
699
+ * Canonicalize a ReCap caveat branch set for exact equality checks.
700
+ *
701
+ * Object keys and branch order do not affect equality. A lone unconstrained
702
+ * branch is normalized to the SDK's empty-caveat representation, but an
703
+ * unconstrained branch in a mixed set is deliberately retained.
704
+ */
705
+ declare function canonicalizeRecapCaveats(caveats: readonly Record<string, unknown>[] | undefined): string;
676
706
  /** Return whether a granted action pattern covers one requested action. */
677
707
  declare function actionContains(grantedAction: string, requestedAction: string): boolean;
678
708
  /**
@@ -688,6 +718,8 @@ interface WasmRecapEntry {
688
718
  space: string;
689
719
  path: string;
690
720
  actions: string[];
721
+ /** Exact ReCap caveats shared by every action in this entry. */
722
+ caveats?: Record<string, unknown>[];
691
723
  }
692
724
  /**
693
725
  * Signature of the WASM `parseRecapFromSiwe` export. Accepts the signed
@@ -724,6 +756,42 @@ declare function parseRecapCapabilities(parseWasm: ParseRecapFromSiwe, siwe: str
724
756
  * @packageDocumentation
725
757
  */
726
758
 
759
+ /**
760
+ * The persisted authority material that must be verified as one unit before a
761
+ * restored session can use its ReCap or lifetime locally.
762
+ */
763
+ interface PersistedSessionProof {
764
+ delegationHeader: {
765
+ Authorization: string;
766
+ };
767
+ delegationCid: string;
768
+ spaceId: string;
769
+ /** @deprecated Ignored by validation; capabilities come from the signed ReCap. */
770
+ spaces?: Record<string, string>;
771
+ jwk: object;
772
+ /** @deprecated Ignored by validation; the verification method is derived from `jwk`. */
773
+ verificationMethod?: string;
774
+ address: string;
775
+ chainId: number;
776
+ siwe: string;
777
+ signature: string;
778
+ }
779
+ /** Canonical facts produced by the WASM-side persisted-session verifier. */
780
+ interface ValidatedPersistedSessionProof {
781
+ /** The SIWE expiration exactly as signed, when the SIWE contains one. */
782
+ expiresAt?: string;
783
+ /** @deprecated Legacy caveat-free witness; restore does not trust it. */
784
+ recap?: WasmRecapEntry[];
785
+ /**
786
+ * Exact, caveat-preserving ReCap reconstruction from a verifier that
787
+ * implements persisted-session validation v2. This remains optional so a
788
+ * pre-existing custom binding stays source-compatible, but restore rejects
789
+ * authenticated authority unless this witness is available.
790
+ */
791
+ verifiedRecap?: Array<WasmRecapEntry & {
792
+ caveats: Record<string, unknown>[];
793
+ }>;
794
+ }
727
795
  /**
728
796
  * Platform-agnostic WASM bindings interface.
729
797
  *
@@ -757,6 +825,13 @@ interface IWasmBindings {
757
825
  * Returns an empty array when the SIWE has no recap resource.
758
826
  */
759
827
  parseRecapFromSiwe: (siweString: string) => WasmRecapEntry[];
828
+ /**
829
+ * Optional verifier-v2 parser that preserves ReCap caveats. Kept optional
830
+ * so existing custom bindings remain source-compatible.
831
+ */
832
+ parseVerifiedRecapFromSiwe?: (siweString: string) => Array<WasmRecapEntry & {
833
+ caveats: Record<string, unknown>[];
834
+ }>;
760
835
  /** Generate a host SIWE message for space activation */
761
836
  generateHostSIWEMessage: (params: any) => string;
762
837
  /** Convert a signed SIWE message to delegation headers */
@@ -775,6 +850,13 @@ interface IWasmBindings {
775
850
  vault_sha256: (data: Uint8Array) => Uint8Array;
776
851
  /** Factory for session managers */
777
852
  createSessionManager: () => ISessionManager;
853
+ /**
854
+ * Verify a persisted EIP-191 SIWE proof and bind it to its reconstructed
855
+ * Cacao header/CID, session DID, address, chain and ReCap spaces. Optional
856
+ * so pre-existing custom bindings remain type-compatible; restore rejects
857
+ * authenticated persisted data when the primitive is unavailable.
858
+ */
859
+ validatePersistedSession?: (proof: PersistedSessionProof) => ValidatedPersistedSessionProof;
778
860
  /** Ensure WASM module is initialized (optional — some bindings auto-init) */
779
861
  ensureInitialized?: () => Promise<void>;
780
862
  }
@@ -786,6 +868,13 @@ interface IWasmBindings {
786
868
  interface ISessionManager {
787
869
  /** Create a new session key with the given ID, returns the DID */
788
870
  createSessionKey(id: string): string;
871
+ /**
872
+ * Optional for custom bindings built before persisted-key restore.
873
+ * `restoreSession` detects support at runtime.
874
+ */
875
+ replaceSessionKey?(jwk: object, keyId: string): string;
876
+ /** List every live key so a primary-key replacement cannot discard shares. */
877
+ listSessionKeys?(): string[];
789
878
  /** Rename a session key ID */
790
879
  renameSessionKeyId(oldId: string, newId: string): void;
791
880
  /** Get the DID for a session key */
@@ -1422,6 +1511,8 @@ declare const DelegationSchema: z.ZodObject<{
1422
1511
  path: z.ZodString;
1423
1512
  /** Actions this delegation authorizes */
1424
1513
  actions: z.ZodArray<z.ZodString, "many">;
1514
+ /** Exact ReCap caveats that constrain every action in this scope. */
1515
+ caveats: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
1425
1516
  /** When this delegation expires (accepts Date or ISO string from JSON) */
1426
1517
  expiry: z.ZodDate;
1427
1518
  /** Whether this delegation has been revoked */
@@ -1444,6 +1535,7 @@ declare const DelegationSchema: z.ZodObject<{
1444
1535
  cid: string;
1445
1536
  delegateDID: string;
1446
1537
  isRevoked: boolean;
1538
+ caveats?: Record<string, unknown>[] | undefined;
1447
1539
  createdAt?: Date | undefined;
1448
1540
  delegatorDID?: string | undefined;
1449
1541
  parentCid?: string | undefined;
@@ -1457,6 +1549,7 @@ declare const DelegationSchema: z.ZodObject<{
1457
1549
  cid: string;
1458
1550
  delegateDID: string;
1459
1551
  isRevoked: boolean;
1552
+ caveats?: Record<string, unknown>[] | undefined;
1460
1553
  createdAt?: Date | undefined;
1461
1554
  delegatorDID?: string | undefined;
1462
1555
  parentCid?: string | undefined;
@@ -1502,6 +1595,227 @@ declare const DelegationStatusSchema: z.ZodEffects<z.ZodObject<{
1502
1595
  exists: boolean;
1503
1596
  }>;
1504
1597
  type DelegationStatus = z.infer<typeof DelegationStatusSchema>;
1598
+ declare const DelegationRevocationReceiptSchema: z.ZodObject<{
1599
+ revoked: z.ZodLiteral<true>;
1600
+ cid: z.ZodString;
1601
+ }, "strict", z.ZodTypeAny, {
1602
+ revoked: true;
1603
+ cid: string;
1604
+ }, {
1605
+ revoked: true;
1606
+ cid: string;
1607
+ }>;
1608
+ type DelegationRevocationReceipt = z.infer<typeof DelegationRevocationReceiptSchema>;
1609
+ declare const AccountDelegationResourceSchema: z.ZodObject<{
1610
+ resource: z.ZodString;
1611
+ actions: z.ZodArray<z.ZodString, "many">;
1612
+ caveats: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
1613
+ }, "strict", z.ZodTypeAny, {
1614
+ actions: string[];
1615
+ caveats: Record<string, unknown>[];
1616
+ resource: string;
1617
+ }, {
1618
+ actions: string[];
1619
+ caveats: Record<string, unknown>[];
1620
+ resource: string;
1621
+ }>;
1622
+ declare const AccountDelegationRecordSchema: z.ZodObject<{
1623
+ cid: z.ZodString;
1624
+ direction: z.ZodEnum<["granted", "received"]>;
1625
+ delegatorDid: z.ZodString;
1626
+ delegateDid: z.ZodString;
1627
+ resources: z.ZodArray<z.ZodObject<{
1628
+ resource: z.ZodString;
1629
+ actions: z.ZodArray<z.ZodString, "many">;
1630
+ caveats: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
1631
+ }, "strict", z.ZodTypeAny, {
1632
+ actions: string[];
1633
+ caveats: Record<string, unknown>[];
1634
+ resource: string;
1635
+ }, {
1636
+ actions: string[];
1637
+ caveats: Record<string, unknown>[];
1638
+ resource: string;
1639
+ }>, "many">;
1640
+ parents: z.ZodArray<z.ZodString, "many">;
1641
+ issuedAt: z.ZodNullable<z.ZodEffects<z.ZodString, Date, string>>;
1642
+ notBefore: z.ZodNullable<z.ZodEffects<z.ZodString, Date, string>>;
1643
+ expiresAt: z.ZodNullable<z.ZodEffects<z.ZodString, Date, string>>;
1644
+ status: z.ZodEnum<["active", "pending", "expired", "revoked", "ancestor_revoked"]>;
1645
+ revokedAt: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodString, Date, string>>>;
1646
+ revokedBy: z.ZodOptional<z.ZodString>;
1647
+ revokedAncestorCid: z.ZodOptional<z.ZodString>;
1648
+ }, "strict", z.ZodTypeAny, {
1649
+ status: "active" | "revoked" | "expired" | "pending" | "ancestor_revoked";
1650
+ notBefore: Date | null;
1651
+ resources: {
1652
+ actions: string[];
1653
+ caveats: Record<string, unknown>[];
1654
+ resource: string;
1655
+ }[];
1656
+ expiresAt: Date | null;
1657
+ issuedAt: Date | null;
1658
+ cid: string;
1659
+ direction: "received" | "granted";
1660
+ delegatorDid: string;
1661
+ delegateDid: string;
1662
+ parents: string[];
1663
+ revokedAt?: Date | null | undefined;
1664
+ revokedBy?: string | undefined;
1665
+ revokedAncestorCid?: string | undefined;
1666
+ }, {
1667
+ status: "active" | "revoked" | "expired" | "pending" | "ancestor_revoked";
1668
+ notBefore: string | null;
1669
+ resources: {
1670
+ actions: string[];
1671
+ caveats: Record<string, unknown>[];
1672
+ resource: string;
1673
+ }[];
1674
+ expiresAt: string | null;
1675
+ issuedAt: string | null;
1676
+ cid: string;
1677
+ direction: "received" | "granted";
1678
+ delegatorDid: string;
1679
+ delegateDid: string;
1680
+ parents: string[];
1681
+ revokedAt?: string | null | undefined;
1682
+ revokedBy?: string | undefined;
1683
+ revokedAncestorCid?: string | undefined;
1684
+ }>;
1685
+ declare const AccountDelegationPageSchema: z.ZodObject<{
1686
+ schemaVersion: z.ZodLiteral<2>;
1687
+ items: z.ZodArray<z.ZodObject<{
1688
+ cid: z.ZodString;
1689
+ direction: z.ZodEnum<["granted", "received"]>;
1690
+ delegatorDid: z.ZodString;
1691
+ delegateDid: z.ZodString;
1692
+ resources: z.ZodArray<z.ZodObject<{
1693
+ resource: z.ZodString;
1694
+ actions: z.ZodArray<z.ZodString, "many">;
1695
+ caveats: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">;
1696
+ }, "strict", z.ZodTypeAny, {
1697
+ actions: string[];
1698
+ caveats: Record<string, unknown>[];
1699
+ resource: string;
1700
+ }, {
1701
+ actions: string[];
1702
+ caveats: Record<string, unknown>[];
1703
+ resource: string;
1704
+ }>, "many">;
1705
+ parents: z.ZodArray<z.ZodString, "many">;
1706
+ issuedAt: z.ZodNullable<z.ZodEffects<z.ZodString, Date, string>>;
1707
+ notBefore: z.ZodNullable<z.ZodEffects<z.ZodString, Date, string>>;
1708
+ expiresAt: z.ZodNullable<z.ZodEffects<z.ZodString, Date, string>>;
1709
+ status: z.ZodEnum<["active", "pending", "expired", "revoked", "ancestor_revoked"]>;
1710
+ revokedAt: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodString, Date, string>>>;
1711
+ revokedBy: z.ZodOptional<z.ZodString>;
1712
+ revokedAncestorCid: z.ZodOptional<z.ZodString>;
1713
+ }, "strict", z.ZodTypeAny, {
1714
+ status: "active" | "revoked" | "expired" | "pending" | "ancestor_revoked";
1715
+ notBefore: Date | null;
1716
+ resources: {
1717
+ actions: string[];
1718
+ caveats: Record<string, unknown>[];
1719
+ resource: string;
1720
+ }[];
1721
+ expiresAt: Date | null;
1722
+ issuedAt: Date | null;
1723
+ cid: string;
1724
+ direction: "received" | "granted";
1725
+ delegatorDid: string;
1726
+ delegateDid: string;
1727
+ parents: string[];
1728
+ revokedAt?: Date | null | undefined;
1729
+ revokedBy?: string | undefined;
1730
+ revokedAncestorCid?: string | undefined;
1731
+ }, {
1732
+ status: "active" | "revoked" | "expired" | "pending" | "ancestor_revoked";
1733
+ notBefore: string | null;
1734
+ resources: {
1735
+ actions: string[];
1736
+ caveats: Record<string, unknown>[];
1737
+ resource: string;
1738
+ }[];
1739
+ expiresAt: string | null;
1740
+ issuedAt: string | null;
1741
+ cid: string;
1742
+ direction: "received" | "granted";
1743
+ delegatorDid: string;
1744
+ delegateDid: string;
1745
+ parents: string[];
1746
+ revokedAt?: string | null | undefined;
1747
+ revokedBy?: string | undefined;
1748
+ revokedAncestorCid?: string | undefined;
1749
+ }>, "many">;
1750
+ nextCursor: z.ZodOptional<z.ZodString>;
1751
+ }, "strict", z.ZodTypeAny, {
1752
+ schemaVersion: 2;
1753
+ items: {
1754
+ status: "active" | "revoked" | "expired" | "pending" | "ancestor_revoked";
1755
+ notBefore: Date | null;
1756
+ resources: {
1757
+ actions: string[];
1758
+ caveats: Record<string, unknown>[];
1759
+ resource: string;
1760
+ }[];
1761
+ expiresAt: Date | null;
1762
+ issuedAt: Date | null;
1763
+ cid: string;
1764
+ direction: "received" | "granted";
1765
+ delegatorDid: string;
1766
+ delegateDid: string;
1767
+ parents: string[];
1768
+ revokedAt?: Date | null | undefined;
1769
+ revokedBy?: string | undefined;
1770
+ revokedAncestorCid?: string | undefined;
1771
+ }[];
1772
+ nextCursor?: string | undefined;
1773
+ }, {
1774
+ schemaVersion: 2;
1775
+ items: {
1776
+ status: "active" | "revoked" | "expired" | "pending" | "ancestor_revoked";
1777
+ notBefore: string | null;
1778
+ resources: {
1779
+ actions: string[];
1780
+ caveats: Record<string, unknown>[];
1781
+ resource: string;
1782
+ }[];
1783
+ expiresAt: string | null;
1784
+ issuedAt: string | null;
1785
+ cid: string;
1786
+ direction: "received" | "granted";
1787
+ delegatorDid: string;
1788
+ delegateDid: string;
1789
+ parents: string[];
1790
+ revokedAt?: string | null | undefined;
1791
+ revokedBy?: string | undefined;
1792
+ revokedAncestorCid?: string | undefined;
1793
+ }[];
1794
+ nextCursor?: string | undefined;
1795
+ }>;
1796
+ type AccountDelegationResource = z.infer<typeof AccountDelegationResourceSchema>;
1797
+ type AccountDelegationRecord = z.infer<typeof AccountDelegationRecordSchema>;
1798
+ type AccountDelegationPage = z.infer<typeof AccountDelegationPageSchema>;
1799
+ declare const AccountDelegationQueryOptionsSchema: z.ZodObject<{
1800
+ direction: z.ZodOptional<z.ZodEnum<["granted", "received", "all"]>>;
1801
+ status: z.ZodOptional<z.ZodEnum<["active", "pending", "expired", "revoked", "ancestor_revoked"]>>;
1802
+ space: z.ZodOptional<z.ZodString>;
1803
+ limit: z.ZodOptional<z.ZodNumber>;
1804
+ cursor: z.ZodOptional<z.ZodString>;
1805
+ }, "strict", z.ZodTypeAny, {
1806
+ status?: "active" | "revoked" | "expired" | "pending" | "ancestor_revoked" | undefined;
1807
+ space?: string | undefined;
1808
+ direction?: "received" | "all" | "granted" | undefined;
1809
+ limit?: number | undefined;
1810
+ cursor?: string | undefined;
1811
+ }, {
1812
+ status?: "active" | "revoked" | "expired" | "pending" | "ancestor_revoked" | undefined;
1813
+ space?: string | undefined;
1814
+ direction?: "received" | "all" | "granted" | undefined;
1815
+ limit?: number | undefined;
1816
+ cursor?: string | undefined;
1817
+ }>;
1818
+ type AccountDelegationQueryOptions = z.infer<typeof AccountDelegationQueryOptionsSchema>;
1505
1819
  /**
1506
1820
  * Entry in the capability registry mapping a capability to available keys.
1507
1821
  */
@@ -1618,6 +1932,8 @@ declare const CapabilityEntrySchema: z.ZodObject<{
1618
1932
  path: z.ZodString;
1619
1933
  /** Actions this delegation authorizes */
1620
1934
  actions: z.ZodArray<z.ZodString, "many">;
1935
+ /** Exact ReCap caveats that constrain every action in this scope. */
1936
+ caveats: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
1621
1937
  /** When this delegation expires (accepts Date or ISO string from JSON) */
1622
1938
  expiry: z.ZodDate;
1623
1939
  /** Whether this delegation has been revoked */
@@ -1640,6 +1956,7 @@ declare const CapabilityEntrySchema: z.ZodObject<{
1640
1956
  cid: string;
1641
1957
  delegateDID: string;
1642
1958
  isRevoked: boolean;
1959
+ caveats?: Record<string, unknown>[] | undefined;
1643
1960
  createdAt?: Date | undefined;
1644
1961
  delegatorDID?: string | undefined;
1645
1962
  parentCid?: string | undefined;
@@ -1653,6 +1970,7 @@ declare const CapabilityEntrySchema: z.ZodObject<{
1653
1970
  cid: string;
1654
1971
  delegateDID: string;
1655
1972
  isRevoked: boolean;
1973
+ caveats?: Record<string, unknown>[] | undefined;
1656
1974
  createdAt?: Date | undefined;
1657
1975
  delegatorDID?: string | undefined;
1658
1976
  parentCid?: string | undefined;
@@ -1689,6 +2007,7 @@ declare const CapabilityEntrySchema: z.ZodObject<{
1689
2007
  cid: string;
1690
2008
  delegateDID: string;
1691
2009
  isRevoked: boolean;
2010
+ caveats?: Record<string, unknown>[] | undefined;
1692
2011
  createdAt?: Date | undefined;
1693
2012
  delegatorDID?: string | undefined;
1694
2013
  parentCid?: string | undefined;
@@ -1726,6 +2045,7 @@ declare const CapabilityEntrySchema: z.ZodObject<{
1726
2045
  cid: string;
1727
2046
  delegateDID: string;
1728
2047
  isRevoked: boolean;
2048
+ caveats?: Record<string, unknown>[] | undefined;
1729
2049
  createdAt?: Date | undefined;
1730
2050
  delegatorDID?: string | undefined;
1731
2051
  parentCid?: string | undefined;
@@ -1839,6 +2159,8 @@ declare const DelegationChainSchema: z.ZodArray<z.ZodObject<{
1839
2159
  path: z.ZodString;
1840
2160
  /** Actions this delegation authorizes */
1841
2161
  actions: z.ZodArray<z.ZodString, "many">;
2162
+ /** Exact ReCap caveats that constrain every action in this scope. */
2163
+ caveats: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
1842
2164
  /** When this delegation expires (accepts Date or ISO string from JSON) */
1843
2165
  expiry: z.ZodDate;
1844
2166
  /** Whether this delegation has been revoked */
@@ -1861,6 +2183,7 @@ declare const DelegationChainSchema: z.ZodArray<z.ZodObject<{
1861
2183
  cid: string;
1862
2184
  delegateDID: string;
1863
2185
  isRevoked: boolean;
2186
+ caveats?: Record<string, unknown>[] | undefined;
1864
2187
  createdAt?: Date | undefined;
1865
2188
  delegatorDID?: string | undefined;
1866
2189
  parentCid?: string | undefined;
@@ -1874,6 +2197,7 @@ declare const DelegationChainSchema: z.ZodArray<z.ZodObject<{
1874
2197
  cid: string;
1875
2198
  delegateDID: string;
1876
2199
  isRevoked: boolean;
2200
+ caveats?: Record<string, unknown>[] | undefined;
1877
2201
  createdAt?: Date | undefined;
1878
2202
  delegatorDID?: string | undefined;
1879
2203
  parentCid?: string | undefined;
@@ -1897,6 +2221,8 @@ declare const DelegationChainV2Schema: z.ZodObject<{
1897
2221
  path: z.ZodString;
1898
2222
  /** Actions this delegation authorizes */
1899
2223
  actions: z.ZodArray<z.ZodString, "many">;
2224
+ /** Exact ReCap caveats that constrain every action in this scope. */
2225
+ caveats: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
1900
2226
  /** When this delegation expires (accepts Date or ISO string from JSON) */
1901
2227
  expiry: z.ZodDate;
1902
2228
  /** Whether this delegation has been revoked */
@@ -1919,6 +2245,7 @@ declare const DelegationChainV2Schema: z.ZodObject<{
1919
2245
  cid: string;
1920
2246
  delegateDID: string;
1921
2247
  isRevoked: boolean;
2248
+ caveats?: Record<string, unknown>[] | undefined;
1922
2249
  createdAt?: Date | undefined;
1923
2250
  delegatorDID?: string | undefined;
1924
2251
  parentCid?: string | undefined;
@@ -1932,6 +2259,7 @@ declare const DelegationChainV2Schema: z.ZodObject<{
1932
2259
  cid: string;
1933
2260
  delegateDID: string;
1934
2261
  isRevoked: boolean;
2262
+ caveats?: Record<string, unknown>[] | undefined;
1935
2263
  createdAt?: Date | undefined;
1936
2264
  delegatorDID?: string | undefined;
1937
2265
  parentCid?: string | undefined;
@@ -1950,6 +2278,8 @@ declare const DelegationChainV2Schema: z.ZodObject<{
1950
2278
  path: z.ZodString;
1951
2279
  /** Actions this delegation authorizes */
1952
2280
  actions: z.ZodArray<z.ZodString, "many">;
2281
+ /** Exact ReCap caveats that constrain every action in this scope. */
2282
+ caveats: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
1953
2283
  /** When this delegation expires (accepts Date or ISO string from JSON) */
1954
2284
  expiry: z.ZodDate;
1955
2285
  /** Whether this delegation has been revoked */
@@ -1972,6 +2302,7 @@ declare const DelegationChainV2Schema: z.ZodObject<{
1972
2302
  cid: string;
1973
2303
  delegateDID: string;
1974
2304
  isRevoked: boolean;
2305
+ caveats?: Record<string, unknown>[] | undefined;
1975
2306
  createdAt?: Date | undefined;
1976
2307
  delegatorDID?: string | undefined;
1977
2308
  parentCid?: string | undefined;
@@ -1985,6 +2316,7 @@ declare const DelegationChainV2Schema: z.ZodObject<{
1985
2316
  cid: string;
1986
2317
  delegateDID: string;
1987
2318
  isRevoked: boolean;
2319
+ caveats?: Record<string, unknown>[] | undefined;
1988
2320
  createdAt?: Date | undefined;
1989
2321
  delegatorDID?: string | undefined;
1990
2322
  parentCid?: string | undefined;
@@ -2003,6 +2335,8 @@ declare const DelegationChainV2Schema: z.ZodObject<{
2003
2335
  path: z.ZodString;
2004
2336
  /** Actions this delegation authorizes */
2005
2337
  actions: z.ZodArray<z.ZodString, "many">;
2338
+ /** Exact ReCap caveats that constrain every action in this scope. */
2339
+ caveats: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
2006
2340
  /** When this delegation expires (accepts Date or ISO string from JSON) */
2007
2341
  expiry: z.ZodDate;
2008
2342
  /** Whether this delegation has been revoked */
@@ -2025,6 +2359,7 @@ declare const DelegationChainV2Schema: z.ZodObject<{
2025
2359
  cid: string;
2026
2360
  delegateDID: string;
2027
2361
  isRevoked: boolean;
2362
+ caveats?: Record<string, unknown>[] | undefined;
2028
2363
  createdAt?: Date | undefined;
2029
2364
  delegatorDID?: string | undefined;
2030
2365
  parentCid?: string | undefined;
@@ -2038,6 +2373,7 @@ declare const DelegationChainV2Schema: z.ZodObject<{
2038
2373
  cid: string;
2039
2374
  delegateDID: string;
2040
2375
  isRevoked: boolean;
2376
+ caveats?: Record<string, unknown>[] | undefined;
2041
2377
  createdAt?: Date | undefined;
2042
2378
  delegatorDID?: string | undefined;
2043
2379
  parentCid?: string | undefined;
@@ -2053,6 +2389,7 @@ declare const DelegationChainV2Schema: z.ZodObject<{
2053
2389
  cid: string;
2054
2390
  delegateDID: string;
2055
2391
  isRevoked: boolean;
2392
+ caveats?: Record<string, unknown>[] | undefined;
2056
2393
  createdAt?: Date | undefined;
2057
2394
  delegatorDID?: string | undefined;
2058
2395
  parentCid?: string | undefined;
@@ -2067,6 +2404,7 @@ declare const DelegationChainV2Schema: z.ZodObject<{
2067
2404
  cid: string;
2068
2405
  delegateDID: string;
2069
2406
  isRevoked: boolean;
2407
+ caveats?: Record<string, unknown>[] | undefined;
2070
2408
  createdAt?: Date | undefined;
2071
2409
  delegatorDID?: string | undefined;
2072
2410
  parentCid?: string | undefined;
@@ -2081,6 +2419,7 @@ declare const DelegationChainV2Schema: z.ZodObject<{
2081
2419
  cid: string;
2082
2420
  delegateDID: string;
2083
2421
  isRevoked: boolean;
2422
+ caveats?: Record<string, unknown>[] | undefined;
2084
2423
  createdAt?: Date | undefined;
2085
2424
  delegatorDID?: string | undefined;
2086
2425
  parentCid?: string | undefined;
@@ -2096,6 +2435,7 @@ declare const DelegationChainV2Schema: z.ZodObject<{
2096
2435
  cid: string;
2097
2436
  delegateDID: string;
2098
2437
  isRevoked: boolean;
2438
+ caveats?: Record<string, unknown>[] | undefined;
2099
2439
  createdAt?: Date | undefined;
2100
2440
  delegatorDID?: string | undefined;
2101
2441
  parentCid?: string | undefined;
@@ -2110,6 +2450,7 @@ declare const DelegationChainV2Schema: z.ZodObject<{
2110
2450
  cid: string;
2111
2451
  delegateDID: string;
2112
2452
  isRevoked: boolean;
2453
+ caveats?: Record<string, unknown>[] | undefined;
2113
2454
  createdAt?: Date | undefined;
2114
2455
  delegatorDID?: string | undefined;
2115
2456
  parentCid?: string | undefined;
@@ -2124,6 +2465,7 @@ declare const DelegationChainV2Schema: z.ZodObject<{
2124
2465
  cid: string;
2125
2466
  delegateDID: string;
2126
2467
  isRevoked: boolean;
2468
+ caveats?: Record<string, unknown>[] | undefined;
2127
2469
  createdAt?: Date | undefined;
2128
2470
  delegatorDID?: string | undefined;
2129
2471
  parentCid?: string | undefined;
@@ -2162,23 +2504,23 @@ declare const DelegationFiltersSchema: z.ZodObject<{
2162
2504
  }, "strip", z.ZodTypeAny, {
2163
2505
  path?: string | undefined;
2164
2506
  actions?: string[] | undefined;
2507
+ direction?: "received" | "all" | "granted" | undefined;
2508
+ limit?: number | undefined;
2509
+ cursor?: string | undefined;
2165
2510
  delegator?: string | undefined;
2166
2511
  delegatee?: string | undefined;
2167
- direction?: "received" | "all" | "granted" | undefined;
2168
2512
  includeRevoked?: boolean | undefined;
2169
2513
  validAt?: Date | undefined;
2170
- limit?: number | undefined;
2171
- cursor?: string | undefined;
2172
2514
  }, {
2173
2515
  path?: string | undefined;
2174
2516
  actions?: string[] | undefined;
2517
+ direction?: "received" | "all" | "granted" | undefined;
2518
+ limit?: number | undefined;
2519
+ cursor?: string | undefined;
2175
2520
  delegator?: string | undefined;
2176
2521
  delegatee?: string | undefined;
2177
- direction?: "received" | "all" | "granted" | undefined;
2178
2522
  includeRevoked?: boolean | undefined;
2179
2523
  validAt?: Date | undefined;
2180
- limit?: number | undefined;
2181
- cursor?: string | undefined;
2182
2524
  }>;
2183
2525
  type DelegationFilters = z.infer<typeof DelegationFiltersSchema>;
2184
2526
  /**
@@ -2243,6 +2585,8 @@ declare const ShareLinkSchema: z.ZodObject<{
2243
2585
  path: z.ZodString;
2244
2586
  /** Actions this delegation authorizes */
2245
2587
  actions: z.ZodArray<z.ZodString, "many">;
2588
+ /** Exact ReCap caveats that constrain every action in this scope. */
2589
+ caveats: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
2246
2590
  /** When this delegation expires (accepts Date or ISO string from JSON) */
2247
2591
  expiry: z.ZodDate;
2248
2592
  /** Whether this delegation has been revoked */
@@ -2265,6 +2609,7 @@ declare const ShareLinkSchema: z.ZodObject<{
2265
2609
  cid: string;
2266
2610
  delegateDID: string;
2267
2611
  isRevoked: boolean;
2612
+ caveats?: Record<string, unknown>[] | undefined;
2268
2613
  createdAt?: Date | undefined;
2269
2614
  delegatorDID?: string | undefined;
2270
2615
  parentCid?: string | undefined;
@@ -2278,6 +2623,7 @@ declare const ShareLinkSchema: z.ZodObject<{
2278
2623
  cid: string;
2279
2624
  delegateDID: string;
2280
2625
  isRevoked: boolean;
2626
+ caveats?: Record<string, unknown>[] | undefined;
2281
2627
  createdAt?: Date | undefined;
2282
2628
  delegatorDID?: string | undefined;
2283
2629
  parentCid?: string | undefined;
@@ -2299,6 +2645,7 @@ declare const ShareLinkSchema: z.ZodObject<{
2299
2645
  cid: string;
2300
2646
  delegateDID: string;
2301
2647
  isRevoked: boolean;
2648
+ caveats?: Record<string, unknown>[] | undefined;
2302
2649
  createdAt?: Date | undefined;
2303
2650
  delegatorDID?: string | undefined;
2304
2651
  parentCid?: string | undefined;
@@ -2319,6 +2666,7 @@ declare const ShareLinkSchema: z.ZodObject<{
2319
2666
  cid: string;
2320
2667
  delegateDID: string;
2321
2668
  isRevoked: boolean;
2669
+ caveats?: Record<string, unknown>[] | undefined;
2322
2670
  createdAt?: Date | undefined;
2323
2671
  delegatorDID?: string | undefined;
2324
2672
  parentCid?: string | undefined;
@@ -2405,6 +2753,8 @@ type GenerateShareParams = z.infer<typeof GenerateShareParamsSchema>;
2405
2753
  declare const DelegationManagerConfigSchema: z.ZodObject<{
2406
2754
  /** TinyCloud host URLs */
2407
2755
  hosts: z.ZodArray<z.ZodString, "many">;
2756
+ /** Account space used by account-wide delegation history queries */
2757
+ accountSpaceId: z.ZodOptional<z.ZodString>;
2408
2758
  /** Active session for authentication */
2409
2759
  session: z.ZodEffects<z.ZodUnknown, ServiceSession, unknown>;
2410
2760
  /** Platform-specific invoke function */
@@ -2418,11 +2768,13 @@ declare const DelegationManagerConfigSchema: z.ZodObject<{
2418
2768
  hosts: string[];
2419
2769
  invoke: InvokeFunction;
2420
2770
  invokeAny?: InvokeAnyFunction | undefined;
2771
+ accountSpaceId?: string | undefined;
2421
2772
  fetch?: FetchFunction | undefined;
2422
2773
  }, {
2423
2774
  hosts: string[];
2424
2775
  invokeAny?: unknown;
2425
2776
  session?: unknown;
2777
+ accountSpaceId?: string | undefined;
2426
2778
  invoke?: unknown;
2427
2779
  fetch?: unknown;
2428
2780
  }>;
@@ -2493,16 +2845,20 @@ declare const DelegatedResourceSchema: z.ZodObject<{
2493
2845
  path: z.ZodString;
2494
2846
  /** Full-URN ability strings, e.g. ["tinycloud.kv/get", "tinycloud.kv/put"]. */
2495
2847
  actions: z.ZodArray<z.ZodString, "many">;
2848
+ /** Exact ReCap caveats that constrain every action in this scope. */
2849
+ caveats: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
2496
2850
  }, "strip", z.ZodTypeAny, {
2497
2851
  path: string;
2498
2852
  actions: string[];
2499
2853
  space: string;
2500
2854
  service: string;
2855
+ caveats?: Record<string, unknown>[] | undefined;
2501
2856
  }, {
2502
2857
  path: string;
2503
2858
  actions: string[];
2504
2859
  space: string;
2505
2860
  service: string;
2861
+ caveats?: Record<string, unknown>[] | undefined;
2506
2862
  }>;
2507
2863
  type DelegatedResource = z.infer<typeof DelegatedResourceSchema>;
2508
2864
  /**
@@ -2591,16 +2947,20 @@ declare const CreateDelegationWasmResultSchema: z.ZodObject<{
2591
2947
  path: z.ZodString;
2592
2948
  /** Full-URN ability strings, e.g. ["tinycloud.kv/get", "tinycloud.kv/put"]. */
2593
2949
  actions: z.ZodArray<z.ZodString, "many">;
2950
+ /** Exact ReCap caveats that constrain every action in this scope. */
2951
+ caveats: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
2594
2952
  }, "strip", z.ZodTypeAny, {
2595
2953
  path: string;
2596
2954
  actions: string[];
2597
2955
  space: string;
2598
2956
  service: string;
2957
+ caveats?: Record<string, unknown>[] | undefined;
2599
2958
  }, {
2600
2959
  path: string;
2601
2960
  actions: string[];
2602
2961
  space: string;
2603
2962
  service: string;
2963
+ caveats?: Record<string, unknown>[] | undefined;
2604
2964
  }>, "many">;
2605
2965
  }, "strip", z.ZodTypeAny, {
2606
2966
  resources: {
@@ -2608,6 +2968,7 @@ declare const CreateDelegationWasmResultSchema: z.ZodObject<{
2608
2968
  actions: string[];
2609
2969
  space: string;
2610
2970
  service: string;
2971
+ caveats?: Record<string, unknown>[] | undefined;
2611
2972
  }[];
2612
2973
  delegation: string;
2613
2974
  expiry: Date;
@@ -2619,6 +2980,7 @@ declare const CreateDelegationWasmResultSchema: z.ZodObject<{
2619
2980
  actions: string[];
2620
2981
  space: string;
2621
2982
  service: string;
2983
+ caveats?: Record<string, unknown>[] | undefined;
2622
2984
  }[];
2623
2985
  delegation: string;
2624
2986
  expiry: Date;
@@ -2898,6 +3260,7 @@ declare class CapabilityKeyRegistry implements ICapabilityKeyRegistry {
2898
3260
  * @returns Combined key string
2899
3261
  */
2900
3262
  private makeCapabilityKey;
3263
+ private sameDelegationScope;
2901
3264
  /**
2902
3265
  * Find capability entries that match a resource and action.
2903
3266
  *
@@ -3488,6 +3851,8 @@ declare class TinyCloud {
3488
3851
  * @throws Error if services are not initialized
3489
3852
  */
3490
3853
  get serviceContext(): IServiceContext;
3854
+ /** @internal Retire this service graph after its owner replaces a session. */
3855
+ retireServices(): void;
3491
3856
  /**
3492
3857
  * Get a registered service by name.
3493
3858
  *
@@ -3679,6 +4044,7 @@ declare class DelegationManager {
3679
4044
  private invoke;
3680
4045
  private invokeAny?;
3681
4046
  private fetchFn;
4047
+ private accountSpaceId?;
3682
4048
  /**
3683
4049
  * Creates a new DelegationManager instance.
3684
4050
  *
@@ -3737,12 +4103,14 @@ declare class DelegationManager {
3737
4103
  * }
3738
4104
  * ```
3739
4105
  */
3740
- revoke(cid: string): Promise<Result<void>>;
4106
+ revoke(cid: string): Promise<Result<DelegationRevocationReceipt>>;
3741
4107
  /**
3742
4108
  * Reads the node-confirmed lifecycle state of one delegation without
3743
4109
  * exposing delegation metadata.
3744
4110
  */
3745
4111
  status(cid: string): Promise<Result<DelegationStatus>>;
4112
+ /** Query lifecycle-complete delegation history for the authenticated account. */
4113
+ query(options?: AccountDelegationQueryOptions): Promise<Result<AccountDelegationPage>>;
3746
4114
  /**
3747
4115
  * Lists all delegations for the current session's space.
3748
4116
  *
@@ -4013,6 +4381,8 @@ interface SharingServiceConfig {
4013
4381
  /** Requested expiry time */
4014
4382
  requestedExpiry: Date;
4015
4383
  }) => Promise<Delegation | undefined>;
4384
+ /** Reject operations after the host session/service graph has been retired. */
4385
+ assertActive?: () => void;
4016
4386
  }
4017
4387
  /**
4018
4388
  * Interface for the SharingService.
@@ -4100,6 +4470,7 @@ declare class SharingService implements ISharingService {
4100
4470
  private pathPrefix;
4101
4471
  private sessionExpiry?;
4102
4472
  private onRootDelegationNeeded?;
4473
+ private assertActiveFn?;
4103
4474
  /**
4104
4475
  * Creates a new SharingService instance.
4105
4476
  */
@@ -4116,7 +4487,7 @@ declare class SharingService implements ISharingService {
4116
4487
  * Updates the service configuration.
4117
4488
  * Used to add full capabilities (session, delegationManager, createDelegation, createDelegationWasm) after signIn.
4118
4489
  */
4119
- updateConfig(config: Partial<Pick<SharingServiceConfig, "session" | "delegationManager" | "createDelegation" | "createDelegationWasm" | "sessionExpiry" | "onRootDelegationNeeded">>): void;
4490
+ updateConfig(config: Partial<Pick<SharingServiceConfig, "session" | "delegationManager" | "createDelegation" | "createDelegationWasm" | "sessionExpiry" | "onRootDelegationNeeded" | "assertActive">>): void;
4120
4491
  /**
4121
4492
  * Generate a sharing link with an embedded private key.
4122
4493
  *
@@ -4138,6 +4509,7 @@ declare class SharingService implements ISharingService {
4138
4509
  * @internal
4139
4510
  */
4140
4511
  private findSuitableKeyForDelegation;
4512
+ private retiredGraphError;
4141
4513
  /**
4142
4514
  * Check if a delegation path matches/covers the requested path.
4143
4515
  * A delegation path covers the request if:
@@ -4147,11 +4519,6 @@ declare class SharingService implements ISharingService {
4147
4519
  * @internal
4148
4520
  */
4149
4521
  private pathMatches;
4150
- /**
4151
- * Handle fallback to session extension when root delegation is not available.
4152
- * @internal
4153
- */
4154
- private handleSessionExtensionFallback;
4155
4522
  /**
4156
4523
  * Create a delegation from the current session to a share key.
4157
4524
  * This is the fallback path when root delegation is not available.
@@ -4180,6 +4547,11 @@ declare class SharingService implements ISharingService {
4180
4547
  * be logged or stored insecurely.
4181
4548
  */
4182
4549
  delegateReceivedShare(link: string, params: DelegateReceivedShareParams): Promise<Result<DelegatedShareAccess, DelegationError>>;
4550
+ /**
4551
+ * The child-delegation WASM boundary accepts action-only abilities. Reject
4552
+ * every constrained parent branch before that boundary can broaden it.
4553
+ */
4554
+ private assertDelegationCaveatsPreservable;
4183
4555
  /**
4184
4556
  * Encode sharing data into a link string.
4185
4557
  *
@@ -4783,6 +5155,7 @@ interface AccountServiceConfig {
4783
5155
  getPrimarySpaceId: () => string | undefined;
4784
5156
  getAccountSpaceId: () => string | undefined;
4785
5157
  getSpaces: () => ISpaceService;
5158
+ getDelegationManager?: () => Pick<DelegationManager, "query" | "revoke">;
4786
5159
  getAccountDb?: () => IDatabaseHandle | undefined;
4787
5160
  ensureAccountSpaceHosted?: () => Promise<void>;
4788
5161
  }
@@ -4804,8 +5177,9 @@ declare class AccountService {
4804
5177
  remove: (spaceId: string) => Promise<Result$1<void>>;
4805
5178
  };
4806
5179
  readonly delegations: {
5180
+ query: (options?: AccountDelegationQueryOptions) => Promise<Result$1<AccountDelegationPage>>;
4807
5181
  list: (options?: AccountDelegationListOptions) => Promise<Result$1<AccountDelegation[]>>;
4808
- revoke: (options: AccountDelegationRevokeOptions) => Promise<Result$1<void>>;
5182
+ revoke: (input: string | AccountDelegationRevokeOptions) => Promise<Result$1<DelegationRevocationReceipt | void>>;
4809
5183
  };
4810
5184
  readonly index: {
4811
5185
  ensure: () => Promise<Result$1<AccountIndexEnsureResult>>;
@@ -5070,4 +5444,4 @@ declare const EXPIRY: {
5070
5444
  declare const DEFAULT_SIGNED_READ_URL_EXPIRY_MS: number;
5071
5445
  type ExpiryTier = keyof typeof EXPIRY;
5072
5446
 
5073
- export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, type AbilitiesMap, type AccountApplication, type AccountApplicationListOptions, type AccountDelegation, type AccountDelegationListOptions, type AccountDelegationRevokeOptions, type AccountIndexEnsureResult, type AccountIndexRebuildResult, type AccountIndexStatus, type AccountIndexedReadOptions, AccountService, type AccountServiceConfig, type AccountSpace, type AccountSpaceListOptions, type AccountStatus, AutoApproveSpaceCreationHandler, type AutoRejectStrategy, type AutoSignStrategy, type Bytes, type CallbackStrategy, type CanonicalAddress, type CanonicalParsedNetworkId, type CapabilityEntry, CapabilityKeyRegistry, type CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, type ClientSession, ClientSessionSchema, CloudLocationResolutionError, type ComposeManifestOptions, type ComposedManifestRequest, type CreateDelegationFunction, type CreateDelegationParams, type CreateDelegationWasmParams, type CreateDelegationWasmResult, DEFAULT_DEFAULTS, DEFAULT_EXPIRY, DEFAULT_KNOWLEDGE_ROOT, DEFAULT_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, DEFAULT_SIGNED_READ_URL_EXPIRY_MS, DEFAULT_TINYCLOUD_FALLBACK_HOST, DEFAULT_TINYCLOUD_LOCATION_REGISTRY_URL, type DelegateReceivedShareParams, type DelegatedResource, type DelegatedShareAccess, type Delegation, type DelegationApiResponse, type DelegationChain, type DelegationChainV2, type DelegationDirection, type DelegationError, type DelegationErrorCode, DelegationErrorCodes, type DelegationFilters, DelegationManager, type DelegationManagerConfig, type DelegationRecord, type Result as DelegationResult, type DelegationStatus, type DidCacheKeyOptions, type DidEqualsOptions, ENCRYPTION_MANIFEST_SPACE, ENCRYPTION_PERMISSION_SERVICE, EXPIRY, type EncodedShareData, type EnsData, EnsDataSchema, type EventEmitterStrategy, type ExpiryTier, type Extension, type GenerateShareParams, type ICapabilityKeyRegistry, type IENSResolver, type INotificationHandler, type ISessionManager, type ISessionStorage, type ISharingService, type ISigner, type ISpace, type ISpaceCreationHandler, type ISpaceScopedDelegations, type ISpaceScopedSharing, type ISpaceService, type IUserAuthorization, type IWasmBindings, IdentityParseError, type IngestOptions, type JWK, type KeyInfo, type KeyProvider, type KeyType, type LocationCandidate, type LocationCandidateInput, type LocationRecord, type LocationRecordPayload, type LocationRecordSigner, LocationRecordValidationError, type LocationResolutionAttempt, type LocationSource, type Manifest, type ManifestDefaults, type ManifestKnowledge, type ManifestRegistryRecord, type ManifestSecretActions, ManifestValidationError, type NodeInfo, type OpenKeyCallbackStrategy, type OpenKeySigningRequestBody, type OpenKeySigningResponseBody, type OpenKeySigningStrategyOptions, type ParseRecapFromSiwe, type PartialSiweMessage, type PermissionEntry, PermissionNotInManifestError, type PersistedSessionData, type PersistedTinyCloudSession, type PkhDidParts, ProtocolMismatchError, type ReceiveOptions, type ResolveCloudLocationOptions, type ResolveTinyCloudHostsOptions, type ResolvedCapabilities, type ResolvedCloudLocation, type ResolvedDelegate, type ResolvedTinyCloudHosts, type ResourceCapability, SECRETS_SPACE, SERVICE_LONG_TO_SHORT, SERVICE_SHORT_TO_LONG, type ServerHost, SessionExpiredError, type ShareAccess, type ShareLink, type ShareLinkData, type ShareSchema, SharingService, type SharingServiceConfig, type SignCallback, type SignInOptions, type SignRequest, type SignResponse, type SignStrategy, SilentNotificationHandler, type SiweConfig, SiweConfigSchema, Space, type SpaceAbilitiesMap, type SpaceConfig, type SpaceCreationContext, type SpaceDelegationParams, type SpaceErrorCode, SpaceErrorCodes, type SpaceHostResult, type SpaceInfo, type SpaceOwnership, SpaceService, type SpaceServiceConfig, type StoredDelegationChain, type SubsetCheckResult, TinyCloud, type TinyCloudConfig, type TinyCloudSession, UnsupportedFeatureError, type UserAuthorizationConfig, VAULT_PERMISSION_SERVICE, type ValidationError, VersionCheckError, type WasmRecapEntry, actionContains, activateSessionWithHost, addressStorageKey, applyPrefix, buildSpaceUri, canonicalLocationPayload, canonicalizeAddress, canonicalizeDid, canonicalizeDidUrl, canonicalizeNetworkId, checkNodeInfo, composeManifestRequest, createCapabilityKeyRegistry, createOpenKeyCallbackSigningStrategy, createSharingService, createSpaceService, defaultSignStrategy, defaultSpaceCreationHandler, didCacheKey, didEquals, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, fetchLocationRecord, fetchPeerId, httpUrlToMultiaddr, isCapabilitySubset, isEvmAddress, loadManifest, locationPayloadForRecord, makePkhSpaceId, makePublicSpaceId, manifestAbilitiesUnion, multiaddrToHttpUrl, normalizeDefaults, parseCanonicalNetworkId, parseExpiry, parsePkhDid, parseRecapCapabilities, parseSpaceUri, pkhDid, principalDid, principalDidEquals, resolveCloudLocation, resolveManifest, resolveManifestKnowledgeRoot, resolveTinyCloudHosts, resourceCapabilitiesToAbilitiesMap, resourceCapabilitiesToSpaceAbilitiesMap, signLocationRecord, submitHostDelegation, validateClientSession, validateLocationRecord, validateLocationRecordPayload, validateManifest, validatePersistedSessionData, verifyDidKeyEd25519Signature, verifyLocationRecord };
5447
+ export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, type AbilitiesMap, type AccountApplication, type AccountApplicationListOptions, type AccountDelegation, type AccountDelegationListOptions, type AccountDelegationPage, type AccountDelegationQueryOptions, type AccountDelegationRecord, type AccountDelegationResource, type AccountDelegationRevokeOptions, type AccountIndexEnsureResult, type AccountIndexRebuildResult, type AccountIndexStatus, type AccountIndexedReadOptions, AccountService, type AccountServiceConfig, type AccountSpace, type AccountSpaceListOptions, type AccountStatus, AutoApproveSpaceCreationHandler, type AutoRejectStrategy, type AutoSignStrategy, type Bytes, type CallbackStrategy, type CanonicalAddress, type CanonicalParsedNetworkId, type CapabilityEntry, CapabilityKeyRegistry, type CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, CaveatedDelegationUnsupportedError, type ClientSession, ClientSessionSchema, CloudLocationResolutionError, type ComposeManifestOptions, type ComposedManifestRequest, type CreateDelegationFunction, type CreateDelegationParams, type CreateDelegationWasmParams, type CreateDelegationWasmResult, DEFAULT_DEFAULTS, DEFAULT_EXPIRY, DEFAULT_KNOWLEDGE_ROOT, DEFAULT_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, DEFAULT_SIGNED_READ_URL_EXPIRY_MS, DEFAULT_TINYCLOUD_FALLBACK_HOST, DEFAULT_TINYCLOUD_LOCATION_REGISTRY_URL, type DelegateReceivedShareParams, type DelegatedResource, type DelegatedShareAccess, type Delegation, type DelegationApiResponse, type DelegationChain, type DelegationChainV2, type DelegationDirection, type DelegationError, type DelegationErrorCode, DelegationErrorCodes, type DelegationFilters, DelegationManager, type DelegationManagerConfig, type DelegationRecord, type Result as DelegationResult, type DelegationRevocationReceipt, type DelegationStatus, type DidCacheKeyOptions, type DidEqualsOptions, ENCRYPTION_MANIFEST_SPACE, ENCRYPTION_PERMISSION_SERVICE, EXPIRY, type EncodedShareData, type EnsData, EnsDataSchema, type EventEmitterStrategy, type ExpiryTier, type Extension, type GenerateShareParams, type ICapabilityKeyRegistry, type IENSResolver, type INotificationHandler, type ISessionManager, type ISessionStorage, type ISharingService, type ISigner, type ISpace, type ISpaceCreationHandler, type ISpaceScopedDelegations, type ISpaceScopedSharing, type ISpaceService, type IUserAuthorization, type IWasmBindings, IdentityParseError, type IngestOptions, type JWK, type KeyInfo, type KeyProvider, type KeyType, type LocationCandidate, type LocationCandidateInput, type LocationRecord, type LocationRecordPayload, type LocationRecordSigner, LocationRecordValidationError, type LocationResolutionAttempt, type LocationSource, type Manifest, type ManifestDefaults, type ManifestKnowledge, type ManifestRegistryRecord, type ManifestSecretActions, ManifestValidationError, type NodeInfo, type OpenKeyCallbackStrategy, type OpenKeySigningRequestBody, type OpenKeySigningResponseBody, type OpenKeySigningStrategyOptions, type ParseRecapFromSiwe, type PartialSiweMessage, type PermissionEntry, PermissionNotInManifestError, type PersistedSessionData, type PersistedSessionProof, type PersistedTinyCloudSession, type PkhDidParts, ProtocolMismatchError, type ReceiveOptions, type ResolveCloudLocationOptions, type ResolveTinyCloudHostsOptions, type ResolvedCapabilities, type ResolvedCloudLocation, type ResolvedDelegate, type ResolvedTinyCloudHosts, type ResourceCapability, SECRETS_SPACE, SERVICE_LONG_TO_SHORT, SERVICE_SHORT_TO_LONG, type ServerHost, SessionExpiredError, type ShareAccess, type ShareLink, type ShareLinkData, type ShareSchema, SharingService, type SharingServiceConfig, type SignCallback, type SignInOptions, type SignRequest, type SignResponse, type SignStrategy, SilentNotificationHandler, type SiweConfig, SiweConfigSchema, Space, type SpaceAbilitiesMap, type SpaceConfig, type SpaceCreationContext, type SpaceDelegationParams, type SpaceErrorCode, SpaceErrorCodes, type SpaceHostResult, type SpaceInfo, type SpaceOwnership, SpaceService, type SpaceServiceConfig, type StoredDelegationChain, type SubsetCheckResult, TinyCloud, type TinyCloudConfig, type TinyCloudSession, UnsupportedFeatureError, type UserAuthorizationConfig, VAULT_PERMISSION_SERVICE, type ValidatedPersistedSessionProof, type ValidationError, VersionCheckError, type WasmRecapEntry, actionContains, activateSessionWithHost, addressStorageKey, applyPrefix, buildSpaceUri, canonicalLocationPayload, canonicalizeAddress, canonicalizeDid, canonicalizeDidUrl, canonicalizeNetworkId, canonicalizeRecapCaveats, checkNodeInfo, composeManifestRequest, createCapabilityKeyRegistry, createOpenKeyCallbackSigningStrategy, createSharingService, createSpaceService, defaultSignStrategy, defaultSpaceCreationHandler, didCacheKey, didEquals, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, fetchLocationRecord, fetchPeerId, httpUrlToMultiaddr, isCapabilitySubset, isEvmAddress, loadManifest, locationPayloadForRecord, makePkhSpaceId, makePublicSpaceId, manifestAbilitiesUnion, multiaddrToHttpUrl, normalizeDefaults, parseCanonicalNetworkId, parseExpiry, parsePkhDid, parseRecapCapabilities, parseSpaceUri, pkhDid, principalDid, principalDidEquals, recapCaveatsEqual, resolveCloudLocation, resolveManifest, resolveManifestKnowledgeRoot, resolveTinyCloudHosts, resourceCapabilitiesToAbilitiesMap, resourceCapabilitiesToSpaceAbilitiesMap, signLocationRecord, submitHostDelegation, validateClientSession, validateLocationRecord, validateLocationRecordPayload, validateManifest, validatePersistedSessionData, verifyDidKeyEd25519Signature, verifyLocationRecord };