@tinycloud/sdk-core 2.11.0-beta.0 → 2.11.0-beta.10

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.
@@ -2259,6 +2259,9 @@ type ShareRecipientTarget = {
2259
2259
  } | {
2260
2260
  readonly kind: "emailDomain";
2261
2261
  readonly value: string;
2262
+ } | {
2263
+ readonly kind: "recipientDid";
2264
+ readonly value: string;
2262
2265
  } | {
2263
2266
  readonly kind: "bearer";
2264
2267
  };
@@ -2536,6 +2539,19 @@ interface ShareRecipientClientOptions {
2536
2539
  readonly envelope: ShareEnvelopeV2;
2537
2540
  readonly presentation?: unknown;
2538
2541
  }) => Promise<SharePolicySession>;
2542
+ /** Direct DID authorization is explicit and may return a resumable device step. */
2543
+ readonly establishRecipientDidSession?: (input: {
2544
+ readonly envelope: ShareEnvelopeV2;
2545
+ readonly recipientDid: string;
2546
+ }) => Promise<SharePolicySession | {
2547
+ readonly state: "authorization-required";
2548
+ readonly method: "openkey-device";
2549
+ readonly continueUrl?: string;
2550
+ readonly resumeToken: string;
2551
+ } | {
2552
+ readonly state: "denied";
2553
+ readonly reason: string;
2554
+ }>;
2539
2555
  /**
2540
2556
  * Builds the holder presentation/session request after Node returns a
2541
2557
  * fresh challenge. The callback is deliberately invoked only after the
@@ -2740,7 +2756,8 @@ declare class ShareConflict extends Error {
2740
2756
  }
2741
2757
  declare class ShareAccessError extends Error {
2742
2758
  readonly code: string;
2743
- constructor(code: string, message?: string);
2759
+ readonly details?: unknown;
2760
+ constructor(code: string, message?: string, details?: unknown);
2744
2761
  }
2745
2762
  interface ShareAccessV2 {
2746
2763
  readonly kind: "share-v2";
@@ -3229,22 +3246,52 @@ interface OwnerDelegationReceipt {
3229
3246
  readonly actions: readonly string[];
3230
3247
  readonly expiry: Date;
3231
3248
  };
3249
+ /** Exact service-scoped capabilities encoded in the signed owner delegation. */
3250
+ readonly permissions: readonly OwnerDelegationPermission[];
3232
3251
  }
3233
- interface CreateOwnerDelegationParams {
3234
- readonly delegateDid: string;
3235
- readonly spaceId: string;
3252
+ interface OwnerDelegationPermission {
3253
+ /** Canonical long-form service name, for example `tinycloud.kv`. */
3254
+ readonly service: string;
3255
+ /** Exact service resource path. Encryption permissions use a network URN. */
3236
3256
  readonly path: string;
3257
+ /** Canonical full action URNs belonging to `service`. */
3237
3258
  readonly actions: readonly string[];
3259
+ }
3260
+ interface CreateOwnerDelegationBase {
3261
+ readonly delegateDid: string;
3262
+ readonly spaceId: string;
3238
3263
  readonly expiresAt: Date;
3239
3264
  }
3265
+ /**
3266
+ * A wallet-rooted owner delegation accepts either the historical single-path
3267
+ * shape or an exact list of service-scoped permissions. The two forms are
3268
+ * mutually exclusive so callers cannot sign authority from one field while
3269
+ * displaying or persisting a contradictory second field.
3270
+ */
3271
+ type CreateOwnerDelegationParams = CreateOwnerDelegationBase & ({
3272
+ readonly path: string;
3273
+ readonly actions: readonly string[];
3274
+ readonly permissions?: never;
3275
+ } | {
3276
+ readonly permissions: readonly OwnerDelegationPermission[];
3277
+ readonly path?: never;
3278
+ readonly actions?: never;
3279
+ });
3240
3280
  declare const MAX_CONTENT_BYTES: number;
3241
3281
  type OwnerShareAction = "tinycloud.kv/get" | "tinycloud.kv/list" | "tinycloud.kv/metadata" | "tinycloud.kv/put";
3282
+ interface OwnerShareDecryption {
3283
+ readonly networkId: string;
3284
+ readonly action: "tinycloud.encryption/decrypt";
3285
+ }
3242
3286
  type OwnerShareMatcher = {
3243
3287
  readonly kind: "exactEmail";
3244
3288
  readonly value: string;
3245
3289
  } | {
3246
3290
  readonly kind: "emailDomain";
3247
3291
  readonly value: string;
3292
+ } | {
3293
+ readonly kind: "recipientDid";
3294
+ readonly value: string;
3248
3295
  };
3249
3296
  interface OwnerSharePolicyV2 {
3250
3297
  readonly type: "TinyCloudSharePolicy";
@@ -3264,6 +3311,7 @@ interface OwnerSharePolicyV2 {
3264
3311
  readonly path: string;
3265
3312
  };
3266
3313
  readonly actions: readonly OwnerShareAction[];
3314
+ readonly decryption?: OwnerShareDecryption;
3267
3315
  readonly contentSource: {
3268
3316
  readonly kind: "kv";
3269
3317
  readonly space: string;
@@ -3331,6 +3379,7 @@ interface OwnerSharePolicyRegistration {
3331
3379
  readonly path: string;
3332
3380
  };
3333
3381
  readonly actions: readonly OwnerShareAction[];
3382
+ readonly decryption?: OwnerShareDecryption;
3334
3383
  readonly contentSource: {
3335
3384
  readonly kind: "kv";
3336
3385
  readonly space: string;
@@ -3374,6 +3423,7 @@ declare function createPolicyEnforcementDelegation(input: {
3374
3423
  readonly nodeAudience: string;
3375
3424
  readonly path: string;
3376
3425
  readonly actions: readonly OwnerShareAction[];
3426
+ readonly decryption?: OwnerShareDecryption;
3377
3427
  readonly contentSourceDigest: string;
3378
3428
  readonly expiresAt: string;
3379
3429
  }): Promise<SignedDelegation>;
@@ -3402,6 +3452,7 @@ interface ShareDeliveryAuthorizationRequest {
3402
3452
  readonly shareUrl: string;
3403
3453
  readonly documentName: string;
3404
3454
  readonly jti: string;
3455
+ readonly idempotencyKey: string;
3405
3456
  readonly expiresAt: string;
3406
3457
  readonly requestBodyDigest: string;
3407
3458
  }
@@ -3612,6 +3663,15 @@ declare const ShareRecipientTargetSchema: z.ZodDiscriminatedUnion<"kind", [z.Zod
3612
3663
  }, {
3613
3664
  value: string;
3614
3665
  kind: "emailDomain";
3666
+ }>, z.ZodObject<{
3667
+ kind: z.ZodLiteral<"recipientDid">;
3668
+ value: z.ZodString;
3669
+ }, "strict", z.ZodTypeAny, {
3670
+ value: string;
3671
+ kind: "recipientDid";
3672
+ }, {
3673
+ value: string;
3674
+ kind: "recipientDid";
3615
3675
  }>, z.ZodObject<{
3616
3676
  kind: z.ZodLiteral<"bearer">;
3617
3677
  }, "strict", z.ZodTypeAny, {
@@ -3658,6 +3718,15 @@ declare const ShareRecipientPolicySchema: z.ZodObject<{
3658
3718
  }, {
3659
3719
  value: string;
3660
3720
  kind: "emailDomain";
3721
+ }>, z.ZodObject<{
3722
+ kind: z.ZodLiteral<"recipientDid">;
3723
+ value: z.ZodString;
3724
+ }, "strict", z.ZodTypeAny, {
3725
+ value: string;
3726
+ kind: "recipientDid";
3727
+ }, {
3728
+ value: string;
3729
+ kind: "recipientDid";
3661
3730
  }>, z.ZodObject<{
3662
3731
  kind: z.ZodLiteral<"bearer">;
3663
3732
  }, "strict", z.ZodTypeAny, {
@@ -3704,6 +3773,9 @@ declare const ShareRecipientPolicySchema: z.ZodObject<{
3704
3773
  } | {
3705
3774
  value: string;
3706
3775
  kind: "emailDomain";
3776
+ } | {
3777
+ value: string;
3778
+ kind: "recipientDid";
3707
3779
  } | {
3708
3780
  kind: "bearer";
3709
3781
  };
@@ -3724,6 +3796,9 @@ declare const ShareRecipientPolicySchema: z.ZodObject<{
3724
3796
  } | {
3725
3797
  value: string;
3726
3798
  kind: "emailDomain";
3799
+ } | {
3800
+ value: string;
3801
+ kind: "recipientDid";
3727
3802
  } | {
3728
3803
  kind: "bearer";
3729
3804
  };
@@ -3770,6 +3845,15 @@ declare const ShareAddressedDelegationRequestV2Schema: z.ZodObject<{
3770
3845
  }, {
3771
3846
  value: string;
3772
3847
  kind: "emailDomain";
3848
+ }>, z.ZodObject<{
3849
+ kind: z.ZodLiteral<"recipientDid">;
3850
+ value: z.ZodString;
3851
+ }, "strict", z.ZodTypeAny, {
3852
+ value: string;
3853
+ kind: "recipientDid";
3854
+ }, {
3855
+ value: string;
3856
+ kind: "recipientDid";
3773
3857
  }>]>;
3774
3858
  targetOrigin: z.ZodString;
3775
3859
  nodeAudience: z.ZodString;
@@ -3851,6 +3935,9 @@ declare const ShareAddressedDelegationRequestV2Schema: z.ZodObject<{
3851
3935
  } | {
3852
3936
  value: string;
3853
3937
  kind: "emailDomain";
3938
+ } | {
3939
+ value: string;
3940
+ kind: "recipientDid";
3854
3941
  };
3855
3942
  nodeAudience: string;
3856
3943
  contentSource: {
@@ -3893,6 +3980,9 @@ declare const ShareAddressedDelegationRequestV2Schema: z.ZodObject<{
3893
3980
  } | {
3894
3981
  value: string;
3895
3982
  kind: "emailDomain";
3983
+ } | {
3984
+ value: string;
3985
+ kind: "recipientDid";
3896
3986
  };
3897
3987
  nodeAudience: string;
3898
3988
  contentSource: {
@@ -3944,6 +4034,15 @@ declare const ShareAddressedDelegationEnvelopeV2Schema: z.ZodObject<{
3944
4034
  }, {
3945
4035
  value: string;
3946
4036
  kind: "emailDomain";
4037
+ }>, z.ZodObject<{
4038
+ kind: z.ZodLiteral<"recipientDid">;
4039
+ value: z.ZodString;
4040
+ }, "strict", z.ZodTypeAny, {
4041
+ value: string;
4042
+ kind: "recipientDid";
4043
+ }, {
4044
+ value: string;
4045
+ kind: "recipientDid";
3947
4046
  }>]>;
3948
4047
  targetOrigin: z.ZodString;
3949
4048
  nodeAudience: z.ZodString;
@@ -4025,6 +4124,9 @@ declare const ShareAddressedDelegationEnvelopeV2Schema: z.ZodObject<{
4025
4124
  } | {
4026
4125
  value: string;
4027
4126
  kind: "emailDomain";
4127
+ } | {
4128
+ value: string;
4129
+ kind: "recipientDid";
4028
4130
  };
4029
4131
  nodeAudience: string;
4030
4132
  contentSource: {
@@ -4067,6 +4169,9 @@ declare const ShareAddressedDelegationEnvelopeV2Schema: z.ZodObject<{
4067
4169
  } | {
4068
4170
  value: string;
4069
4171
  kind: "emailDomain";
4172
+ } | {
4173
+ value: string;
4174
+ kind: "recipientDid";
4070
4175
  };
4071
4176
  nodeAudience: string;
4072
4177
  contentSource: {
@@ -4124,6 +4229,9 @@ declare const ShareAddressedDelegationEnvelopeV2Schema: z.ZodObject<{
4124
4229
  } | {
4125
4230
  value: string;
4126
4231
  kind: "emailDomain";
4232
+ } | {
4233
+ value: string;
4234
+ kind: "recipientDid";
4127
4235
  };
4128
4236
  nodeAudience: string;
4129
4237
  contentSource: {
@@ -4173,6 +4281,9 @@ declare const ShareAddressedDelegationEnvelopeV2Schema: z.ZodObject<{
4173
4281
  } | {
4174
4282
  value: string;
4175
4283
  kind: "emailDomain";
4284
+ } | {
4285
+ value: string;
4286
+ kind: "recipientDid";
4176
4287
  };
4177
4288
  nodeAudience: string;
4178
4289
  contentSource: {
@@ -4404,4 +4515,4 @@ declare const ShareNativeResponseSchema: z.ZodDiscriminatedUnion<"action", [z.Zo
4404
4515
  }>]>;
4405
4516
  type ShareNativeResponse = z.infer<typeof ShareNativeResponseSchema>;
4406
4517
 
4407
- export { type SenderShareKeyStorage as $, type AccountDelegationPage as A, type KeyProvider as B, type CapabilityEntry as C, DelegationManager as D, type EncodedShareData as E, type KeyType as F, type GenerateShareParams as G, MAX_SEALED_SHARE_CONTENT_BYTES as H, type ICapabilityKeyRegistry as I, type JWK as J, type KeyInfo as K, MAX_SHARE_ARTIFACT_BYTES as L, MAX_CONTENT_BYTES as M, MAX_SHARE_CONTENT_BYTES as N, MemorySenderShareKeyStorage as O, MemorySenderShareRecordStorage as P, MemoryShareCache as Q, type Result as R, type OwnerDelegationReceipt as S, type OwnerShareAction as T, type OwnerShareMatcher as U, type OwnerSharePolicyRegistration as V, type OwnerSharePolicyRegistrationReceipt as W, type OwnerSharePolicyV2 as X, type ReceiveOptions as Y, type RegisterOwnerSharePolicyParams as Z, SHARE_DELIVERY_AUTHORIZATION_DOMAIN as _, type DelegationError as a, type ShareResource as a$, type SenderShareRecord as a0, type SenderShareRecordStorage as a1, type SenderShareRevocationScope as a2, SenderShareStore as a3, type ShareAccess as a4, ShareAccessError as a5, type ShareAccessV2 as a6, type ShareAction as a7, ShareActionSchema as a8, type ShareAddressedDelegationEnvelopeV2 as a9, type ShareLinkData as aA, type ShareLinkLocation as aB, type ShareListEntry as aC, type ShareListResult as aD, type ShareNativeAction as aE, type ShareNativeInvokeEnvelopeV1 as aF, type ShareNativeInvokeErrorResult as aG, type ShareNativeInvokeInput as aH, type ShareNativeInvokeResult as aI, type ShareNativeInvokeSuccessResult as aJ, type ShareNativeResponse as aK, ShareNativeResponseSchema as aL, type SharePolicy as aM, type SharePolicyBinding as aN, type SharePolicySession as aO, type SharePolicySessionV1 as aP, type SharePolicySessionWireV1 as aQ, type ShareReadInvocationV1 as aR, type ShareReadResult as aS, ShareRecipientClient as aT, type ShareRecipientClientOptions as aU, ShareRecipientClientOptionsSchema as aV, type ShareRecipientPolicy as aW, ShareRecipientPolicySchema as aX, type ShareRecipientResult as aY, type ShareRecipientTarget as aZ, ShareRecipientTargetSchema as a_, ShareAddressedDelegationEnvelopeV2Schema as aa, type ShareAddressedDelegationRequestV2 as ab, ShareAddressedDelegationRequestV2Schema as ac, type ShareAddressedDelegationResponseV2 as ad, ShareAddressedDelegationResponseV2Schema as ae, type ShareAddressedRecipientMatcher as af, type ShareArtifactInput as ag, type ShareArtifactResult as ah, type ShareArtifactV2 as ai, type ShareCache as aj, type ShareCacheEntry as ak, type ShareCacheKey as al, type ShareCacheMetadata as am, type ShareCapabilityLike as an, ShareConflict as ao, type ShareContentMetadata as ap, type ShareContentSource as aq, type ShareDeliveryAuthorization as ar, type ShareDeliveryAuthorizationReceipt as as, type ShareDeliveryAuthorizationRequest as at, type ShareDetachedProof as au, ShareEnvelopeError as av, type ShareEnvelopeV2 as aw, type ShareExpiryBounds as ax, type ShareKvContentSource as ay, type ShareLink as az, type AccountDelegationQueryOptions as b, ShareResourceSchema as b0, type ShareSaveOptions as b1, type ShareSchema as b2, type ShareSqlContentSource as b3, type ShareWireAction as b4, SharingService as b5, type SharingServiceConfig as b6, type SignedDelegation as b7, type SpaceInfo as b8, type SpaceOwnership as b9, shareDeliveryTrustedKid as bA, signShareEnvelope as bB, validateOwnerSharePolicyRegistration as bC, validateOwnerSharePolicyRegistrationBytes as bD, validateShareDeliveryAuthorizationBytes as bE, verifyShareCid as bF, verifyShareEnvelope as bG, CapabilityKeyRegistry as bH, type CapabilityKeyRegistryErrorCode as bI, CapabilityKeyRegistryErrorCodes as bJ, type StoredDelegationChain as bK, createCapabilityKeyRegistry as bL, type ValidateShareDeliveryAuthorizationExpected as ba, type VerifyShareEnvelopeOptions as bb, canonicalOwnerSharePolicy as bc, computeOwnerShareRegistrationCid as bd, computeShareCid as be, createDelegatedShareKey as bf, createPolicyEnforcementDelegation as bg, createShareArtifact as bh, createShareArtifactAsync as bi, createSharePolicy as bj, createSharingService as bk, decryptShareBytesAsync as bl, encodeInlineShareUrl as bm, encodeShareArtifact as bn, encodeShareUrl as bo, encryptShareBytes as bp, encryptShareBytesAsync as bq, intersectShareCapabilities as br, isV2ShareLink as bs, normalizeShareActions as bt, normalizeShareRecipientTarget as bu, normalizeShareResource as bv, parseShareArtifact as bw, parseShareUrl as bx, restoreDelegatedShareKey as by, shareCapabilityAllows as bz, type AccountDelegationRecord as c, type AccountDelegationResource as d, type CreateDelegationParams as e, type CreateDelegationWasmParams as f, type CreateDelegationWasmResult as g, type CreateOwnerDelegationParams as h, type DelegateReceivedShareParams as i, type DelegatedResource as j, type DelegatedShareAccess as k, type DelegatedShareKey as l, type Delegation as m, type DelegationApiResponse as n, type DelegationChain as o, type DelegationChainV2 as p, type DelegationDirection as q, type DelegationErrorCode as r, DelegationErrorCodes as s, type DelegationFilters as t, type DelegationManagerConfig as u, type DelegationRecord as v, type DelegationRevocationReceipt as w, type DelegationStatus as x, type ISharingService as y, type IngestOptions as z };
4518
+ export { type RegisterOwnerSharePolicyParams as $, type AccountDelegationPage as A, type KeyProvider as B, type CapabilityEntry as C, DelegationManager as D, type EncodedShareData as E, type KeyType as F, type GenerateShareParams as G, MAX_SEALED_SHARE_CONTENT_BYTES as H, type ICapabilityKeyRegistry as I, type JWK as J, type KeyInfo as K, MAX_SHARE_ARTIFACT_BYTES as L, MAX_CONTENT_BYTES as M, MAX_SHARE_CONTENT_BYTES as N, MemorySenderShareKeyStorage as O, MemorySenderShareRecordStorage as P, MemoryShareCache as Q, type Result as R, type OwnerDelegationPermission as S, type OwnerDelegationReceipt as T, type OwnerShareAction as U, type OwnerShareDecryption as V, type OwnerShareMatcher as W, type OwnerSharePolicyRegistration as X, type OwnerSharePolicyRegistrationReceipt as Y, type OwnerSharePolicyV2 as Z, type ReceiveOptions as _, type DelegationError as a, type ShareRecipientTarget as a$, SHARE_DELIVERY_AUTHORIZATION_DOMAIN as a0, type SenderShareKeyStorage as a1, type SenderShareRecord as a2, type SenderShareRecordStorage as a3, type SenderShareRevocationScope as a4, SenderShareStore as a5, type ShareAccess as a6, ShareAccessError as a7, type ShareAccessV2 as a8, type ShareAction as a9, type ShareKvContentSource as aA, type ShareLink as aB, type ShareLinkData as aC, type ShareLinkLocation as aD, type ShareListEntry as aE, type ShareListResult as aF, type ShareNativeAction as aG, type ShareNativeInvokeEnvelopeV1 as aH, type ShareNativeInvokeErrorResult as aI, type ShareNativeInvokeInput as aJ, type ShareNativeInvokeResult as aK, type ShareNativeInvokeSuccessResult as aL, type ShareNativeResponse as aM, ShareNativeResponseSchema as aN, type SharePolicy as aO, type SharePolicyBinding as aP, type SharePolicySession as aQ, type SharePolicySessionV1 as aR, type SharePolicySessionWireV1 as aS, type ShareReadInvocationV1 as aT, type ShareReadResult as aU, ShareRecipientClient as aV, type ShareRecipientClientOptions as aW, ShareRecipientClientOptionsSchema as aX, type ShareRecipientPolicy as aY, ShareRecipientPolicySchema as aZ, type ShareRecipientResult as a_, ShareActionSchema as aa, type ShareAddressedDelegationEnvelopeV2 as ab, ShareAddressedDelegationEnvelopeV2Schema as ac, type ShareAddressedDelegationRequestV2 as ad, ShareAddressedDelegationRequestV2Schema as ae, type ShareAddressedDelegationResponseV2 as af, ShareAddressedDelegationResponseV2Schema as ag, type ShareAddressedRecipientMatcher as ah, type ShareArtifactInput as ai, type ShareArtifactResult as aj, type ShareArtifactV2 as ak, type ShareCache as al, type ShareCacheEntry as am, type ShareCacheKey as an, type ShareCacheMetadata as ao, type ShareCapabilityLike as ap, ShareConflict as aq, type ShareContentMetadata as ar, type ShareContentSource as as, type ShareDeliveryAuthorization as at, type ShareDeliveryAuthorizationReceipt as au, type ShareDeliveryAuthorizationRequest as av, type ShareDetachedProof as aw, ShareEnvelopeError as ax, type ShareEnvelopeV2 as ay, type ShareExpiryBounds as az, type AccountDelegationQueryOptions as b, ShareRecipientTargetSchema as b0, type ShareResource as b1, ShareResourceSchema as b2, type ShareSaveOptions as b3, type ShareSchema as b4, type ShareSqlContentSource as b5, type ShareWireAction as b6, SharingService as b7, type SharingServiceConfig as b8, type SignedDelegation as b9, restoreDelegatedShareKey as bA, shareCapabilityAllows as bB, shareDeliveryTrustedKid as bC, signShareEnvelope as bD, validateOwnerSharePolicyRegistration as bE, validateOwnerSharePolicyRegistrationBytes as bF, validateShareDeliveryAuthorizationBytes as bG, verifyShareCid as bH, verifyShareEnvelope as bI, CapabilityKeyRegistry as bJ, type CapabilityKeyRegistryErrorCode as bK, CapabilityKeyRegistryErrorCodes as bL, type StoredDelegationChain as bM, createCapabilityKeyRegistry as bN, type SpaceInfo as ba, type SpaceOwnership as bb, type ValidateShareDeliveryAuthorizationExpected as bc, type VerifyShareEnvelopeOptions as bd, canonicalOwnerSharePolicy as be, computeOwnerShareRegistrationCid as bf, computeShareCid as bg, createDelegatedShareKey as bh, createPolicyEnforcementDelegation as bi, createShareArtifact as bj, createShareArtifactAsync as bk, createSharePolicy as bl, createSharingService as bm, decryptShareBytesAsync as bn, encodeInlineShareUrl as bo, encodeShareArtifact as bp, encodeShareUrl as bq, encryptShareBytes as br, encryptShareBytesAsync as bs, intersectShareCapabilities as bt, isV2ShareLink as bu, normalizeShareActions as bv, normalizeShareRecipientTarget as bw, normalizeShareResource as bx, parseShareArtifact as by, parseShareUrl as bz, type AccountDelegationRecord as c, type AccountDelegationResource as d, type CreateDelegationParams as e, type CreateDelegationWasmParams as f, type CreateDelegationWasmResult as g, type CreateOwnerDelegationParams as h, type DelegateReceivedShareParams as i, type DelegatedResource as j, type DelegatedShareAccess as k, type DelegatedShareKey as l, type Delegation as m, type DelegationApiResponse as n, type DelegationChain as o, type DelegationChainV2 as p, type DelegationDirection as q, type DelegationErrorCode as r, DelegationErrorCodes as s, type DelegationFilters as t, type DelegationManagerConfig as u, type DelegationRecord as v, type DelegationRevocationReceipt as w, type DelegationStatus as x, type ISharingService as y, type IngestOptions as z };
@@ -2259,6 +2259,9 @@ type ShareRecipientTarget = {
2259
2259
  } | {
2260
2260
  readonly kind: "emailDomain";
2261
2261
  readonly value: string;
2262
+ } | {
2263
+ readonly kind: "recipientDid";
2264
+ readonly value: string;
2262
2265
  } | {
2263
2266
  readonly kind: "bearer";
2264
2267
  };
@@ -2536,6 +2539,19 @@ interface ShareRecipientClientOptions {
2536
2539
  readonly envelope: ShareEnvelopeV2;
2537
2540
  readonly presentation?: unknown;
2538
2541
  }) => Promise<SharePolicySession>;
2542
+ /** Direct DID authorization is explicit and may return a resumable device step. */
2543
+ readonly establishRecipientDidSession?: (input: {
2544
+ readonly envelope: ShareEnvelopeV2;
2545
+ readonly recipientDid: string;
2546
+ }) => Promise<SharePolicySession | {
2547
+ readonly state: "authorization-required";
2548
+ readonly method: "openkey-device";
2549
+ readonly continueUrl?: string;
2550
+ readonly resumeToken: string;
2551
+ } | {
2552
+ readonly state: "denied";
2553
+ readonly reason: string;
2554
+ }>;
2539
2555
  /**
2540
2556
  * Builds the holder presentation/session request after Node returns a
2541
2557
  * fresh challenge. The callback is deliberately invoked only after the
@@ -2740,7 +2756,8 @@ declare class ShareConflict extends Error {
2740
2756
  }
2741
2757
  declare class ShareAccessError extends Error {
2742
2758
  readonly code: string;
2743
- constructor(code: string, message?: string);
2759
+ readonly details?: unknown;
2760
+ constructor(code: string, message?: string, details?: unknown);
2744
2761
  }
2745
2762
  interface ShareAccessV2 {
2746
2763
  readonly kind: "share-v2";
@@ -3229,22 +3246,52 @@ interface OwnerDelegationReceipt {
3229
3246
  readonly actions: readonly string[];
3230
3247
  readonly expiry: Date;
3231
3248
  };
3249
+ /** Exact service-scoped capabilities encoded in the signed owner delegation. */
3250
+ readonly permissions: readonly OwnerDelegationPermission[];
3232
3251
  }
3233
- interface CreateOwnerDelegationParams {
3234
- readonly delegateDid: string;
3235
- readonly spaceId: string;
3252
+ interface OwnerDelegationPermission {
3253
+ /** Canonical long-form service name, for example `tinycloud.kv`. */
3254
+ readonly service: string;
3255
+ /** Exact service resource path. Encryption permissions use a network URN. */
3236
3256
  readonly path: string;
3257
+ /** Canonical full action URNs belonging to `service`. */
3237
3258
  readonly actions: readonly string[];
3259
+ }
3260
+ interface CreateOwnerDelegationBase {
3261
+ readonly delegateDid: string;
3262
+ readonly spaceId: string;
3238
3263
  readonly expiresAt: Date;
3239
3264
  }
3265
+ /**
3266
+ * A wallet-rooted owner delegation accepts either the historical single-path
3267
+ * shape or an exact list of service-scoped permissions. The two forms are
3268
+ * mutually exclusive so callers cannot sign authority from one field while
3269
+ * displaying or persisting a contradictory second field.
3270
+ */
3271
+ type CreateOwnerDelegationParams = CreateOwnerDelegationBase & ({
3272
+ readonly path: string;
3273
+ readonly actions: readonly string[];
3274
+ readonly permissions?: never;
3275
+ } | {
3276
+ readonly permissions: readonly OwnerDelegationPermission[];
3277
+ readonly path?: never;
3278
+ readonly actions?: never;
3279
+ });
3240
3280
  declare const MAX_CONTENT_BYTES: number;
3241
3281
  type OwnerShareAction = "tinycloud.kv/get" | "tinycloud.kv/list" | "tinycloud.kv/metadata" | "tinycloud.kv/put";
3282
+ interface OwnerShareDecryption {
3283
+ readonly networkId: string;
3284
+ readonly action: "tinycloud.encryption/decrypt";
3285
+ }
3242
3286
  type OwnerShareMatcher = {
3243
3287
  readonly kind: "exactEmail";
3244
3288
  readonly value: string;
3245
3289
  } | {
3246
3290
  readonly kind: "emailDomain";
3247
3291
  readonly value: string;
3292
+ } | {
3293
+ readonly kind: "recipientDid";
3294
+ readonly value: string;
3248
3295
  };
3249
3296
  interface OwnerSharePolicyV2 {
3250
3297
  readonly type: "TinyCloudSharePolicy";
@@ -3264,6 +3311,7 @@ interface OwnerSharePolicyV2 {
3264
3311
  readonly path: string;
3265
3312
  };
3266
3313
  readonly actions: readonly OwnerShareAction[];
3314
+ readonly decryption?: OwnerShareDecryption;
3267
3315
  readonly contentSource: {
3268
3316
  readonly kind: "kv";
3269
3317
  readonly space: string;
@@ -3331,6 +3379,7 @@ interface OwnerSharePolicyRegistration {
3331
3379
  readonly path: string;
3332
3380
  };
3333
3381
  readonly actions: readonly OwnerShareAction[];
3382
+ readonly decryption?: OwnerShareDecryption;
3334
3383
  readonly contentSource: {
3335
3384
  readonly kind: "kv";
3336
3385
  readonly space: string;
@@ -3374,6 +3423,7 @@ declare function createPolicyEnforcementDelegation(input: {
3374
3423
  readonly nodeAudience: string;
3375
3424
  readonly path: string;
3376
3425
  readonly actions: readonly OwnerShareAction[];
3426
+ readonly decryption?: OwnerShareDecryption;
3377
3427
  readonly contentSourceDigest: string;
3378
3428
  readonly expiresAt: string;
3379
3429
  }): Promise<SignedDelegation>;
@@ -3402,6 +3452,7 @@ interface ShareDeliveryAuthorizationRequest {
3402
3452
  readonly shareUrl: string;
3403
3453
  readonly documentName: string;
3404
3454
  readonly jti: string;
3455
+ readonly idempotencyKey: string;
3405
3456
  readonly expiresAt: string;
3406
3457
  readonly requestBodyDigest: string;
3407
3458
  }
@@ -3612,6 +3663,15 @@ declare const ShareRecipientTargetSchema: z.ZodDiscriminatedUnion<"kind", [z.Zod
3612
3663
  }, {
3613
3664
  value: string;
3614
3665
  kind: "emailDomain";
3666
+ }>, z.ZodObject<{
3667
+ kind: z.ZodLiteral<"recipientDid">;
3668
+ value: z.ZodString;
3669
+ }, "strict", z.ZodTypeAny, {
3670
+ value: string;
3671
+ kind: "recipientDid";
3672
+ }, {
3673
+ value: string;
3674
+ kind: "recipientDid";
3615
3675
  }>, z.ZodObject<{
3616
3676
  kind: z.ZodLiteral<"bearer">;
3617
3677
  }, "strict", z.ZodTypeAny, {
@@ -3658,6 +3718,15 @@ declare const ShareRecipientPolicySchema: z.ZodObject<{
3658
3718
  }, {
3659
3719
  value: string;
3660
3720
  kind: "emailDomain";
3721
+ }>, z.ZodObject<{
3722
+ kind: z.ZodLiteral<"recipientDid">;
3723
+ value: z.ZodString;
3724
+ }, "strict", z.ZodTypeAny, {
3725
+ value: string;
3726
+ kind: "recipientDid";
3727
+ }, {
3728
+ value: string;
3729
+ kind: "recipientDid";
3661
3730
  }>, z.ZodObject<{
3662
3731
  kind: z.ZodLiteral<"bearer">;
3663
3732
  }, "strict", z.ZodTypeAny, {
@@ -3704,6 +3773,9 @@ declare const ShareRecipientPolicySchema: z.ZodObject<{
3704
3773
  } | {
3705
3774
  value: string;
3706
3775
  kind: "emailDomain";
3776
+ } | {
3777
+ value: string;
3778
+ kind: "recipientDid";
3707
3779
  } | {
3708
3780
  kind: "bearer";
3709
3781
  };
@@ -3724,6 +3796,9 @@ declare const ShareRecipientPolicySchema: z.ZodObject<{
3724
3796
  } | {
3725
3797
  value: string;
3726
3798
  kind: "emailDomain";
3799
+ } | {
3800
+ value: string;
3801
+ kind: "recipientDid";
3727
3802
  } | {
3728
3803
  kind: "bearer";
3729
3804
  };
@@ -3770,6 +3845,15 @@ declare const ShareAddressedDelegationRequestV2Schema: z.ZodObject<{
3770
3845
  }, {
3771
3846
  value: string;
3772
3847
  kind: "emailDomain";
3848
+ }>, z.ZodObject<{
3849
+ kind: z.ZodLiteral<"recipientDid">;
3850
+ value: z.ZodString;
3851
+ }, "strict", z.ZodTypeAny, {
3852
+ value: string;
3853
+ kind: "recipientDid";
3854
+ }, {
3855
+ value: string;
3856
+ kind: "recipientDid";
3773
3857
  }>]>;
3774
3858
  targetOrigin: z.ZodString;
3775
3859
  nodeAudience: z.ZodString;
@@ -3851,6 +3935,9 @@ declare const ShareAddressedDelegationRequestV2Schema: z.ZodObject<{
3851
3935
  } | {
3852
3936
  value: string;
3853
3937
  kind: "emailDomain";
3938
+ } | {
3939
+ value: string;
3940
+ kind: "recipientDid";
3854
3941
  };
3855
3942
  nodeAudience: string;
3856
3943
  contentSource: {
@@ -3893,6 +3980,9 @@ declare const ShareAddressedDelegationRequestV2Schema: z.ZodObject<{
3893
3980
  } | {
3894
3981
  value: string;
3895
3982
  kind: "emailDomain";
3983
+ } | {
3984
+ value: string;
3985
+ kind: "recipientDid";
3896
3986
  };
3897
3987
  nodeAudience: string;
3898
3988
  contentSource: {
@@ -3944,6 +4034,15 @@ declare const ShareAddressedDelegationEnvelopeV2Schema: z.ZodObject<{
3944
4034
  }, {
3945
4035
  value: string;
3946
4036
  kind: "emailDomain";
4037
+ }>, z.ZodObject<{
4038
+ kind: z.ZodLiteral<"recipientDid">;
4039
+ value: z.ZodString;
4040
+ }, "strict", z.ZodTypeAny, {
4041
+ value: string;
4042
+ kind: "recipientDid";
4043
+ }, {
4044
+ value: string;
4045
+ kind: "recipientDid";
3947
4046
  }>]>;
3948
4047
  targetOrigin: z.ZodString;
3949
4048
  nodeAudience: z.ZodString;
@@ -4025,6 +4124,9 @@ declare const ShareAddressedDelegationEnvelopeV2Schema: z.ZodObject<{
4025
4124
  } | {
4026
4125
  value: string;
4027
4126
  kind: "emailDomain";
4127
+ } | {
4128
+ value: string;
4129
+ kind: "recipientDid";
4028
4130
  };
4029
4131
  nodeAudience: string;
4030
4132
  contentSource: {
@@ -4067,6 +4169,9 @@ declare const ShareAddressedDelegationEnvelopeV2Schema: z.ZodObject<{
4067
4169
  } | {
4068
4170
  value: string;
4069
4171
  kind: "emailDomain";
4172
+ } | {
4173
+ value: string;
4174
+ kind: "recipientDid";
4070
4175
  };
4071
4176
  nodeAudience: string;
4072
4177
  contentSource: {
@@ -4124,6 +4229,9 @@ declare const ShareAddressedDelegationEnvelopeV2Schema: z.ZodObject<{
4124
4229
  } | {
4125
4230
  value: string;
4126
4231
  kind: "emailDomain";
4232
+ } | {
4233
+ value: string;
4234
+ kind: "recipientDid";
4127
4235
  };
4128
4236
  nodeAudience: string;
4129
4237
  contentSource: {
@@ -4173,6 +4281,9 @@ declare const ShareAddressedDelegationEnvelopeV2Schema: z.ZodObject<{
4173
4281
  } | {
4174
4282
  value: string;
4175
4283
  kind: "emailDomain";
4284
+ } | {
4285
+ value: string;
4286
+ kind: "recipientDid";
4176
4287
  };
4177
4288
  nodeAudience: string;
4178
4289
  contentSource: {
@@ -4404,4 +4515,4 @@ declare const ShareNativeResponseSchema: z.ZodDiscriminatedUnion<"action", [z.Zo
4404
4515
  }>]>;
4405
4516
  type ShareNativeResponse = z.infer<typeof ShareNativeResponseSchema>;
4406
4517
 
4407
- export { type SenderShareKeyStorage as $, type AccountDelegationPage as A, type KeyProvider as B, type CapabilityEntry as C, DelegationManager as D, type EncodedShareData as E, type KeyType as F, type GenerateShareParams as G, MAX_SEALED_SHARE_CONTENT_BYTES as H, type ICapabilityKeyRegistry as I, type JWK as J, type KeyInfo as K, MAX_SHARE_ARTIFACT_BYTES as L, MAX_CONTENT_BYTES as M, MAX_SHARE_CONTENT_BYTES as N, MemorySenderShareKeyStorage as O, MemorySenderShareRecordStorage as P, MemoryShareCache as Q, type Result as R, type OwnerDelegationReceipt as S, type OwnerShareAction as T, type OwnerShareMatcher as U, type OwnerSharePolicyRegistration as V, type OwnerSharePolicyRegistrationReceipt as W, type OwnerSharePolicyV2 as X, type ReceiveOptions as Y, type RegisterOwnerSharePolicyParams as Z, SHARE_DELIVERY_AUTHORIZATION_DOMAIN as _, type DelegationError as a, type ShareResource as a$, type SenderShareRecord as a0, type SenderShareRecordStorage as a1, type SenderShareRevocationScope as a2, SenderShareStore as a3, type ShareAccess as a4, ShareAccessError as a5, type ShareAccessV2 as a6, type ShareAction as a7, ShareActionSchema as a8, type ShareAddressedDelegationEnvelopeV2 as a9, type ShareLinkData as aA, type ShareLinkLocation as aB, type ShareListEntry as aC, type ShareListResult as aD, type ShareNativeAction as aE, type ShareNativeInvokeEnvelopeV1 as aF, type ShareNativeInvokeErrorResult as aG, type ShareNativeInvokeInput as aH, type ShareNativeInvokeResult as aI, type ShareNativeInvokeSuccessResult as aJ, type ShareNativeResponse as aK, ShareNativeResponseSchema as aL, type SharePolicy as aM, type SharePolicyBinding as aN, type SharePolicySession as aO, type SharePolicySessionV1 as aP, type SharePolicySessionWireV1 as aQ, type ShareReadInvocationV1 as aR, type ShareReadResult as aS, ShareRecipientClient as aT, type ShareRecipientClientOptions as aU, ShareRecipientClientOptionsSchema as aV, type ShareRecipientPolicy as aW, ShareRecipientPolicySchema as aX, type ShareRecipientResult as aY, type ShareRecipientTarget as aZ, ShareRecipientTargetSchema as a_, ShareAddressedDelegationEnvelopeV2Schema as aa, type ShareAddressedDelegationRequestV2 as ab, ShareAddressedDelegationRequestV2Schema as ac, type ShareAddressedDelegationResponseV2 as ad, ShareAddressedDelegationResponseV2Schema as ae, type ShareAddressedRecipientMatcher as af, type ShareArtifactInput as ag, type ShareArtifactResult as ah, type ShareArtifactV2 as ai, type ShareCache as aj, type ShareCacheEntry as ak, type ShareCacheKey as al, type ShareCacheMetadata as am, type ShareCapabilityLike as an, ShareConflict as ao, type ShareContentMetadata as ap, type ShareContentSource as aq, type ShareDeliveryAuthorization as ar, type ShareDeliveryAuthorizationReceipt as as, type ShareDeliveryAuthorizationRequest as at, type ShareDetachedProof as au, ShareEnvelopeError as av, type ShareEnvelopeV2 as aw, type ShareExpiryBounds as ax, type ShareKvContentSource as ay, type ShareLink as az, type AccountDelegationQueryOptions as b, ShareResourceSchema as b0, type ShareSaveOptions as b1, type ShareSchema as b2, type ShareSqlContentSource as b3, type ShareWireAction as b4, SharingService as b5, type SharingServiceConfig as b6, type SignedDelegation as b7, type SpaceInfo as b8, type SpaceOwnership as b9, shareDeliveryTrustedKid as bA, signShareEnvelope as bB, validateOwnerSharePolicyRegistration as bC, validateOwnerSharePolicyRegistrationBytes as bD, validateShareDeliveryAuthorizationBytes as bE, verifyShareCid as bF, verifyShareEnvelope as bG, CapabilityKeyRegistry as bH, type CapabilityKeyRegistryErrorCode as bI, CapabilityKeyRegistryErrorCodes as bJ, type StoredDelegationChain as bK, createCapabilityKeyRegistry as bL, type ValidateShareDeliveryAuthorizationExpected as ba, type VerifyShareEnvelopeOptions as bb, canonicalOwnerSharePolicy as bc, computeOwnerShareRegistrationCid as bd, computeShareCid as be, createDelegatedShareKey as bf, createPolicyEnforcementDelegation as bg, createShareArtifact as bh, createShareArtifactAsync as bi, createSharePolicy as bj, createSharingService as bk, decryptShareBytesAsync as bl, encodeInlineShareUrl as bm, encodeShareArtifact as bn, encodeShareUrl as bo, encryptShareBytes as bp, encryptShareBytesAsync as bq, intersectShareCapabilities as br, isV2ShareLink as bs, normalizeShareActions as bt, normalizeShareRecipientTarget as bu, normalizeShareResource as bv, parseShareArtifact as bw, parseShareUrl as bx, restoreDelegatedShareKey as by, shareCapabilityAllows as bz, type AccountDelegationRecord as c, type AccountDelegationResource as d, type CreateDelegationParams as e, type CreateDelegationWasmParams as f, type CreateDelegationWasmResult as g, type CreateOwnerDelegationParams as h, type DelegateReceivedShareParams as i, type DelegatedResource as j, type DelegatedShareAccess as k, type DelegatedShareKey as l, type Delegation as m, type DelegationApiResponse as n, type DelegationChain as o, type DelegationChainV2 as p, type DelegationDirection as q, type DelegationErrorCode as r, DelegationErrorCodes as s, type DelegationFilters as t, type DelegationManagerConfig as u, type DelegationRecord as v, type DelegationRevocationReceipt as w, type DelegationStatus as x, type ISharingService as y, type IngestOptions as z };
4518
+ export { type RegisterOwnerSharePolicyParams as $, type AccountDelegationPage as A, type KeyProvider as B, type CapabilityEntry as C, DelegationManager as D, type EncodedShareData as E, type KeyType as F, type GenerateShareParams as G, MAX_SEALED_SHARE_CONTENT_BYTES as H, type ICapabilityKeyRegistry as I, type JWK as J, type KeyInfo as K, MAX_SHARE_ARTIFACT_BYTES as L, MAX_CONTENT_BYTES as M, MAX_SHARE_CONTENT_BYTES as N, MemorySenderShareKeyStorage as O, MemorySenderShareRecordStorage as P, MemoryShareCache as Q, type Result as R, type OwnerDelegationPermission as S, type OwnerDelegationReceipt as T, type OwnerShareAction as U, type OwnerShareDecryption as V, type OwnerShareMatcher as W, type OwnerSharePolicyRegistration as X, type OwnerSharePolicyRegistrationReceipt as Y, type OwnerSharePolicyV2 as Z, type ReceiveOptions as _, type DelegationError as a, type ShareRecipientTarget as a$, SHARE_DELIVERY_AUTHORIZATION_DOMAIN as a0, type SenderShareKeyStorage as a1, type SenderShareRecord as a2, type SenderShareRecordStorage as a3, type SenderShareRevocationScope as a4, SenderShareStore as a5, type ShareAccess as a6, ShareAccessError as a7, type ShareAccessV2 as a8, type ShareAction as a9, type ShareKvContentSource as aA, type ShareLink as aB, type ShareLinkData as aC, type ShareLinkLocation as aD, type ShareListEntry as aE, type ShareListResult as aF, type ShareNativeAction as aG, type ShareNativeInvokeEnvelopeV1 as aH, type ShareNativeInvokeErrorResult as aI, type ShareNativeInvokeInput as aJ, type ShareNativeInvokeResult as aK, type ShareNativeInvokeSuccessResult as aL, type ShareNativeResponse as aM, ShareNativeResponseSchema as aN, type SharePolicy as aO, type SharePolicyBinding as aP, type SharePolicySession as aQ, type SharePolicySessionV1 as aR, type SharePolicySessionWireV1 as aS, type ShareReadInvocationV1 as aT, type ShareReadResult as aU, ShareRecipientClient as aV, type ShareRecipientClientOptions as aW, ShareRecipientClientOptionsSchema as aX, type ShareRecipientPolicy as aY, ShareRecipientPolicySchema as aZ, type ShareRecipientResult as a_, ShareActionSchema as aa, type ShareAddressedDelegationEnvelopeV2 as ab, ShareAddressedDelegationEnvelopeV2Schema as ac, type ShareAddressedDelegationRequestV2 as ad, ShareAddressedDelegationRequestV2Schema as ae, type ShareAddressedDelegationResponseV2 as af, ShareAddressedDelegationResponseV2Schema as ag, type ShareAddressedRecipientMatcher as ah, type ShareArtifactInput as ai, type ShareArtifactResult as aj, type ShareArtifactV2 as ak, type ShareCache as al, type ShareCacheEntry as am, type ShareCacheKey as an, type ShareCacheMetadata as ao, type ShareCapabilityLike as ap, ShareConflict as aq, type ShareContentMetadata as ar, type ShareContentSource as as, type ShareDeliveryAuthorization as at, type ShareDeliveryAuthorizationReceipt as au, type ShareDeliveryAuthorizationRequest as av, type ShareDetachedProof as aw, ShareEnvelopeError as ax, type ShareEnvelopeV2 as ay, type ShareExpiryBounds as az, type AccountDelegationQueryOptions as b, ShareRecipientTargetSchema as b0, type ShareResource as b1, ShareResourceSchema as b2, type ShareSaveOptions as b3, type ShareSchema as b4, type ShareSqlContentSource as b5, type ShareWireAction as b6, SharingService as b7, type SharingServiceConfig as b8, type SignedDelegation as b9, restoreDelegatedShareKey as bA, shareCapabilityAllows as bB, shareDeliveryTrustedKid as bC, signShareEnvelope as bD, validateOwnerSharePolicyRegistration as bE, validateOwnerSharePolicyRegistrationBytes as bF, validateShareDeliveryAuthorizationBytes as bG, verifyShareCid as bH, verifyShareEnvelope as bI, CapabilityKeyRegistry as bJ, type CapabilityKeyRegistryErrorCode as bK, CapabilityKeyRegistryErrorCodes as bL, type StoredDelegationChain as bM, createCapabilityKeyRegistry as bN, type SpaceInfo as ba, type SpaceOwnership as bb, type ValidateShareDeliveryAuthorizationExpected as bc, type VerifyShareEnvelopeOptions as bd, canonicalOwnerSharePolicy as be, computeOwnerShareRegistrationCid as bf, computeShareCid as bg, createDelegatedShareKey as bh, createPolicyEnforcementDelegation as bi, createShareArtifact as bj, createShareArtifactAsync as bk, createSharePolicy as bl, createSharingService as bm, decryptShareBytesAsync as bn, encodeInlineShareUrl as bo, encodeShareArtifact as bp, encodeShareUrl as bq, encryptShareBytes as br, encryptShareBytesAsync as bs, intersectShareCapabilities as bt, isV2ShareLink as bu, normalizeShareActions as bv, normalizeShareRecipientTarget as bw, normalizeShareResource as bx, parseShareArtifact as by, parseShareUrl as bz, type AccountDelegationRecord as c, type AccountDelegationResource as d, type CreateDelegationParams as e, type CreateDelegationWasmParams as f, type CreateDelegationWasmResult as g, type CreateOwnerDelegationParams as h, type DelegateReceivedShareParams as i, type DelegatedResource as j, type DelegatedShareAccess as k, type DelegatedShareKey as l, type Delegation as m, type DelegationApiResponse as n, type DelegationChain as o, type DelegationChainV2 as p, type DelegationDirection as q, type DelegationErrorCode as r, DelegationErrorCodes as s, type DelegationFilters as t, type DelegationManagerConfig as u, type DelegationRecord as v, type DelegationRevocationReceipt as w, type DelegationStatus as x, type ISharingService as y, type IngestOptions as z };