@tinycloud/sdk-core 3.0.0-beta.1 → 3.0.0-beta.2

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.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
- import { b7 as CredentialHolderBinding, b8 as CredentialFlowDescriptor, b9 as CredentialRequirement, ba as StoredCredentialRecord, bb as VerifiedCredential, bc as CredentialStorageReceipt, bd as IssuedCredentialEnvelope, be as CredentialIssuerMetadata } from './credential-admission-C_cO1QqB.cjs';
3
- export { A as ATTESTED_ENFORCER_BINDING_V2_SCHEMA, b as AdmitPolicyCredentialV3Input, B as BuildPolicyCredentialPresentationV3Input, C as CONTENT_SOURCE_V1_DOMAIN, bf as CREDENTIAL_ACQUISITION_PROTOCOL, bg as CREDENTIAL_CONTRACT_VERSION, bh as CREDENTIAL_FORMAT, bf as CREDENTIAL_PROTOCOL, bi as CREDENTIAL_STEP_REGISTRY_VERSION, d as CompactUcanAuthorizationV1, bj as CredentialClaimDescriptor, bk as CredentialEndpointId, bl as CredentialInputDescriptor, bm as CredentialProgressEvent, bn as CredentialStepDescriptor, bo as CredentialStepType, bp as CredentialUxState, E as ED25519_JCS_SIGNATURE_SUITE, e as EIP191_JCS_SIGNATURE_SUITE, bq as HOLDER_BINDING_DOMAIN, br as IssuerVerificationKey, J as JsonObject, L as LAST_V2_CREATE_AT, f as LAST_V2_READ_AT, M as MAX_LEGACY_ENVELOPE_EXPIRES_AT, N as NATIVE_PROJECTION_V1_DOMAIN, g as POLICY_CAPABILITY_V1_DOMAIN, h as POLICY_CAPABILITY_V1_SCHEMA, i as POLICY_CREDENTIAL_REQUIREMENT_V1_TYPE, j as POLICY_ENFORCEMENT_DELEGATION_V2_SCHEMA, k as POLICY_ENGINE_RECORD_SCHEMA, l as POLICY_PRESENTATION_V3_DOMAIN, m as POLICY_PRESENTATION_V3_SCHEMA, n as POLICY_SCHEMA, o as POLICY_SESSION_UCAN_V1_PROFILE, p as POLICY_STATUS_SCHEMA, q as POLICY_V1_DOMAIN, r as POLICY_V1_SCHEMA, s as POLICY_V2_DOMAIN, t as POLICY_V2_SCHEMA, a as Policy, v as PolicyCredentialAdmissionV3, w as PolicyCredentialPresentationV3, x as PolicyCredentialRequirementV1, P as PolicyEngineRecord, y as PolicyRootStatusV3, z as PolicySessionUcanV1, D as PolicyStatus, R as ROOT_REVOCATION_V1_DOMAIN, F as ROOT_REVOCATION_V1_SCHEMA, G as ROOT_STATUS_CHECKPOINT_V1_SCHEMA, H as ROOT_STATUS_RENEWAL_V1_DOMAIN, I as ROOT_STATUS_V1_DOMAIN, K as SignCompactUcanAuthorizationInput, O as SignCompactUcanRootAuthorizationInput, Q as SignatureMaterialError, T as SignatureSuite, V as SignatureVerificationError, W as SignedObjectCanonicalizationError, X as SignedObjectDigestError, Y as SignedObjectErrorCode, Z as SignedObjectIdError, _ as SignedObjectKind, $ as SignedObjectMaterial, a0 as SignedObjectProfileError, a1 as SignedObjectSchemaError, a2 as SignedObjectSignature, S as SignedObjectSigner, a3 as SignedObjectVerificationResult, a4 as SignedPolicyObject, a5 as SigningKeyBindingError, a6 as UnifiedContentSource, a7 as UnifiedEncryptionCapability, a8 as UnifiedKvCapability, a9 as UnifiedNativeCapability, aa as UnifiedPolicyCapability, ab as UnifiedPolicyV1, ac as UnifiedPolicyV2, ad as UnifiedResourceSelector, ae as UnsignedPolicy, U as UnsignedPolicyEngineRecord, af as UnsignedPolicyObject, ag as UnsignedPolicyStatus, ah as UnsignedUnifiedPolicyV2, ai as UnsupportedSignatureSuiteError, aj as admitPolicyCredentialV3, ak as buildPolicyCredentialPresentationV3, al as canonicalizeSignedObjectUnsigned, am as canonicalizeUnifiedPolicyCapability, an as compactAttenuationContains, ao as contentSourceDigestHex, ap as createAndSignPolicy, aq as createAndSignPolicyEngineRecord, ar as createAndSignPolicyStatus, as as createAndSignSignedObject, av as deriveSignedObjectMaterial, aw as getPolicyRootStatusV3, ay as normalizeUnifiedPolicyCapability, az as parseCompactUcanAuthorization, aA as parsePolicySessionUcan, aB as policyCidFromCanonicalBytes, aC as policyDigestHex, aD as policyIdForDigestHex, aE as policyV2DigestHex, aF as projectUnifiedPolicyCapabilities, aG as projectUnifiedPolicyCapability, aH as renewPolicyRootStatusV3, aJ as revokePolicyRootV3, aK as signCompactUcanAuthorization, aL as signCompactUcanRootAuthorization, aM as signedObjectIdFor, aN as toSignedObjectError, aO as unifiedNativeProjectionHashHex, aP as unifiedPolicyCapabilityContains, aQ as unifiedPolicyCapabilityDigestHex, aR as unifiedPolicyCapabilityFromNative, aS as validatePolicyCredentialRequirementV1, aT as validatePolicyEngineRecordSigned, aU as validatePolicyEngineRecordSignedShape, aV as validatePolicyEngineRecordUnsigned, aW as validatePolicySigned, aX as validatePolicySignedShape, aY as validatePolicyStatusSigned, aZ as validatePolicyStatusSignedShape, a_ as validatePolicyStatusUnsigned, a$ as validatePolicyUnsigned, b0 as validateUnifiedPolicyV2, b1 as verifyPolicy, b2 as verifyPolicyEngineRecord, b3 as verifyPolicyRootRevocationV3, b4 as verifyPolicyRootStatusCheckpointV3, b5 as verifyPolicyStatus, b6 as verifySignedObject } from './credential-admission-C_cO1QqB.cjs';
2
+ import { bj as CredentialHolderBinding, bk as CredentialFlowDescriptor, bl as CredentialRequirement, bm as StoredCredentialRecord, bn as VerifiedCredential, bo as CredentialStorageReceipt, bp as IssuedCredentialEnvelope, bq as CredentialIssuerMetadata } from './credential-admission-BVUC6kdw.cjs';
3
+ export { A as ATTESTED_ENFORCER_BINDING_V2_SCHEMA, b as AdmitPolicyCredentialV3Input, c as AdmitPolicyCredentialV4Input, B as BuildPolicyCredentialPresentationV3Input, d as BuildPolicyCredentialPresentationV4Input, C as CONTENT_SOURCE_V1_DOMAIN, br as CREDENTIAL_ACQUISITION_PROTOCOL, bs as CREDENTIAL_CONTRACT_VERSION, bt as CREDENTIAL_FORMAT, br as CREDENTIAL_PROTOCOL, bu as CREDENTIAL_STEP_REGISTRY_VERSION, f as CompactUcanAuthorizationV1, bv as CredentialClaimDescriptor, bw as CredentialEndpointId, bx as CredentialInputDescriptor, by as CredentialProgressEvent, bz as CredentialStepDescriptor, bA as CredentialStepType, bB as CredentialUxState, E as ED25519_JCS_SIGNATURE_SUITE, g as EIP191_JCS_SIGNATURE_SUITE, bC as HOLDER_BINDING_DOMAIN, bD as IssuerVerificationKey, J as JsonObject, L as LAST_V2_CREATE_AT, h as LAST_V2_READ_AT, M as MAX_LEGACY_ENVELOPE_EXPIRES_AT, N as NATIVE_PROJECTION_V1_DOMAIN, i as POLICY_CAPABILITY_V1_DOMAIN, j as POLICY_CAPABILITY_V1_SCHEMA, k as POLICY_CREDENTIAL_REQUIREMENT_V1_TYPE, l as POLICY_ENFORCEMENT_DELEGATION_V2_SCHEMA, m as POLICY_ENGINE_RECORD_SCHEMA, n as POLICY_PRESENTATION_V3_DOMAIN, o as POLICY_PRESENTATION_V3_SCHEMA, p as POLICY_PRESENTATION_V4_DOMAIN, q as POLICY_PRESENTATION_V4_SCHEMA, r as POLICY_SCHEMA, s as POLICY_SESSION_UCAN_V1_PROFILE, t as POLICY_STATUS_SCHEMA, u as POLICY_V1_DOMAIN, v as POLICY_V1_SCHEMA, w as POLICY_V2_DOMAIN, x as POLICY_V2_SCHEMA, a as Policy, z as PolicyCredentialAdmissionV3, D as PolicyCredentialAdmissionV4, F as PolicyCredentialPresentationV3, G as PolicyCredentialPresentationV4, H as PolicyCredentialRequirementV1, P as PolicyEngineRecord, I as PolicyRootStatusV3, K as PolicySessionUcanFactV1, O as PolicySessionUcanV1, Q as PolicyStatus, R as ROOT_REVOCATION_V1_DOMAIN, T as ROOT_REVOCATION_V1_SCHEMA, V as ROOT_STATUS_CHECKPOINT_V1_SCHEMA, W as ROOT_STATUS_RENEWAL_V1_DOMAIN, X as ROOT_STATUS_V1_DOMAIN, Y as SignCompactUcanAuthorizationInput, Z as SignCompactUcanRootAuthorizationInput, _ as SignatureMaterialError, $ as SignatureSuite, a0 as SignatureVerificationError, a1 as SignedObjectCanonicalizationError, a2 as SignedObjectDigestError, a3 as SignedObjectErrorCode, a4 as SignedObjectIdError, a5 as SignedObjectKind, a6 as SignedObjectMaterial, a7 as SignedObjectProfileError, a8 as SignedObjectSchemaError, a9 as SignedObjectSignature, S as SignedObjectSigner, aa as SignedObjectVerificationResult, ab as SignedPolicyObject, ac as SigningKeyBindingError, ad as UnifiedContentSource, ae as UnifiedEncryptionCapability, af as UnifiedKvCapability, ag as UnifiedNativeCapability, ah as UnifiedPolicyCapability, ai as UnifiedPolicyV1, aj as UnifiedPolicyV2, ak as UnifiedResourceSelector, al as UnsignedPolicy, am as UnsignedPolicyCredentialPresentationV4, U as UnsignedPolicyEngineRecord, an as UnsignedPolicyObject, ao as UnsignedPolicyStatus, ap as UnsignedUnifiedPolicyV2, aq as UnsupportedSignatureSuiteError, ar as admitPolicyCredentialV3, as as admitPolicyCredentialV4, at as buildPolicyCredentialPresentationV3, au as buildPolicyCredentialPresentationV4, av as canonicalizeSignedObjectUnsigned, aw as canonicalizeUnifiedPolicyCapability, ax as compactAttenuationContains, ay as contentSourceDigestHex, az as createAndSignPolicy, aA as createAndSignPolicyEngineRecord, aB as createAndSignPolicyStatus, aC as createAndSignSignedObject, aF as deriveSignedObjectMaterial, aG as getPolicyRootStatusV3, aH as issuedCredentialEnvelopeFromVerified, aJ as normalizeUnifiedPolicyCapability, aK as parseCompactUcanAuthorization, aL as parsePolicySessionUcan, aM as policyCidFromCanonicalBytes, aN as policyDigestHex, aO as policyIdForDigestHex, aP as policyV2DigestHex, aQ as projectUnifiedPolicyCapabilities, aR as projectUnifiedPolicyCapability, aS as renewPolicyRootStatusV3, aU as revokePolicyRootV3, aV as signCompactUcanAuthorization, aW as signCompactUcanRootAuthorization, aX as signPolicyCredentialPresentationV4, aY as signedObjectIdFor, aZ as toSignedObjectError, a_ as unifiedNativeProjectionHashHex, a$ as unifiedPolicyCapabilityContains, b0 as unifiedPolicyCapabilityDigestHex, b1 as unifiedPolicyCapabilityFromNative, b2 as validatePolicyCredentialRequirementV1, b3 as validatePolicyEngineRecordSigned, b4 as validatePolicyEngineRecordSignedShape, b5 as validatePolicyEngineRecordUnsigned, b6 as validatePolicySigned, b7 as validatePolicySignedShape, b8 as validatePolicyStatusSigned, b9 as validatePolicyStatusSignedShape, ba as validatePolicyStatusUnsigned, bb as validatePolicyUnsigned, bc as validateUnifiedPolicyV2, bd as verifyPolicy, be as verifyPolicyEngineRecord, bf as verifyPolicyRootRevocationV3, bg as verifyPolicyRootStatusCheckpointV3, bh as verifyPolicyStatus, bi as verifySignedObject } from './credential-admission-BVUC6kdw.cjs';
4
4
  import { InvokeFunction, InvokeAnyFunction, ParsedNetworkId, ServiceError, Result, FetchFunction, ServiceConstructor, RetryPolicy, TelemetryConfig, IServiceContext, IService, IKVService, ISQLService, IDuckDbService, IHooksService, IDataVaultService, IEncryptionService, ISecretsService, ServiceSession, IDatabaseHandle, SqlValue, QueryResponse } from '@tinycloud/sdk-services';
5
5
  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, KVBatchReadResponse, 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';
6
6
  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.cjs';
@@ -224,6 +224,12 @@ declare class CredentialError extends Error {
224
224
  }
225
225
  declare function credentialError(value: unknown, fallbackCode?: CredentialErrorCode): CredentialError;
226
226
 
227
+ declare const EMAIL_CREDENTIAL_MAX_AGE_SECONDS: 3600;
228
+ declare function createEmailCredentialRequirement(input: {
229
+ readonly email: string;
230
+ readonly profile: CredentialRequirement["profile"];
231
+ readonly credentialType: CredentialRequirement["credentialType"];
232
+ }): CredentialRequirement;
227
233
  declare function validateCredentialRequirement(value: unknown): CredentialRequirement;
228
234
  declare function credentialRequirementDigest(requirement: CredentialRequirement): Promise<string>;
229
235
  declare function descriptorSatisfiesRequirement(descriptor: CredentialFlowDescriptor, requirement: CredentialRequirement): boolean;
@@ -3429,4 +3435,4 @@ declare const EXPIRY: {
3429
3435
  declare const DEFAULT_SIGNED_READ_URL_EXPIRY_MS: number;
3430
3436
  type ExpiryTier = keyof typeof EXPIRY;
3431
3437
 
3432
- export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, type AbilitiesMap, type AccountApplication, type AccountApplicationListOptions, type AccountApplicationRegisterOptions, type AccountDelegation, type AccountDelegationListOptions, AccountDelegationPage, AccountDelegationQueryOptions, 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, CREDENTIAL_ERROR_CODES, type CallbackStrategy, type CanonicalAddress, type CanonicalParsedNetworkId, type CanonicalTinyCloudIdentity, type CapabilityPresentationEnvelopeV1, CaveatedDelegationUnsupportedError, type ClientSession, ClientSessionSchema, CloudLocationResolutionError, type ComposeManifestOptions, type ComposedManifestRequest, type CreateDelegationFunction, CreateDelegationParams, CredentialError, type CredentialErrorCode, CredentialFlowDescriptor, CredentialHolderBinding, CredentialIssuerMetadata, CredentialRequirement, CredentialStorageReceipt, DEFAULT_DEFAULTS, DEFAULT_EXPIRY, DEFAULT_KNOWLEDGE_ROOT, DEFAULT_LOCAL_NODE_PIN_STORAGE_KEY, DEFAULT_LOCAL_NODE_URL, DEFAULT_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, DEFAULT_SIGNED_READ_URL_EXPIRY_MS, DEFAULT_TINYCLOUD_FALLBACK_HOST, DEFAULT_TINYCLOUD_LOCATION_REGISTRY_URL, Delegation, DelegationManager, DelegationRevocationReceipt, type DidCacheKeyOptions, type DidEqualsOptions, type DiscoverLocalTinyCloudNodeOptions, type DiscoveredLocalTinyCloudNode, ENCRYPTION_MANIFEST_SPACE, ENCRYPTION_PERMISSION_SERVICE, EXPIRY, type EnsData, EnsDataSchema, type EventEmitterStrategy, type ExpiryTier, type Extension, GenerateShareParams, ICapabilityKeyRegistry, type IENSResolver, type INotificationHandler, type ISessionManager, type ISessionStorage, ISharingService, type ISigner, type ISpace, type ISpaceCreationHandler, type ISpaceScopedDelegations, type ISpaceScopedSharing, type ISpaceService, type IUserAuthorization, type IWasmBindings, IdentityParseError, type ImmutableSiweFields, IssuedCredentialEnvelope, LOCAL_LINK_HOST_SUFFIX, LOCAL_LINK_PROBE_TIMEOUT_MS, LOCAL_LOOPBACK_PROBE_TIMEOUT_MS, type LocalNodeIdentityStore, 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, OPENKEY_ACTION_ID_SEPARATOR, type OpenKeyCallbackStrategy, type OpenKeyManageKeyCallbackStrategy, OpenKeyManageKeyError, type OpenKeyManageKeyErrorCode, type OpenKeyManageKeyFetch, type OpenKeyManageKeySigningRequestBody, type OpenKeyManageKeySigningResponseBody, type OpenKeyManageKeySigningStrategyOptions, type OpenKeySigningRequestBody, type OpenKeySigningResponseBody, type OpenKeySigningStrategyOptions, type ParseRecapFromSiwe, type PartialSiweMessage, type PermissionEntry, PermissionNotInManifestError, type PersistedSessionData, type PersistedSessionProof, type PersistedTinyCloudSession, type PkhDidParts, ProtocolMismatchError, type RecapAttenuation, type RegisterBatchSuccess, 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, ShareLink, 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, SpaceInfo, SpaceService, type SpaceServiceConfig, StoredCredentialRecord, type SubsetCheckResult, TINYCLOUD_CANONICAL_IDENTITY_CLAIM, TINYCLOUD_MANAGE_KEY_SCOPE, TinyCloud, type TinyCloudAuthorizationRequestV1, type TinyCloudAuthorizationResultV1, type TinyCloudConfig, type TinyCloudEffectiveGrantV1, type TinyCloudSession, UnsupportedFeatureError, type UserAuthorizationConfig, VAULT_PERMISSION_SERVICE, type ValidatedPersistedSessionProof, type ValidationError, VerifiedCredential, VersionCheckError, type WasmRecapEntry, type WebStorageLike, actionContains, activateSessionWithHost, addressStorageKey, applyPrefix, buildSpaceUri, canonicalDigest, canonicalLocationPayload, canonicalizeAddress, canonicalizeDid, canonicalizeDidUrl, canonicalizeNetworkId, canonicalizeRecapCaveats, checkNodeInfo, composeManifestRequest, createHolderBinding, createInMemoryLocalNodeIdentityStore, createLocalStorageLocalNodeIdentityStore, createOpenKeyCallbackSigningStrategy, createOpenKeyManageKeySigningStrategy, createSpaceService, createStorageReceipt, createStoredCredentialRecord, credentialEndpointPath, credentialError, credentialIndexKey, credentialMatchesRequirement, credentialRecordKey, credentialRequirementDigest, decodeBase64Url, defaultSignStrategy, defaultSpaceCreationHandler, descriptorSatisfiesRequirement, didCacheKey, didEquals, diffImmutableSiweFields, discoverLocalTinyCloudNode, encodeBase64Url, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, extractImmutableSiweFields, extractRecapAttenuations, fetchLocationRecord, fetchPeerId, hasTinyCloudManageKeyScope, holderBindingCanonicalBytes, holderBindingSigningBytes, httpUrlToMultiaddr, isCapabilitySubset, isDigest, isEvmAddress, isPlausibleOpenKeyActionId, loadManifest, locationPayloadForRecord, makePkhSpaceId, makePublicSpaceId, manifestAbilitiesUnion, multiaddrToHttpUrl, normalizeDefaults, parseCanonicalNetworkId, parseCanonicalRecapResource, parseCanonicalTinyCloudIdentity, parseCanonicalTinyCloudIdentityClaims, parseExpiry, parsePkhDid, parseRecapCapabilities, parseSpaceUri, pkhDid, principalDid, principalDidEquals, recapCaveatsEqual, requestTinyCloudManageKeyScope, resolveCloudLocation, resolveManifest, resolveManifestKnowledgeRoot, resolveTinyCloudHosts, resourceCapabilitiesToAbilitiesMap, resourceCapabilitiesToSpaceAbilitiesMap, sha256Base64Url, signLocationRecord, submitHostDelegation, unauthorizedRecapCapabilities, validateAuthorizationResultV1, validateClientSession, validateCredentialFlowDescriptor, validateCredentialHolderBinding, validateCredentialRequirement, validateLocationRecord, validateLocationRecordPayload, validateManifest, validatePersistedSessionData, verifyDidKeyEd25519Signature, verifyEip191MessageSignature, verifyIssuedCredential, verifyLocationRecord, verifyStorageReceipt };
3438
+ export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, type AbilitiesMap, type AccountApplication, type AccountApplicationListOptions, type AccountApplicationRegisterOptions, type AccountDelegation, type AccountDelegationListOptions, AccountDelegationPage, AccountDelegationQueryOptions, 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, CREDENTIAL_ERROR_CODES, type CallbackStrategy, type CanonicalAddress, type CanonicalParsedNetworkId, type CanonicalTinyCloudIdentity, type CapabilityPresentationEnvelopeV1, CaveatedDelegationUnsupportedError, type ClientSession, ClientSessionSchema, CloudLocationResolutionError, type ComposeManifestOptions, type ComposedManifestRequest, type CreateDelegationFunction, CreateDelegationParams, CredentialError, type CredentialErrorCode, CredentialFlowDescriptor, CredentialHolderBinding, CredentialIssuerMetadata, CredentialRequirement, CredentialStorageReceipt, DEFAULT_DEFAULTS, DEFAULT_EXPIRY, DEFAULT_KNOWLEDGE_ROOT, DEFAULT_LOCAL_NODE_PIN_STORAGE_KEY, DEFAULT_LOCAL_NODE_URL, DEFAULT_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, DEFAULT_SIGNED_READ_URL_EXPIRY_MS, DEFAULT_TINYCLOUD_FALLBACK_HOST, DEFAULT_TINYCLOUD_LOCATION_REGISTRY_URL, Delegation, DelegationManager, DelegationRevocationReceipt, type DidCacheKeyOptions, type DidEqualsOptions, type DiscoverLocalTinyCloudNodeOptions, type DiscoveredLocalTinyCloudNode, EMAIL_CREDENTIAL_MAX_AGE_SECONDS, ENCRYPTION_MANIFEST_SPACE, ENCRYPTION_PERMISSION_SERVICE, EXPIRY, type EnsData, EnsDataSchema, type EventEmitterStrategy, type ExpiryTier, type Extension, GenerateShareParams, ICapabilityKeyRegistry, type IENSResolver, type INotificationHandler, type ISessionManager, type ISessionStorage, ISharingService, type ISigner, type ISpace, type ISpaceCreationHandler, type ISpaceScopedDelegations, type ISpaceScopedSharing, type ISpaceService, type IUserAuthorization, type IWasmBindings, IdentityParseError, type ImmutableSiweFields, IssuedCredentialEnvelope, LOCAL_LINK_HOST_SUFFIX, LOCAL_LINK_PROBE_TIMEOUT_MS, LOCAL_LOOPBACK_PROBE_TIMEOUT_MS, type LocalNodeIdentityStore, 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, OPENKEY_ACTION_ID_SEPARATOR, type OpenKeyCallbackStrategy, type OpenKeyManageKeyCallbackStrategy, OpenKeyManageKeyError, type OpenKeyManageKeyErrorCode, type OpenKeyManageKeyFetch, type OpenKeyManageKeySigningRequestBody, type OpenKeyManageKeySigningResponseBody, type OpenKeyManageKeySigningStrategyOptions, type OpenKeySigningRequestBody, type OpenKeySigningResponseBody, type OpenKeySigningStrategyOptions, type ParseRecapFromSiwe, type PartialSiweMessage, type PermissionEntry, PermissionNotInManifestError, type PersistedSessionData, type PersistedSessionProof, type PersistedTinyCloudSession, type PkhDidParts, ProtocolMismatchError, type RecapAttenuation, type RegisterBatchSuccess, 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, ShareLink, 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, SpaceInfo, SpaceService, type SpaceServiceConfig, StoredCredentialRecord, type SubsetCheckResult, TINYCLOUD_CANONICAL_IDENTITY_CLAIM, TINYCLOUD_MANAGE_KEY_SCOPE, TinyCloud, type TinyCloudAuthorizationRequestV1, type TinyCloudAuthorizationResultV1, type TinyCloudConfig, type TinyCloudEffectiveGrantV1, type TinyCloudSession, UnsupportedFeatureError, type UserAuthorizationConfig, VAULT_PERMISSION_SERVICE, type ValidatedPersistedSessionProof, type ValidationError, VerifiedCredential, VersionCheckError, type WasmRecapEntry, type WebStorageLike, actionContains, activateSessionWithHost, addressStorageKey, applyPrefix, buildSpaceUri, canonicalDigest, canonicalLocationPayload, canonicalizeAddress, canonicalizeDid, canonicalizeDidUrl, canonicalizeNetworkId, canonicalizeRecapCaveats, checkNodeInfo, composeManifestRequest, createEmailCredentialRequirement, createHolderBinding, createInMemoryLocalNodeIdentityStore, createLocalStorageLocalNodeIdentityStore, createOpenKeyCallbackSigningStrategy, createOpenKeyManageKeySigningStrategy, createSpaceService, createStorageReceipt, createStoredCredentialRecord, credentialEndpointPath, credentialError, credentialIndexKey, credentialMatchesRequirement, credentialRecordKey, credentialRequirementDigest, decodeBase64Url, defaultSignStrategy, defaultSpaceCreationHandler, descriptorSatisfiesRequirement, didCacheKey, didEquals, diffImmutableSiweFields, discoverLocalTinyCloudNode, encodeBase64Url, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, extractImmutableSiweFields, extractRecapAttenuations, fetchLocationRecord, fetchPeerId, hasTinyCloudManageKeyScope, holderBindingCanonicalBytes, holderBindingSigningBytes, httpUrlToMultiaddr, isCapabilitySubset, isDigest, isEvmAddress, isPlausibleOpenKeyActionId, loadManifest, locationPayloadForRecord, makePkhSpaceId, makePublicSpaceId, manifestAbilitiesUnion, multiaddrToHttpUrl, normalizeDefaults, parseCanonicalNetworkId, parseCanonicalRecapResource, parseCanonicalTinyCloudIdentity, parseCanonicalTinyCloudIdentityClaims, parseExpiry, parsePkhDid, parseRecapCapabilities, parseSpaceUri, pkhDid, principalDid, principalDidEquals, recapCaveatsEqual, requestTinyCloudManageKeyScope, resolveCloudLocation, resolveManifest, resolveManifestKnowledgeRoot, resolveTinyCloudHosts, resourceCapabilitiesToAbilitiesMap, resourceCapabilitiesToSpaceAbilitiesMap, sha256Base64Url, signLocationRecord, submitHostDelegation, unauthorizedRecapCapabilities, validateAuthorizationResultV1, validateClientSession, validateCredentialFlowDescriptor, validateCredentialHolderBinding, validateCredentialRequirement, validateLocationRecord, validateLocationRecordPayload, validateManifest, validatePersistedSessionData, verifyDidKeyEd25519Signature, verifyEip191MessageSignature, verifyIssuedCredential, verifyLocationRecord, verifyStorageReceipt };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
- import { b7 as CredentialHolderBinding, b8 as CredentialFlowDescriptor, b9 as CredentialRequirement, ba as StoredCredentialRecord, bb as VerifiedCredential, bc as CredentialStorageReceipt, bd as IssuedCredentialEnvelope, be as CredentialIssuerMetadata } from './credential-admission-cvHe-HUC.js';
3
- export { A as ATTESTED_ENFORCER_BINDING_V2_SCHEMA, b as AdmitPolicyCredentialV3Input, B as BuildPolicyCredentialPresentationV3Input, C as CONTENT_SOURCE_V1_DOMAIN, bf as CREDENTIAL_ACQUISITION_PROTOCOL, bg as CREDENTIAL_CONTRACT_VERSION, bh as CREDENTIAL_FORMAT, bf as CREDENTIAL_PROTOCOL, bi as CREDENTIAL_STEP_REGISTRY_VERSION, d as CompactUcanAuthorizationV1, bj as CredentialClaimDescriptor, bk as CredentialEndpointId, bl as CredentialInputDescriptor, bm as CredentialProgressEvent, bn as CredentialStepDescriptor, bo as CredentialStepType, bp as CredentialUxState, E as ED25519_JCS_SIGNATURE_SUITE, e as EIP191_JCS_SIGNATURE_SUITE, bq as HOLDER_BINDING_DOMAIN, br as IssuerVerificationKey, J as JsonObject, L as LAST_V2_CREATE_AT, f as LAST_V2_READ_AT, M as MAX_LEGACY_ENVELOPE_EXPIRES_AT, N as NATIVE_PROJECTION_V1_DOMAIN, g as POLICY_CAPABILITY_V1_DOMAIN, h as POLICY_CAPABILITY_V1_SCHEMA, i as POLICY_CREDENTIAL_REQUIREMENT_V1_TYPE, j as POLICY_ENFORCEMENT_DELEGATION_V2_SCHEMA, k as POLICY_ENGINE_RECORD_SCHEMA, l as POLICY_PRESENTATION_V3_DOMAIN, m as POLICY_PRESENTATION_V3_SCHEMA, n as POLICY_SCHEMA, o as POLICY_SESSION_UCAN_V1_PROFILE, p as POLICY_STATUS_SCHEMA, q as POLICY_V1_DOMAIN, r as POLICY_V1_SCHEMA, s as POLICY_V2_DOMAIN, t as POLICY_V2_SCHEMA, a as Policy, v as PolicyCredentialAdmissionV3, w as PolicyCredentialPresentationV3, x as PolicyCredentialRequirementV1, P as PolicyEngineRecord, y as PolicyRootStatusV3, z as PolicySessionUcanV1, D as PolicyStatus, R as ROOT_REVOCATION_V1_DOMAIN, F as ROOT_REVOCATION_V1_SCHEMA, G as ROOT_STATUS_CHECKPOINT_V1_SCHEMA, H as ROOT_STATUS_RENEWAL_V1_DOMAIN, I as ROOT_STATUS_V1_DOMAIN, K as SignCompactUcanAuthorizationInput, O as SignCompactUcanRootAuthorizationInput, Q as SignatureMaterialError, T as SignatureSuite, V as SignatureVerificationError, W as SignedObjectCanonicalizationError, X as SignedObjectDigestError, Y as SignedObjectErrorCode, Z as SignedObjectIdError, _ as SignedObjectKind, $ as SignedObjectMaterial, a0 as SignedObjectProfileError, a1 as SignedObjectSchemaError, a2 as SignedObjectSignature, S as SignedObjectSigner, a3 as SignedObjectVerificationResult, a4 as SignedPolicyObject, a5 as SigningKeyBindingError, a6 as UnifiedContentSource, a7 as UnifiedEncryptionCapability, a8 as UnifiedKvCapability, a9 as UnifiedNativeCapability, aa as UnifiedPolicyCapability, ab as UnifiedPolicyV1, ac as UnifiedPolicyV2, ad as UnifiedResourceSelector, ae as UnsignedPolicy, U as UnsignedPolicyEngineRecord, af as UnsignedPolicyObject, ag as UnsignedPolicyStatus, ah as UnsignedUnifiedPolicyV2, ai as UnsupportedSignatureSuiteError, aj as admitPolicyCredentialV3, ak as buildPolicyCredentialPresentationV3, al as canonicalizeSignedObjectUnsigned, am as canonicalizeUnifiedPolicyCapability, an as compactAttenuationContains, ao as contentSourceDigestHex, ap as createAndSignPolicy, aq as createAndSignPolicyEngineRecord, ar as createAndSignPolicyStatus, as as createAndSignSignedObject, av as deriveSignedObjectMaterial, aw as getPolicyRootStatusV3, ay as normalizeUnifiedPolicyCapability, az as parseCompactUcanAuthorization, aA as parsePolicySessionUcan, aB as policyCidFromCanonicalBytes, aC as policyDigestHex, aD as policyIdForDigestHex, aE as policyV2DigestHex, aF as projectUnifiedPolicyCapabilities, aG as projectUnifiedPolicyCapability, aH as renewPolicyRootStatusV3, aJ as revokePolicyRootV3, aK as signCompactUcanAuthorization, aL as signCompactUcanRootAuthorization, aM as signedObjectIdFor, aN as toSignedObjectError, aO as unifiedNativeProjectionHashHex, aP as unifiedPolicyCapabilityContains, aQ as unifiedPolicyCapabilityDigestHex, aR as unifiedPolicyCapabilityFromNative, aS as validatePolicyCredentialRequirementV1, aT as validatePolicyEngineRecordSigned, aU as validatePolicyEngineRecordSignedShape, aV as validatePolicyEngineRecordUnsigned, aW as validatePolicySigned, aX as validatePolicySignedShape, aY as validatePolicyStatusSigned, aZ as validatePolicyStatusSignedShape, a_ as validatePolicyStatusUnsigned, a$ as validatePolicyUnsigned, b0 as validateUnifiedPolicyV2, b1 as verifyPolicy, b2 as verifyPolicyEngineRecord, b3 as verifyPolicyRootRevocationV3, b4 as verifyPolicyRootStatusCheckpointV3, b5 as verifyPolicyStatus, b6 as verifySignedObject } from './credential-admission-cvHe-HUC.js';
2
+ import { bj as CredentialHolderBinding, bk as CredentialFlowDescriptor, bl as CredentialRequirement, bm as StoredCredentialRecord, bn as VerifiedCredential, bo as CredentialStorageReceipt, bp as IssuedCredentialEnvelope, bq as CredentialIssuerMetadata } from './credential-admission-BgvwOTIV.js';
3
+ export { A as ATTESTED_ENFORCER_BINDING_V2_SCHEMA, b as AdmitPolicyCredentialV3Input, c as AdmitPolicyCredentialV4Input, B as BuildPolicyCredentialPresentationV3Input, d as BuildPolicyCredentialPresentationV4Input, C as CONTENT_SOURCE_V1_DOMAIN, br as CREDENTIAL_ACQUISITION_PROTOCOL, bs as CREDENTIAL_CONTRACT_VERSION, bt as CREDENTIAL_FORMAT, br as CREDENTIAL_PROTOCOL, bu as CREDENTIAL_STEP_REGISTRY_VERSION, f as CompactUcanAuthorizationV1, bv as CredentialClaimDescriptor, bw as CredentialEndpointId, bx as CredentialInputDescriptor, by as CredentialProgressEvent, bz as CredentialStepDescriptor, bA as CredentialStepType, bB as CredentialUxState, E as ED25519_JCS_SIGNATURE_SUITE, g as EIP191_JCS_SIGNATURE_SUITE, bC as HOLDER_BINDING_DOMAIN, bD as IssuerVerificationKey, J as JsonObject, L as LAST_V2_CREATE_AT, h as LAST_V2_READ_AT, M as MAX_LEGACY_ENVELOPE_EXPIRES_AT, N as NATIVE_PROJECTION_V1_DOMAIN, i as POLICY_CAPABILITY_V1_DOMAIN, j as POLICY_CAPABILITY_V1_SCHEMA, k as POLICY_CREDENTIAL_REQUIREMENT_V1_TYPE, l as POLICY_ENFORCEMENT_DELEGATION_V2_SCHEMA, m as POLICY_ENGINE_RECORD_SCHEMA, n as POLICY_PRESENTATION_V3_DOMAIN, o as POLICY_PRESENTATION_V3_SCHEMA, p as POLICY_PRESENTATION_V4_DOMAIN, q as POLICY_PRESENTATION_V4_SCHEMA, r as POLICY_SCHEMA, s as POLICY_SESSION_UCAN_V1_PROFILE, t as POLICY_STATUS_SCHEMA, u as POLICY_V1_DOMAIN, v as POLICY_V1_SCHEMA, w as POLICY_V2_DOMAIN, x as POLICY_V2_SCHEMA, a as Policy, z as PolicyCredentialAdmissionV3, D as PolicyCredentialAdmissionV4, F as PolicyCredentialPresentationV3, G as PolicyCredentialPresentationV4, H as PolicyCredentialRequirementV1, P as PolicyEngineRecord, I as PolicyRootStatusV3, K as PolicySessionUcanFactV1, O as PolicySessionUcanV1, Q as PolicyStatus, R as ROOT_REVOCATION_V1_DOMAIN, T as ROOT_REVOCATION_V1_SCHEMA, V as ROOT_STATUS_CHECKPOINT_V1_SCHEMA, W as ROOT_STATUS_RENEWAL_V1_DOMAIN, X as ROOT_STATUS_V1_DOMAIN, Y as SignCompactUcanAuthorizationInput, Z as SignCompactUcanRootAuthorizationInput, _ as SignatureMaterialError, $ as SignatureSuite, a0 as SignatureVerificationError, a1 as SignedObjectCanonicalizationError, a2 as SignedObjectDigestError, a3 as SignedObjectErrorCode, a4 as SignedObjectIdError, a5 as SignedObjectKind, a6 as SignedObjectMaterial, a7 as SignedObjectProfileError, a8 as SignedObjectSchemaError, a9 as SignedObjectSignature, S as SignedObjectSigner, aa as SignedObjectVerificationResult, ab as SignedPolicyObject, ac as SigningKeyBindingError, ad as UnifiedContentSource, ae as UnifiedEncryptionCapability, af as UnifiedKvCapability, ag as UnifiedNativeCapability, ah as UnifiedPolicyCapability, ai as UnifiedPolicyV1, aj as UnifiedPolicyV2, ak as UnifiedResourceSelector, al as UnsignedPolicy, am as UnsignedPolicyCredentialPresentationV4, U as UnsignedPolicyEngineRecord, an as UnsignedPolicyObject, ao as UnsignedPolicyStatus, ap as UnsignedUnifiedPolicyV2, aq as UnsupportedSignatureSuiteError, ar as admitPolicyCredentialV3, as as admitPolicyCredentialV4, at as buildPolicyCredentialPresentationV3, au as buildPolicyCredentialPresentationV4, av as canonicalizeSignedObjectUnsigned, aw as canonicalizeUnifiedPolicyCapability, ax as compactAttenuationContains, ay as contentSourceDigestHex, az as createAndSignPolicy, aA as createAndSignPolicyEngineRecord, aB as createAndSignPolicyStatus, aC as createAndSignSignedObject, aF as deriveSignedObjectMaterial, aG as getPolicyRootStatusV3, aH as issuedCredentialEnvelopeFromVerified, aJ as normalizeUnifiedPolicyCapability, aK as parseCompactUcanAuthorization, aL as parsePolicySessionUcan, aM as policyCidFromCanonicalBytes, aN as policyDigestHex, aO as policyIdForDigestHex, aP as policyV2DigestHex, aQ as projectUnifiedPolicyCapabilities, aR as projectUnifiedPolicyCapability, aS as renewPolicyRootStatusV3, aU as revokePolicyRootV3, aV as signCompactUcanAuthorization, aW as signCompactUcanRootAuthorization, aX as signPolicyCredentialPresentationV4, aY as signedObjectIdFor, aZ as toSignedObjectError, a_ as unifiedNativeProjectionHashHex, a$ as unifiedPolicyCapabilityContains, b0 as unifiedPolicyCapabilityDigestHex, b1 as unifiedPolicyCapabilityFromNative, b2 as validatePolicyCredentialRequirementV1, b3 as validatePolicyEngineRecordSigned, b4 as validatePolicyEngineRecordSignedShape, b5 as validatePolicyEngineRecordUnsigned, b6 as validatePolicySigned, b7 as validatePolicySignedShape, b8 as validatePolicyStatusSigned, b9 as validatePolicyStatusSignedShape, ba as validatePolicyStatusUnsigned, bb as validatePolicyUnsigned, bc as validateUnifiedPolicyV2, bd as verifyPolicy, be as verifyPolicyEngineRecord, bf as verifyPolicyRootRevocationV3, bg as verifyPolicyRootStatusCheckpointV3, bh as verifyPolicyStatus, bi as verifySignedObject } from './credential-admission-BgvwOTIV.js';
4
4
  import { InvokeFunction, InvokeAnyFunction, ParsedNetworkId, ServiceError, Result, FetchFunction, ServiceConstructor, RetryPolicy, TelemetryConfig, IServiceContext, IService, IKVService, ISQLService, IDuckDbService, IHooksService, IDataVaultService, IEncryptionService, ISecretsService, ServiceSession, IDatabaseHandle, SqlValue, QueryResponse } from '@tinycloud/sdk-services';
5
5
  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, KVBatchReadResponse, 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';
6
6
  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';
@@ -224,6 +224,12 @@ declare class CredentialError extends Error {
224
224
  }
225
225
  declare function credentialError(value: unknown, fallbackCode?: CredentialErrorCode): CredentialError;
226
226
 
227
+ declare const EMAIL_CREDENTIAL_MAX_AGE_SECONDS: 3600;
228
+ declare function createEmailCredentialRequirement(input: {
229
+ readonly email: string;
230
+ readonly profile: CredentialRequirement["profile"];
231
+ readonly credentialType: CredentialRequirement["credentialType"];
232
+ }): CredentialRequirement;
227
233
  declare function validateCredentialRequirement(value: unknown): CredentialRequirement;
228
234
  declare function credentialRequirementDigest(requirement: CredentialRequirement): Promise<string>;
229
235
  declare function descriptorSatisfiesRequirement(descriptor: CredentialFlowDescriptor, requirement: CredentialRequirement): boolean;
@@ -3429,4 +3435,4 @@ declare const EXPIRY: {
3429
3435
  declare const DEFAULT_SIGNED_READ_URL_EXPIRY_MS: number;
3430
3436
  type ExpiryTier = keyof typeof EXPIRY;
3431
3437
 
3432
- export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, type AbilitiesMap, type AccountApplication, type AccountApplicationListOptions, type AccountApplicationRegisterOptions, type AccountDelegation, type AccountDelegationListOptions, AccountDelegationPage, AccountDelegationQueryOptions, 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, CREDENTIAL_ERROR_CODES, type CallbackStrategy, type CanonicalAddress, type CanonicalParsedNetworkId, type CanonicalTinyCloudIdentity, type CapabilityPresentationEnvelopeV1, CaveatedDelegationUnsupportedError, type ClientSession, ClientSessionSchema, CloudLocationResolutionError, type ComposeManifestOptions, type ComposedManifestRequest, type CreateDelegationFunction, CreateDelegationParams, CredentialError, type CredentialErrorCode, CredentialFlowDescriptor, CredentialHolderBinding, CredentialIssuerMetadata, CredentialRequirement, CredentialStorageReceipt, DEFAULT_DEFAULTS, DEFAULT_EXPIRY, DEFAULT_KNOWLEDGE_ROOT, DEFAULT_LOCAL_NODE_PIN_STORAGE_KEY, DEFAULT_LOCAL_NODE_URL, DEFAULT_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, DEFAULT_SIGNED_READ_URL_EXPIRY_MS, DEFAULT_TINYCLOUD_FALLBACK_HOST, DEFAULT_TINYCLOUD_LOCATION_REGISTRY_URL, Delegation, DelegationManager, DelegationRevocationReceipt, type DidCacheKeyOptions, type DidEqualsOptions, type DiscoverLocalTinyCloudNodeOptions, type DiscoveredLocalTinyCloudNode, ENCRYPTION_MANIFEST_SPACE, ENCRYPTION_PERMISSION_SERVICE, EXPIRY, type EnsData, EnsDataSchema, type EventEmitterStrategy, type ExpiryTier, type Extension, GenerateShareParams, ICapabilityKeyRegistry, type IENSResolver, type INotificationHandler, type ISessionManager, type ISessionStorage, ISharingService, type ISigner, type ISpace, type ISpaceCreationHandler, type ISpaceScopedDelegations, type ISpaceScopedSharing, type ISpaceService, type IUserAuthorization, type IWasmBindings, IdentityParseError, type ImmutableSiweFields, IssuedCredentialEnvelope, LOCAL_LINK_HOST_SUFFIX, LOCAL_LINK_PROBE_TIMEOUT_MS, LOCAL_LOOPBACK_PROBE_TIMEOUT_MS, type LocalNodeIdentityStore, 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, OPENKEY_ACTION_ID_SEPARATOR, type OpenKeyCallbackStrategy, type OpenKeyManageKeyCallbackStrategy, OpenKeyManageKeyError, type OpenKeyManageKeyErrorCode, type OpenKeyManageKeyFetch, type OpenKeyManageKeySigningRequestBody, type OpenKeyManageKeySigningResponseBody, type OpenKeyManageKeySigningStrategyOptions, type OpenKeySigningRequestBody, type OpenKeySigningResponseBody, type OpenKeySigningStrategyOptions, type ParseRecapFromSiwe, type PartialSiweMessage, type PermissionEntry, PermissionNotInManifestError, type PersistedSessionData, type PersistedSessionProof, type PersistedTinyCloudSession, type PkhDidParts, ProtocolMismatchError, type RecapAttenuation, type RegisterBatchSuccess, 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, ShareLink, 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, SpaceInfo, SpaceService, type SpaceServiceConfig, StoredCredentialRecord, type SubsetCheckResult, TINYCLOUD_CANONICAL_IDENTITY_CLAIM, TINYCLOUD_MANAGE_KEY_SCOPE, TinyCloud, type TinyCloudAuthorizationRequestV1, type TinyCloudAuthorizationResultV1, type TinyCloudConfig, type TinyCloudEffectiveGrantV1, type TinyCloudSession, UnsupportedFeatureError, type UserAuthorizationConfig, VAULT_PERMISSION_SERVICE, type ValidatedPersistedSessionProof, type ValidationError, VerifiedCredential, VersionCheckError, type WasmRecapEntry, type WebStorageLike, actionContains, activateSessionWithHost, addressStorageKey, applyPrefix, buildSpaceUri, canonicalDigest, canonicalLocationPayload, canonicalizeAddress, canonicalizeDid, canonicalizeDidUrl, canonicalizeNetworkId, canonicalizeRecapCaveats, checkNodeInfo, composeManifestRequest, createHolderBinding, createInMemoryLocalNodeIdentityStore, createLocalStorageLocalNodeIdentityStore, createOpenKeyCallbackSigningStrategy, createOpenKeyManageKeySigningStrategy, createSpaceService, createStorageReceipt, createStoredCredentialRecord, credentialEndpointPath, credentialError, credentialIndexKey, credentialMatchesRequirement, credentialRecordKey, credentialRequirementDigest, decodeBase64Url, defaultSignStrategy, defaultSpaceCreationHandler, descriptorSatisfiesRequirement, didCacheKey, didEquals, diffImmutableSiweFields, discoverLocalTinyCloudNode, encodeBase64Url, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, extractImmutableSiweFields, extractRecapAttenuations, fetchLocationRecord, fetchPeerId, hasTinyCloudManageKeyScope, holderBindingCanonicalBytes, holderBindingSigningBytes, httpUrlToMultiaddr, isCapabilitySubset, isDigest, isEvmAddress, isPlausibleOpenKeyActionId, loadManifest, locationPayloadForRecord, makePkhSpaceId, makePublicSpaceId, manifestAbilitiesUnion, multiaddrToHttpUrl, normalizeDefaults, parseCanonicalNetworkId, parseCanonicalRecapResource, parseCanonicalTinyCloudIdentity, parseCanonicalTinyCloudIdentityClaims, parseExpiry, parsePkhDid, parseRecapCapabilities, parseSpaceUri, pkhDid, principalDid, principalDidEquals, recapCaveatsEqual, requestTinyCloudManageKeyScope, resolveCloudLocation, resolveManifest, resolveManifestKnowledgeRoot, resolveTinyCloudHosts, resourceCapabilitiesToAbilitiesMap, resourceCapabilitiesToSpaceAbilitiesMap, sha256Base64Url, signLocationRecord, submitHostDelegation, unauthorizedRecapCapabilities, validateAuthorizationResultV1, validateClientSession, validateCredentialFlowDescriptor, validateCredentialHolderBinding, validateCredentialRequirement, validateLocationRecord, validateLocationRecordPayload, validateManifest, validatePersistedSessionData, verifyDidKeyEd25519Signature, verifyEip191MessageSignature, verifyIssuedCredential, verifyLocationRecord, verifyStorageReceipt };
3438
+ export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, type AbilitiesMap, type AccountApplication, type AccountApplicationListOptions, type AccountApplicationRegisterOptions, type AccountDelegation, type AccountDelegationListOptions, AccountDelegationPage, AccountDelegationQueryOptions, 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, CREDENTIAL_ERROR_CODES, type CallbackStrategy, type CanonicalAddress, type CanonicalParsedNetworkId, type CanonicalTinyCloudIdentity, type CapabilityPresentationEnvelopeV1, CaveatedDelegationUnsupportedError, type ClientSession, ClientSessionSchema, CloudLocationResolutionError, type ComposeManifestOptions, type ComposedManifestRequest, type CreateDelegationFunction, CreateDelegationParams, CredentialError, type CredentialErrorCode, CredentialFlowDescriptor, CredentialHolderBinding, CredentialIssuerMetadata, CredentialRequirement, CredentialStorageReceipt, DEFAULT_DEFAULTS, DEFAULT_EXPIRY, DEFAULT_KNOWLEDGE_ROOT, DEFAULT_LOCAL_NODE_PIN_STORAGE_KEY, DEFAULT_LOCAL_NODE_URL, DEFAULT_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, DEFAULT_SIGNED_READ_URL_EXPIRY_MS, DEFAULT_TINYCLOUD_FALLBACK_HOST, DEFAULT_TINYCLOUD_LOCATION_REGISTRY_URL, Delegation, DelegationManager, DelegationRevocationReceipt, type DidCacheKeyOptions, type DidEqualsOptions, type DiscoverLocalTinyCloudNodeOptions, type DiscoveredLocalTinyCloudNode, EMAIL_CREDENTIAL_MAX_AGE_SECONDS, ENCRYPTION_MANIFEST_SPACE, ENCRYPTION_PERMISSION_SERVICE, EXPIRY, type EnsData, EnsDataSchema, type EventEmitterStrategy, type ExpiryTier, type Extension, GenerateShareParams, ICapabilityKeyRegistry, type IENSResolver, type INotificationHandler, type ISessionManager, type ISessionStorage, ISharingService, type ISigner, type ISpace, type ISpaceCreationHandler, type ISpaceScopedDelegations, type ISpaceScopedSharing, type ISpaceService, type IUserAuthorization, type IWasmBindings, IdentityParseError, type ImmutableSiweFields, IssuedCredentialEnvelope, LOCAL_LINK_HOST_SUFFIX, LOCAL_LINK_PROBE_TIMEOUT_MS, LOCAL_LOOPBACK_PROBE_TIMEOUT_MS, type LocalNodeIdentityStore, 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, OPENKEY_ACTION_ID_SEPARATOR, type OpenKeyCallbackStrategy, type OpenKeyManageKeyCallbackStrategy, OpenKeyManageKeyError, type OpenKeyManageKeyErrorCode, type OpenKeyManageKeyFetch, type OpenKeyManageKeySigningRequestBody, type OpenKeyManageKeySigningResponseBody, type OpenKeyManageKeySigningStrategyOptions, type OpenKeySigningRequestBody, type OpenKeySigningResponseBody, type OpenKeySigningStrategyOptions, type ParseRecapFromSiwe, type PartialSiweMessage, type PermissionEntry, PermissionNotInManifestError, type PersistedSessionData, type PersistedSessionProof, type PersistedTinyCloudSession, type PkhDidParts, ProtocolMismatchError, type RecapAttenuation, type RegisterBatchSuccess, 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, ShareLink, 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, SpaceInfo, SpaceService, type SpaceServiceConfig, StoredCredentialRecord, type SubsetCheckResult, TINYCLOUD_CANONICAL_IDENTITY_CLAIM, TINYCLOUD_MANAGE_KEY_SCOPE, TinyCloud, type TinyCloudAuthorizationRequestV1, type TinyCloudAuthorizationResultV1, type TinyCloudConfig, type TinyCloudEffectiveGrantV1, type TinyCloudSession, UnsupportedFeatureError, type UserAuthorizationConfig, VAULT_PERMISSION_SERVICE, type ValidatedPersistedSessionProof, type ValidationError, VerifiedCredential, VersionCheckError, type WasmRecapEntry, type WebStorageLike, actionContains, activateSessionWithHost, addressStorageKey, applyPrefix, buildSpaceUri, canonicalDigest, canonicalLocationPayload, canonicalizeAddress, canonicalizeDid, canonicalizeDidUrl, canonicalizeNetworkId, canonicalizeRecapCaveats, checkNodeInfo, composeManifestRequest, createEmailCredentialRequirement, createHolderBinding, createInMemoryLocalNodeIdentityStore, createLocalStorageLocalNodeIdentityStore, createOpenKeyCallbackSigningStrategy, createOpenKeyManageKeySigningStrategy, createSpaceService, createStorageReceipt, createStoredCredentialRecord, credentialEndpointPath, credentialError, credentialIndexKey, credentialMatchesRequirement, credentialRecordKey, credentialRequirementDigest, decodeBase64Url, defaultSignStrategy, defaultSpaceCreationHandler, descriptorSatisfiesRequirement, didCacheKey, didEquals, diffImmutableSiweFields, discoverLocalTinyCloudNode, encodeBase64Url, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, extractImmutableSiweFields, extractRecapAttenuations, fetchLocationRecord, fetchPeerId, hasTinyCloudManageKeyScope, holderBindingCanonicalBytes, holderBindingSigningBytes, httpUrlToMultiaddr, isCapabilitySubset, isDigest, isEvmAddress, isPlausibleOpenKeyActionId, loadManifest, locationPayloadForRecord, makePkhSpaceId, makePublicSpaceId, manifestAbilitiesUnion, multiaddrToHttpUrl, normalizeDefaults, parseCanonicalNetworkId, parseCanonicalRecapResource, parseCanonicalTinyCloudIdentity, parseCanonicalTinyCloudIdentityClaims, parseExpiry, parsePkhDid, parseRecapCapabilities, parseSpaceUri, pkhDid, principalDid, principalDidEquals, recapCaveatsEqual, requestTinyCloudManageKeyScope, resolveCloudLocation, resolveManifest, resolveManifestKnowledgeRoot, resolveTinyCloudHosts, resourceCapabilitiesToAbilitiesMap, resourceCapabilitiesToSpaceAbilitiesMap, sha256Base64Url, signLocationRecord, submitHostDelegation, unauthorizedRecapCapabilities, validateAuthorizationResultV1, validateClientSession, validateCredentialFlowDescriptor, validateCredentialHolderBinding, validateCredentialRequirement, validateLocationRecord, validateLocationRecordPayload, validateManifest, validatePersistedSessionData, verifyDidKeyEd25519Signature, verifyEip191MessageSignature, verifyIssuedCredential, verifyLocationRecord, verifyStorageReceipt };
package/dist/index.js CHANGED
@@ -565,6 +565,17 @@ function isDigest(value) {
565
565
 
566
566
  // src/credentials/requirement.ts
567
567
  var ID2 = /^[a-z0-9][a-z0-9._-]{0,127}(?:\/v1)?$/;
568
+ var EMAIL_CREDENTIAL_MAX_AGE_SECONDS = 3600;
569
+ function createEmailCredentialRequirement(input) {
570
+ return validateCredentialRequirement({
571
+ type: "TinyCloudCredentialRequirement",
572
+ version: 1,
573
+ profile: input.profile,
574
+ credentialType: input.credentialType,
575
+ claims: { email: input.email },
576
+ maxAgeSeconds: EMAIL_CREDENTIAL_MAX_AGE_SECONDS
577
+ });
578
+ }
568
579
  function validateCredentialRequirement(value) {
569
580
  if (typeof value !== "object" || value === null || Array.isArray(value)) throw new CredentialError("UNSUPPORTED_PROFILE", "Credential requirement is invalid");
570
581
  const raw = value;
@@ -3429,6 +3440,7 @@ async function requestPolicyChallengeV3(input) {
3429
3440
  const response = await fetchFn(new URL("/share/v3/policy/challenges", input.nodeOrigin), {
3430
3441
  method: "POST",
3431
3442
  redirect: "error",
3443
+ signal: input.signal,
3432
3444
  headers: { accept: "application/json", "content-type": "application/json" },
3433
3445
  body: JSON.stringify({ policyCid: input.policyCid, recipientDid: input.recipientDid, requestedCapabilities: input.requestedCapabilities.map(normalizeUnifiedPolicyCapability) })
3434
3446
  });
@@ -3598,6 +3610,11 @@ var POLICY_SESSION_FACT_KEYS = [
3598
3610
  "issuanceAuditDigestHex",
3599
3611
  "remainingRedelegationDepth"
3600
3612
  ];
3613
+ var POLICY_SESSION_V4_AUDIT_FACT_KEYS = [
3614
+ "credentialIdAuditDigestHex",
3615
+ "presentationJtiAuditDigestHex"
3616
+ ];
3617
+ var LOWER_SHA256_HEX = /^[0-9a-f]{64}$/;
3601
3618
  var KV_ACTIONS = /* @__PURE__ */ new Set([
3602
3619
  "tinycloud.kv/get",
3603
3620
  "tinycloud.kv/list",
@@ -3990,9 +4007,13 @@ function parsePolicySessionUcan(authorization, expectedProofs) {
3990
4007
  if (expectedProofs !== void 0 && (parsed.payload.prf[0] !== expectedProofs[0] || parsed.payload.prf[1] !== expectedProofs[1]))
3991
4008
  throw new Error("policy session UCAN ordered proofs do not match");
3992
4009
  const factKeys = Object.keys(fact);
3993
- if (factKeys.length !== POLICY_SESSION_FACT_KEYS.length || factKeys.some((key) => !POLICY_SESSION_FACT_KEYS.includes(key)) || POLICY_SESSION_FACT_KEYS.some((key) => !(key in fact)))
4010
+ const hasLegacyFactShape = factKeys.length === POLICY_SESSION_FACT_KEYS.length && factKeys.every((key) => POLICY_SESSION_FACT_KEYS.includes(key)) && POLICY_SESSION_FACT_KEYS.every((key) => key in fact);
4011
+ const hasV4AuditFactShape = factKeys.length === POLICY_SESSION_FACT_KEYS.length + POLICY_SESSION_V4_AUDIT_FACT_KEYS.length && factKeys.every((key) => POLICY_SESSION_FACT_KEYS.includes(key) || POLICY_SESSION_V4_AUDIT_FACT_KEYS.includes(key)) && POLICY_SESSION_FACT_KEYS.every((key) => key in fact) && POLICY_SESSION_V4_AUDIT_FACT_KEYS.every((key) => key in fact);
4012
+ if (!hasLegacyFactShape && !hasV4AuditFactShape)
3994
4013
  throw new Error("policy session UCAN fact is incomplete");
3995
- if (fact.profile !== POLICY_SESSION_UCAN_V1_PROFILE || typeof fact.remainingRedelegationDepth !== "number" || !Number.isInteger(fact.remainingRedelegationDepth) || fact.remainingRedelegationDepth < 0 || fact.remainingRedelegationDepth > 8 || parsed.payload.exp - parsed.payload.nbf > 60 || parsed.payload.iss.split("#", 1)[0] !== fact.enforcerDid || parsed.payload.aud !== fact.recipientDid)
4014
+ if (hasV4AuditFactShape && (!LOWER_SHA256_HEX.test(fact.credentialIdAuditDigestHex) || !LOWER_SHA256_HEX.test(fact.presentationJtiAuditDigestHex)))
4015
+ throw new Error("policy session UCAN v4 audit facts are invalid");
4016
+ if (fact.profile !== POLICY_SESSION_UCAN_V1_PROFILE || typeof fact.remainingRedelegationDepth !== "number" || !Number.isInteger(fact.remainingRedelegationDepth) || fact.remainingRedelegationDepth < 0 || fact.remainingRedelegationDepth > 8 || parsed.payload.exp - parsed.payload.nbf > 60 || parsed.payload.iss.split("#", 1)[0] !== fact.nodeAudience || parsed.payload.aud !== fact.recipientDid)
3996
4017
  throw new Error("policy session UCAN fact is invalid");
3997
4018
  return {
3998
4019
  authorization,
@@ -4051,6 +4072,8 @@ var POLICY_V2_DOMAIN = "xyz.tinycloud.policy/policy/v2\0";
4051
4072
  var POLICY_CREDENTIAL_REQUIREMENT_V1_TYPE = "TinyCloudPolicyCredentialRequirement";
4052
4073
  var POLICY_PRESENTATION_V3_SCHEMA = "xyz.tinycloud.policy/presentation/v3";
4053
4074
  var POLICY_PRESENTATION_V3_DOMAIN = "xyz.tinycloud.policy/Presentation/v3\0";
4075
+ var POLICY_PRESENTATION_V4_SCHEMA = "xyz.tinycloud.policy/presentation/v4";
4076
+ var POLICY_PRESENTATION_V4_DOMAIN = "xyz.tinycloud.policy/Presentation/v4\0";
4054
4077
  function record(value, label) {
4055
4078
  if (typeof value !== "object" || value === null || Array.isArray(value)) {
4056
4079
  throw new Error(`${label} must be an object`);
@@ -4225,6 +4248,97 @@ function envelopeFromVerified(verified) {
4225
4248
  } = verified;
4226
4249
  return envelope;
4227
4250
  }
4251
+ function issuedCredentialEnvelopeFromVerified(verified) {
4252
+ return envelopeFromVerified(verified);
4253
+ }
4254
+ async function signPolicyCredentialPresentationV4(value, sign) {
4255
+ const item = record(value, "Policy presentation v4");
4256
+ exactKeys2(item, [
4257
+ "schema",
4258
+ "jti",
4259
+ "challengeId",
4260
+ "nonce",
4261
+ "policyCid",
4262
+ "nodeAudience",
4263
+ "holderDid",
4264
+ "subjectDid",
4265
+ "credentialDigest",
4266
+ "requirementDigest",
4267
+ "descriptorDigest",
4268
+ "requestedCapabilities",
4269
+ "issuedAt",
4270
+ "expiresAt"
4271
+ ], "Policy presentation v4");
4272
+ if (item.schema !== POLICY_PRESENTATION_V4_SCHEMA || item.holderDid !== item.subjectDid || !Array.isArray(item.requestedCapabilities)) throw new Error("Policy presentation v4 is invalid");
4273
+ const holderDid = nonEmpty(item.holderDid, "Policy presentation v4 holder DID");
4274
+ didKeyBytes(holderDid);
4275
+ const unsigned = Object.freeze({
4276
+ schema: POLICY_PRESENTATION_V4_SCHEMA,
4277
+ jti: nonEmpty(item.jti, "Policy presentation v4 jti"),
4278
+ challengeId: nonEmpty(item.challengeId, "Policy presentation v4 challenge"),
4279
+ nonce: nonEmpty(item.nonce, "Policy presentation v4 nonce"),
4280
+ policyCid: nonEmpty(item.policyCid, "Policy presentation v4 policy CID"),
4281
+ nodeAudience: nonEmpty(item.nodeAudience, "Policy presentation v4 audience"),
4282
+ holderDid,
4283
+ subjectDid: holderDid,
4284
+ credentialDigest: nonEmpty(item.credentialDigest, "Policy presentation v4 credential digest"),
4285
+ requirementDigest: nonEmpty(item.requirementDigest, "Policy presentation v4 requirement digest"),
4286
+ descriptorDigest: nonEmpty(item.descriptorDigest, "Policy presentation v4 descriptor digest"),
4287
+ // The low-level signer preserves the frozen wire bytes exactly. The
4288
+ // policy-aware builder performs capability normalization and containment.
4289
+ requestedCapabilities: Object.freeze(item.requestedCapabilities),
4290
+ issuedAt: date(item.issuedAt, "Policy presentation v4 issuedAt"),
4291
+ expiresAt: date(item.expiresAt, "Policy presentation v4 expiresAt")
4292
+ });
4293
+ const digest4 = sha2565(new TextEncoder().encode(
4294
+ POLICY_PRESENTATION_V4_DOMAIN + jcsCanonicalize(unsigned)
4295
+ ));
4296
+ const signature = await sign(digest4);
4297
+ if (signature.length !== 64 || !ed255194.verify(signature, digest4, didKeyBytes(holderDid))) throw new Error("policy presentation signature is invalid");
4298
+ return Object.freeze({
4299
+ ...unsigned,
4300
+ signature: Object.freeze({
4301
+ suite: "Ed25519",
4302
+ signerDid: holderDid,
4303
+ value: encodeBase64Url(signature)
4304
+ })
4305
+ });
4306
+ }
4307
+ async function buildPolicyCredentialPresentationV4(input) {
4308
+ const policy = validateUnifiedPolicyV2(input.policy, input.policyCid);
4309
+ const requirement = validateCredentialRequirement(input.requirement);
4310
+ const commitment = policy.credentialRequirement;
4311
+ const requirementDigest = await credentialRequirementDigest(requirement);
4312
+ const credentialDigest = await sha256Base64Url(input.credential.credential);
4313
+ if (requirementDigest !== commitment.requirementDigest || input.credential.descriptorDigest !== commitment.descriptorDigest || input.credential.credentialDigest !== credentialDigest || input.credential.issuerDid !== commitment.issuerDid || input.credential.issuerKid !== commitment.issuerKid || jcsCanonicalize(input.credential.profile) !== jcsCanonicalize(commitment.profile) || jcsCanonicalize(input.credential.credentialType) !== jcsCanonicalize(commitment.credentialType)) throw new Error("credential does not match the signed Policy/v2 requirement");
4314
+ const requestedCapabilities = input.requestedCapabilities.map(normalizeUnifiedPolicyCapability);
4315
+ if (requestedCapabilities.length === 0 || requestedCapabilities.some((requested) => !policy.capabilityCeiling.some((authority) => unifiedPolicyCapabilityContains(authority, requested)))) throw new Error("requested capabilities exceed the signed Policy/v2 ceiling");
4316
+ const holderDid = input.credential.holderDid;
4317
+ if (input.challenge.policyCid !== input.policyCid || input.challenge.recipientDid !== holderDid || input.credential.subjectDid !== holderDid || typeof input.challenge.nodeAudience !== "string" || input.challenge.nodeAudience.length === 0 || typeof input.challenge.expiresAt !== "string" || !Number.isFinite(Date.parse(input.challenge.expiresAt))) throw new Error("policy challenge binding is invalid");
4318
+ const now = input.now ?? /* @__PURE__ */ new Date();
4319
+ const expiresAtMs = Math.min(
4320
+ now.getTime() + 6e4,
4321
+ Date.parse(input.challenge.expiresAt),
4322
+ Date.parse(input.credential.expiresAt)
4323
+ );
4324
+ if (expiresAtMs <= now.getTime()) throw new Error("policy challenge is expired");
4325
+ return signPolicyCredentialPresentationV4(Object.freeze({
4326
+ schema: POLICY_PRESENTATION_V4_SCHEMA,
4327
+ jti: input.jti ?? encodeBase64Url(crypto.getRandomValues(new Uint8Array(16))),
4328
+ challengeId: input.challenge.challengeId,
4329
+ nonce: input.challenge.nonce,
4330
+ policyCid: input.policyCid,
4331
+ nodeAudience: input.challenge.nodeAudience,
4332
+ holderDid,
4333
+ subjectDid: holderDid,
4334
+ credentialDigest,
4335
+ requirementDigest,
4336
+ descriptorDigest: input.credential.descriptorDigest,
4337
+ requestedCapabilities: Object.freeze(requestedCapabilities),
4338
+ issuedAt: rfc3339Seconds(now),
4339
+ expiresAt: rfc3339Seconds(new Date(expiresAtMs))
4340
+ }), input.sign);
4341
+ }
4228
4342
  async function buildPolicyCredentialPresentationV3(input) {
4229
4343
  const policy = validateUnifiedPolicyV2(input.policy, input.policyCid);
4230
4344
  const requirement = validateCredentialRequirement(input.requirement);
@@ -4314,7 +4428,8 @@ async function admitPolicyCredentialV3(input) {
4314
4428
  policyCid: input.policyCid,
4315
4429
  recipientDid: input.credential.holderDid,
4316
4430
  requestedCapabilities: input.requestedCapabilities,
4317
- fetch: fetchFn
4431
+ fetch: fetchFn,
4432
+ signal: input.signal
4318
4433
  });
4319
4434
  const presentation = await buildPolicyCredentialPresentationV3({
4320
4435
  ...input,
@@ -4326,6 +4441,7 @@ async function admitPolicyCredentialV3(input) {
4326
4441
  {
4327
4442
  method: "POST",
4328
4443
  redirect: "error",
4444
+ signal: input.signal,
4329
4445
  headers: { accept: "application/json", "content-type": "application/json" },
4330
4446
  body: JSON.stringify({
4331
4447
  policyCid: input.policyCid,
@@ -4354,6 +4470,57 @@ async function admitPolicyCredentialV3(input) {
4354
4470
  if (session.cid !== value.sessionCid || session.aud !== input.credential.holderDid || session.fact.policyCid !== input.policyCid || session.fact.recipientDid !== input.credential.holderDid || session.fact.policyDelegationCid !== input.policyRootCid || session.fact.enforcementDelegationCid !== input.enforcementRootCid || jcsCanonicalize(session.att) !== jcsCanonicalize(expectedAttenuation)) {
4355
4471
  throw new Error("policy delegation signed binding is invalid");
4356
4472
  }
4473
+ input.signal?.throwIfAborted();
4474
+ return Object.freeze({ challenge, presentation, session });
4475
+ }
4476
+ function validatePolicyCredentialAdmissionV4Authority(session, expected) {
4477
+ if (session.iss.split("#", 1)[0] !== expected.nodeAudience || session.fact.nodeAudience !== expected.nodeAudience || session.fact.enforcerDid !== expected.enforcerDid) throw new Error("policy delegation authority binding is invalid");
4478
+ }
4479
+ async function admitPolicyCredentialV4(input) {
4480
+ const policy = validateUnifiedPolicyV2(input.policy, input.policyCid);
4481
+ const nodeOrigin = policyNodeOrigin(input.nodeOrigin);
4482
+ const fetchFn = input.fetch ?? globalThis.fetch.bind(globalThis);
4483
+ const challenge = await requestPolicyChallengeV3({
4484
+ nodeOrigin,
4485
+ policyCid: input.policyCid,
4486
+ recipientDid: input.credential.holderDid,
4487
+ requestedCapabilities: input.requestedCapabilities,
4488
+ fetch: fetchFn,
4489
+ signal: input.signal
4490
+ });
4491
+ const presentation = await buildPolicyCredentialPresentationV4({
4492
+ ...input,
4493
+ policy,
4494
+ challenge
4495
+ });
4496
+ const response = await fetchFn(new URL("/share/v3/policy/delegations", nodeOrigin), {
4497
+ method: "POST",
4498
+ redirect: "error",
4499
+ signal: input.signal,
4500
+ headers: { accept: "application/json", "content-type": "application/json" },
4501
+ body: JSON.stringify({
4502
+ policyCid: input.policyCid,
4503
+ challengeId: challenge.challengeId,
4504
+ nonce: challenge.nonce,
4505
+ requirement: validateCredentialRequirement(input.requirement),
4506
+ credential: envelopeFromVerified(input.credential),
4507
+ presentation
4508
+ })
4509
+ });
4510
+ if (!response.ok) throw new Error(`policy delegation rejected (${response.status})`);
4511
+ const value = record(await response.json(), "policy delegation");
4512
+ if (value.admitted !== true || typeof value.sessionCid !== "string" || typeof value.authorization !== "string") throw new Error("policy delegation response is invalid");
4513
+ const session = parsePolicySessionUcan(value.authorization, [
4514
+ input.policyRootCid,
4515
+ input.enforcementRootCid
4516
+ ]);
4517
+ const expectedAttenuation = compactAttenuationForPolicyCapabilities(input.requestedCapabilities);
4518
+ validatePolicyCredentialAdmissionV4Authority(session, {
4519
+ nodeAudience: input.expectedNodeAudience,
4520
+ enforcerDid: input.expectedEnforcerDid
4521
+ });
4522
+ if (session.cid !== value.sessionCid || session.aud !== input.credential.holderDid || session.fact.policyCid !== input.policyCid || session.fact.recipientDid !== input.credential.holderDid || session.fact.policyDelegationCid !== input.policyRootCid || session.fact.enforcementDelegationCid !== input.enforcementRootCid || jcsCanonicalize(session.att) !== jcsCanonicalize(expectedAttenuation)) throw new Error("policy delegation signed binding is invalid");
4523
+ input.signal?.throwIfAborted();
4357
4524
  return Object.freeze({ challenge, presentation, session });
4358
4525
  }
4359
4526
 
@@ -18008,6 +18175,7 @@ export {
18008
18175
  DuckDbService2 as DuckDbService,
18009
18176
  ED25519_JCS_SIGNATURE_SUITE,
18010
18177
  EIP191_JCS_SIGNATURE_SUITE,
18178
+ EMAIL_CREDENTIAL_MAX_AGE_SECONDS,
18011
18179
  ENCRYPTION,
18012
18180
  ENCRYPTION_MANIFEST_SPACE,
18013
18181
  ENCRYPTION_NETWORK_URN_PREFIX,
@@ -18059,6 +18227,8 @@ export {
18059
18227
  POLICY_ENGINE_RESOLVE_REQUEST_SCHEMA,
18060
18228
  POLICY_PRESENTATION_V3_DOMAIN,
18061
18229
  POLICY_PRESENTATION_V3_SCHEMA,
18230
+ POLICY_PRESENTATION_V4_DOMAIN,
18231
+ POLICY_PRESENTATION_V4_SCHEMA,
18062
18232
  POLICY_SCHEMA,
18063
18233
  POLICY_SESSION_UCAN_V1_PROFILE,
18064
18234
  POLICY_STATUS_SCHEMA,
@@ -18136,6 +18306,7 @@ export {
18136
18306
  activateSessionWithHost,
18137
18307
  addressStorageKey,
18138
18308
  admitPolicyCredentialV3,
18309
+ admitPolicyCredentialV4,
18139
18310
  applyPrefix,
18140
18311
  bootstrapEncryptionNetworkId,
18141
18312
  bootstrapSpaceId,
@@ -18146,6 +18317,7 @@ export {
18146
18317
  buildDecryptInvocation,
18147
18318
  buildNetworkId2 as buildNetworkId,
18148
18319
  buildPolicyCredentialPresentationV3,
18320
+ buildPolicyCredentialPresentationV4,
18149
18321
  buildSpaceUri,
18150
18322
  canonicalDigest,
18151
18323
  canonicalHashHex,
@@ -18176,6 +18348,7 @@ export {
18176
18348
  createAndSignSignedObject,
18177
18349
  createCapabilityKeyRegistry,
18178
18350
  createDelegatedShareKey,
18351
+ createEmailCredentialRequirement,
18179
18352
  createHolderBinding,
18180
18353
  createInMemoryLocalNodeIdentityStore,
18181
18354
  createLocalStorageLocalNodeIdentityStore,
@@ -18254,6 +18427,7 @@ export {
18254
18427
  isNetworkId,
18255
18428
  isPlausibleOpenKeyActionId,
18256
18429
  isV2ShareLink,
18430
+ issuedCredentialEnvelopeFromVerified,
18257
18431
  jcsCanonicalize,
18258
18432
  loadManifest,
18259
18433
  locationPayloadForRecord,
@@ -18316,6 +18490,7 @@ export {
18316
18490
  signCompactUcanAuthorization,
18317
18491
  signCompactUcanRootAuthorization,
18318
18492
  signLocationRecord,
18493
+ signPolicyCredentialPresentationV4,
18319
18494
  signShareEnvelope,
18320
18495
  signedObjectIdFor,
18321
18496
  submitHostDelegation,