@tinycloud/sdk-services 3.2.0-beta.2 → 3.2.0-beta.3

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.
Files changed (39) hide show
  1. package/dist/{BaseService-DWbPbov7.d.cts → BaseService-BDQXjWMx.d.cts} +1 -1
  2. package/dist/{BaseService-B_UKhVht.d.ts → BaseService-Di_hVfUV.d.ts} +1 -1
  3. package/dist/encryption/index.cjs +7 -1
  4. package/dist/encryption/index.cjs.map +1 -1
  5. package/dist/encryption/index.d.cts +2 -2
  6. package/dist/encryption/index.d.ts +2 -2
  7. package/dist/encryption/index.js +7 -1
  8. package/dist/encryption/index.js.map +1 -1
  9. package/dist/index.cjs +595 -353
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.d.cts +36 -26
  12. package/dist/index.d.ts +36 -26
  13. package/dist/index.js +590 -353
  14. package/dist/index.js.map +1 -1
  15. package/dist/internal/decrypt-transport-response-error.d.cts +1 -1
  16. package/dist/internal/decrypt-transport-response-error.d.ts +1 -1
  17. package/dist/kv/index.cjs +530 -334
  18. package/dist/kv/index.cjs.map +1 -1
  19. package/dist/kv/index.d.cts +17 -468
  20. package/dist/kv/index.d.ts +17 -468
  21. package/dist/kv/index.js +524 -333
  22. package/dist/kv/index.js.map +1 -1
  23. package/dist/kv/replication/index.cjs +1375 -0
  24. package/dist/kv/replication/index.cjs.map +1 -0
  25. package/dist/kv/replication/index.d.cts +9 -0
  26. package/dist/kv/replication/index.d.ts +9 -0
  27. package/dist/kv/replication/index.js +1342 -0
  28. package/dist/kv/replication/index.js.map +1 -0
  29. package/dist/scope-BmLxwyl-.d.ts +957 -0
  30. package/dist/scope-D855kRDx.d.cts +957 -0
  31. package/dist/sql/index.cjs +12 -6
  32. package/dist/sql/index.cjs.map +1 -1
  33. package/dist/sql/index.d.cts +2 -2
  34. package/dist/sql/index.d.ts +2 -2
  35. package/dist/sql/index.js +12 -6
  36. package/dist/sql/index.js.map +1 -1
  37. package/dist/{types-CVwwxqXF.d.cts → types-7A5rHWRY.d.cts} +10 -1
  38. package/dist/{types-CVwwxqXF.d.ts → types-7A5rHWRY.d.ts} +10 -1
  39. package/package.json +18 -1
package/dist/index.d.cts CHANGED
@@ -1,10 +1,11 @@
1
- import { a as IServiceContext, c as InvokeFunction, d as InvokeAnyFunction, F as FetchFunction, S as ServiceSession, e as RetryPolicy, T as TelemetryConfig, I as IService, E as EventHandler, b as ServiceError, R as Result, P as PermissionHint, f as StorageQuotaInfo } from './types-CVwwxqXF.cjs';
2
- export { g as ErrorCode, h as ErrorCodes, i as FetchRequestInit, j as FetchResponse, k as InvocationFact, l as InvocationFacts, m as InvokeAnyEntry, n as ServiceErrorEvent, o as ServiceHeaders, p as ServiceRequestEvent, q as ServiceResponseEvent, r as ServiceRetryEvent, s as TelemetryEventHandler, t as TelemetryEvents, u as TelemetrySpanEvent, v as defaultRetryPolicy, w as err, x as ok, y as serviceError } from './types-CVwwxqXF.cjs';
1
+ import { a as IServiceContext, c as InvokeFunction, d as InvokeAnyFunction, F as FetchFunction, S as ServiceSession, e as RetryPolicy, T as TelemetryConfig, I as IService, E as EventHandler, b as ServiceError, R as Result, P as PermissionHint, f as StorageQuotaInfo } from './types-7A5rHWRY.cjs';
2
+ export { g as ErrorCode, h as ErrorCodes, i as FetchRequestInit, j as FetchResponse, k as InvocationFact, l as InvocationFacts, m as InvokeAnyEntry, n as ServiceErrorEvent, o as ServiceHeaders, p as ServiceRequestEvent, q as ServiceResponseEvent, r as ServiceRetryEvent, s as TelemetryEventHandler, t as TelemetryEvents, u as TelemetrySpanEvent, v as defaultRetryPolicy, w as err, x as ok, y as serviceError } from './types-7A5rHWRY.cjs';
3
3
  import { z } from 'zod';
4
- import { B as BaseService } from './BaseService-DWbPbov7.cjs';
5
- export { a as BaseServiceOptions, R as RequestSignal, S as ServiceConstructor, b as ServiceRegistration } from './BaseService-DWbPbov7.cjs';
4
+ import { B as BaseService } from './BaseService-BDQXjWMx.cjs';
5
+ export { a as BaseServiceOptions, R as RequestSignal, S as ServiceConstructor, b as ServiceRegistration } from './BaseService-BDQXjWMx.cjs';
6
6
  import { IKVService } from './kv/index.cjs';
7
- export { DEFAULT_SIGNED_READ_URL_EXPIRY_MS, IPrefixedKVService, KVAction, KVActionType, KVBatchPutItem, KVBatchPutOptions, KVBatchPutResponse, KVBatchReadResponse, KVChange, KVChangesAuthority, KVChangesOptions, KVChangesResponse, KVCreateSignedReadUrlOptions, KVDeleteOptions, KVGetOptions, KVHeadOptions, KVListOptions, KVListResponse, KVPutOptions, KVResponse, KVResponseHeaders, KVService, KVServiceConfig, KVSignedReadUrlResponse, PrefixedKVService } from './kv/index.cjs';
7
+ export { IPrefixedKVService, KVService, PrefixedKVService } from './kv/index.cjs';
8
+ export { A as AuthorityRefusal, C as CLEAR_PENDING_WARNING, I as DEFAULT_SIGNED_READ_URL_EXPIRY_MS, J as KVAction, M as KVActionType, N as KVBatchPutItem, O as KVBatchPutOptions, Q as KVBatchPutResponse, S as KVBatchReadResponse, T as KVChange, U as KVChangesAuthority, V as KVChangesOptions, W as KVChangesResponse, X as KVCreateSignedReadUrlOptions, Y as KVDeleteOptions, Z as KVGetOptions, _ as KVHeadOptions, $ as KVListOptions, b as KVListPage, a0 as KVListResponse, a1 as KVPutOptions, c as KVReadThrough, d as KVReplicaHandle, e as KVReplicaSpec, f as KVReplicaStorage, a as KVReplicationController, K as KVReplicationDeps, a2 as KVResponse, a3 as KVResponseHeaders, a4 as KVServiceConfig, a5 as KVSignedReadUrlResponse, L as LocalGetResult, g as LocalListResult, h as LocalReadMeta, i as LocalReplicaStatus, j as LocalSyncResult, k as PendingWriteRecord, l as PendingWriteState, P as PendingWriteStore, m as PinnedKey, n as PurgeTarget, o as ReplicaAuthorityState, p as ReplicaCoverage, q as ReplicaDevice, r as ReplicaGrantInfo, s as ReplicaState, t as ReplicaStatusEntry, u as ReplicationAuthority, v as ReplicationControl, w as ReplicationEvent, R as ReplicationIdentity, x as ReplicationOptions, y as ReplicationPurgeReport, z as ReplicationReason, B as ReplicationScheduler, D as ResolvedReplicationOptions, E as canonicalReplicationIdentity, F as kvPrefixCovers, G as replicationIdentityKey, H as requiresSecretsOptIn } from './scope-D855kRDx.cjs';
8
9
  export { BatchOptions, BatchResponse, DatabaseHandle, ExecuteOptions, ExecuteResponse, IDatabaseHandle, ISQLMigrations, ISQLService, QueryOptions, QueryResponse, SQLAction, SQLActionType, SQLMigrations, SQLService, SQLServiceConfig, SqlMigration, SqlMigrationApplyOptions, SqlMigrationApplyResponse, SqlStatement, SqlValue } from './sql/index.cjs';
9
10
  import { IEncryptionService, DecryptCapabilityProof } from './encryption/index.cjs';
10
11
  export { BuildCanonicalDecryptRequestInput, BuildDecryptFactsInput, BuildDecryptInvocationInput, BuiltDecryptInvocation, CanonicalDecryptRequest, CanonicalJson, DECRYPT_ACTION, DECRYPT_FACT_TYPE, DECRYPT_RESULT_TYPE, DEFAULT_ENCRYPTION_ALG, DEFAULT_KEY_VERSION, DecryptEnvelopeOptions, DecryptInvocationFact, DecryptInvocationSigner, DecryptRequestBody, DecryptResponseBody, DecryptTransport, DiscoverNetworkInput, DiscoveredNetwork, DiscoverySource, ENCRYPTION_NETWORK_URN_PREFIX, ENCRYPTION_SERVICE, ENCRYPTION_SERVICE_SHORT, ENVELOPE_VERSION, EncryptToNetworkInput, EncryptToNetworkOptions, EncryptToNetworkResult, EncryptionCrypto, EncryptionError, EncryptionErrorInput, EncryptionService, EncryptionServiceConfig, InlineEncryptedEnvelope, Json, NETWORK_NAME_PATTERN, NetworkDescriptor, NetworkIdError, NodeDescriptorFetcher, ParsedNetworkId, RandomReceiverKeyInput, ReceiverKeyPair, ReceiverKeySigner, SignedReceiverKeyInput, VerifyDecryptResponseInput, WellKnownDescriptorFetcher, base64Decode, base64Encode, buildCanonicalDecryptRequest, buildDecryptAttenuation, buildDecryptFacts, buildDecryptInvocation, buildNetworkId, canonicalHashHex, canonicalSignedResponse, canonicalize as canonicalizeEncryptionJson, checkDecryptInvocationInput, decryptEnvelopeWithKey, deriveSignedReceiverKey, discoverNetwork, encryptToNetwork, encryptionError, ensureNetworkUsableForDecrypt, generateRandomReceiverKey, hexDecode, hexEncode, isNetworkId, networkDiscoveryKey, openWrappedKey, parseNetworkId, utf8Decode, utf8Encode, validateEnvelope, verifyDecryptResponse } from './encryption/index.cjs';
@@ -92,14 +93,14 @@ declare const ServiceErrorSchema: z.ZodObject<{
92
93
  /** Additional metadata about the error - passthrough allows any object properties */
93
94
  meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
94
95
  }, "strip", z.ZodTypeAny, {
95
- message: string;
96
96
  code: string;
97
+ message: string;
97
98
  service: string;
98
99
  cause?: unknown;
99
100
  meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
100
101
  }, {
101
- message: string;
102
102
  code: string;
103
+ message: string;
103
104
  service: string;
104
105
  cause?: unknown;
105
106
  meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -177,22 +178,22 @@ declare const GenericResultSchema: z.ZodDiscriminatedUnion<"ok", [z.ZodObject<{
177
178
  /** Additional metadata about the error - passthrough allows any object properties */
178
179
  meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
179
180
  }, "strip", z.ZodTypeAny, {
180
- message: string;
181
181
  code: string;
182
+ message: string;
182
183
  service: string;
183
184
  cause?: unknown;
184
185
  meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
185
186
  }, {
186
- message: string;
187
187
  code: string;
188
+ message: string;
188
189
  service: string;
189
190
  cause?: unknown;
190
191
  meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
191
192
  }>;
192
193
  }, "strip", z.ZodTypeAny, {
193
194
  error: {
194
- message: string;
195
195
  code: string;
196
+ message: string;
196
197
  service: string;
197
198
  cause?: unknown;
198
199
  meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -200,8 +201,8 @@ declare const GenericResultSchema: z.ZodDiscriminatedUnion<"ok", [z.ZodObject<{
200
201
  ok: false;
201
202
  }, {
202
203
  error: {
203
- message: string;
204
204
  code: string;
205
+ message: string;
205
206
  service: string;
206
207
  cause?: unknown;
207
208
  meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -488,14 +489,14 @@ declare const ServiceRequestEventSchema: z.ZodObject<{
488
489
  timestamp: number;
489
490
  service: string;
490
491
  action: string;
491
- span?: string | undefined;
492
492
  key?: string | undefined;
493
+ span?: string | undefined;
493
494
  }, {
494
495
  timestamp: number;
495
496
  service: string;
496
497
  action: string;
497
- span?: string | undefined;
498
498
  key?: string | undefined;
499
+ span?: string | undefined;
499
500
  }>;
500
501
  type ServiceRequestEventType = z.infer<typeof ServiceRequestEventSchema>;
501
502
  /**
@@ -545,22 +546,22 @@ declare const ServiceErrorEventSchema: z.ZodObject<{
545
546
  /** Additional metadata about the error - passthrough allows any object properties */
546
547
  meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
547
548
  }, "strip", z.ZodTypeAny, {
548
- message: string;
549
549
  code: string;
550
+ message: string;
550
551
  service: string;
551
552
  cause?: unknown;
552
553
  meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
553
554
  }, {
554
- message: string;
555
555
  code: string;
556
+ message: string;
556
557
  service: string;
557
558
  cause?: unknown;
558
559
  meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
559
560
  }>;
560
561
  }, "strip", z.ZodTypeAny, {
561
562
  error: {
562
- message: string;
563
563
  code: string;
564
+ message: string;
564
565
  service: string;
565
566
  cause?: unknown;
566
567
  meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -569,8 +570,8 @@ declare const ServiceErrorEventSchema: z.ZodObject<{
569
570
  span?: string | undefined;
570
571
  }, {
571
572
  error: {
572
- message: string;
573
573
  code: string;
574
+ message: string;
574
575
  service: string;
575
576
  cause?: unknown;
576
577
  meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -598,22 +599,22 @@ declare const ServiceRetryEventSchema: z.ZodObject<{
598
599
  /** Additional metadata about the error - passthrough allows any object properties */
599
600
  meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
600
601
  }, "strip", z.ZodTypeAny, {
601
- message: string;
602
602
  code: string;
603
+ message: string;
603
604
  service: string;
604
605
  cause?: unknown;
605
606
  meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
606
607
  }, {
607
- message: string;
608
608
  code: string;
609
+ message: string;
609
610
  service: string;
610
611
  cause?: unknown;
611
612
  meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
612
613
  }>;
613
614
  }, "strip", z.ZodTypeAny, {
614
615
  error: {
615
- message: string;
616
616
  code: string;
617
+ message: string;
617
618
  service: string;
618
619
  cause?: unknown;
619
620
  meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -623,8 +624,8 @@ declare const ServiceRetryEventSchema: z.ZodObject<{
623
624
  maxAttempts: number;
624
625
  }, {
625
626
  error: {
626
- message: string;
627
627
  code: string;
628
+ message: string;
628
629
  service: string;
629
630
  cause?: unknown;
630
631
  meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -656,14 +657,14 @@ declare const TelemetrySpanEventSchema: z.ZodObject<{
656
657
  /** Additional metadata about the error - passthrough allows any object properties */
657
658
  meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
658
659
  }, "strip", z.ZodTypeAny, {
659
- message: string;
660
660
  code: string;
661
+ message: string;
661
662
  service: string;
662
663
  cause?: unknown;
663
664
  meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
664
665
  }, {
665
- message: string;
666
666
  code: string;
667
+ message: string;
667
668
  service: string;
668
669
  cause?: unknown;
669
670
  meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -673,8 +674,8 @@ declare const TelemetrySpanEventSchema: z.ZodObject<{
673
674
  ok: boolean;
674
675
  span: string;
675
676
  error?: {
676
- message: string;
677
677
  code: string;
678
+ message: string;
678
679
  service: string;
679
680
  cause?: unknown;
680
681
  meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -687,8 +688,8 @@ declare const TelemetrySpanEventSchema: z.ZodObject<{
687
688
  ok: boolean;
688
689
  span: string;
689
690
  error?: {
690
- message: string;
691
691
  code: string;
692
+ message: string;
692
693
  service: string;
693
694
  cause?: unknown;
694
695
  meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -923,6 +924,7 @@ declare class ServiceContext implements IServiceContext {
923
924
  private _services;
924
925
  private _eventHandlers;
925
926
  private _abortController;
927
+ private _operationAbortSignal?;
926
928
  private _retired;
927
929
  private readonly _invoke;
928
930
  private readonly _invokeAny?;
@@ -1007,6 +1009,8 @@ declare class ServiceContext implements IServiceContext {
1007
1009
  * Get the abort signal for cancelling operations.
1008
1010
  */
1009
1011
  get abortSignal(): AbortSignal;
1012
+ get operationAbortSignal(): AbortSignal | undefined;
1013
+ setOperationAbortSignal(signal: AbortSignal | undefined): void;
1010
1014
  /**
1011
1015
  * Permanently retire this graph after its owner installs a replacement.
1012
1016
  * Unlike `abort()`, retirement never creates a fresh controller, so captured
@@ -1722,10 +1726,13 @@ interface VaultGetOptions<T = unknown> {
1722
1726
  deserialize?: (data: Uint8Array) => T;
1723
1727
  /** Return raw decrypted bytes without deserialization */
1724
1728
  raw?: boolean;
1729
+ /** Force the underlying KV read to bypass replica read-through. */
1730
+ source?: "network";
1725
1731
  /** Delegated KV service for reading from the grantor's space (used by getShared) */
1726
1732
  kv?: {
1727
1733
  get<V>(key: string, options?: {
1728
1734
  raw?: boolean;
1735
+ source?: "network";
1729
1736
  }): Promise<{
1730
1737
  ok: boolean;
1731
1738
  data?: {
@@ -1743,8 +1750,9 @@ interface VaultGetOptions<T = unknown> {
1743
1750
  interface VaultListOptions {
1744
1751
  /** Prefix filter for key names */
1745
1752
  prefix?: string;
1746
- /** Remove prefix from returned keys */
1747
1753
  removePrefix?: boolean;
1754
+ /** Force the underlying KV list to bypass replica read-through. */
1755
+ source?: "network";
1748
1756
  /** Maximum number of keys to return. */
1749
1757
  limit?: number;
1750
1758
  /** Opaque cursor returned by a prior bounded page. */
@@ -2343,6 +2351,8 @@ declare const SECRET_NAME_RE: RegExp;
2343
2351
  interface SecretScopeOptions {
2344
2352
  /** Optional logical scope. Omit for the global secret namespace. */
2345
2353
  scope?: string;
2354
+ /** Bypass replication for existence-sensitive reads. */
2355
+ source?: "network";
2346
2356
  }
2347
2357
  /** Canonical secret scope grammar shared with the TC-832 `/request` link. */
2348
2358
  declare const SECRET_SCOPE_RE: RegExp;
package/dist/index.d.ts CHANGED
@@ -1,10 +1,11 @@
1
- import { a as IServiceContext, c as InvokeFunction, d as InvokeAnyFunction, F as FetchFunction, S as ServiceSession, e as RetryPolicy, T as TelemetryConfig, I as IService, E as EventHandler, b as ServiceError, R as Result, P as PermissionHint, f as StorageQuotaInfo } from './types-CVwwxqXF.js';
2
- export { g as ErrorCode, h as ErrorCodes, i as FetchRequestInit, j as FetchResponse, k as InvocationFact, l as InvocationFacts, m as InvokeAnyEntry, n as ServiceErrorEvent, o as ServiceHeaders, p as ServiceRequestEvent, q as ServiceResponseEvent, r as ServiceRetryEvent, s as TelemetryEventHandler, t as TelemetryEvents, u as TelemetrySpanEvent, v as defaultRetryPolicy, w as err, x as ok, y as serviceError } from './types-CVwwxqXF.js';
1
+ import { a as IServiceContext, c as InvokeFunction, d as InvokeAnyFunction, F as FetchFunction, S as ServiceSession, e as RetryPolicy, T as TelemetryConfig, I as IService, E as EventHandler, b as ServiceError, R as Result, P as PermissionHint, f as StorageQuotaInfo } from './types-7A5rHWRY.js';
2
+ export { g as ErrorCode, h as ErrorCodes, i as FetchRequestInit, j as FetchResponse, k as InvocationFact, l as InvocationFacts, m as InvokeAnyEntry, n as ServiceErrorEvent, o as ServiceHeaders, p as ServiceRequestEvent, q as ServiceResponseEvent, r as ServiceRetryEvent, s as TelemetryEventHandler, t as TelemetryEvents, u as TelemetrySpanEvent, v as defaultRetryPolicy, w as err, x as ok, y as serviceError } from './types-7A5rHWRY.js';
3
3
  import { z } from 'zod';
4
- import { B as BaseService } from './BaseService-B_UKhVht.js';
5
- export { a as BaseServiceOptions, R as RequestSignal, S as ServiceConstructor, b as ServiceRegistration } from './BaseService-B_UKhVht.js';
4
+ import { B as BaseService } from './BaseService-Di_hVfUV.js';
5
+ export { a as BaseServiceOptions, R as RequestSignal, S as ServiceConstructor, b as ServiceRegistration } from './BaseService-Di_hVfUV.js';
6
6
  import { IKVService } from './kv/index.js';
7
- export { DEFAULT_SIGNED_READ_URL_EXPIRY_MS, IPrefixedKVService, KVAction, KVActionType, KVBatchPutItem, KVBatchPutOptions, KVBatchPutResponse, KVBatchReadResponse, KVChange, KVChangesAuthority, KVChangesOptions, KVChangesResponse, KVCreateSignedReadUrlOptions, KVDeleteOptions, KVGetOptions, KVHeadOptions, KVListOptions, KVListResponse, KVPutOptions, KVResponse, KVResponseHeaders, KVService, KVServiceConfig, KVSignedReadUrlResponse, PrefixedKVService } from './kv/index.js';
7
+ export { IPrefixedKVService, KVService, PrefixedKVService } from './kv/index.js';
8
+ export { A as AuthorityRefusal, C as CLEAR_PENDING_WARNING, I as DEFAULT_SIGNED_READ_URL_EXPIRY_MS, J as KVAction, M as KVActionType, N as KVBatchPutItem, O as KVBatchPutOptions, Q as KVBatchPutResponse, S as KVBatchReadResponse, T as KVChange, U as KVChangesAuthority, V as KVChangesOptions, W as KVChangesResponse, X as KVCreateSignedReadUrlOptions, Y as KVDeleteOptions, Z as KVGetOptions, _ as KVHeadOptions, $ as KVListOptions, b as KVListPage, a0 as KVListResponse, a1 as KVPutOptions, c as KVReadThrough, d as KVReplicaHandle, e as KVReplicaSpec, f as KVReplicaStorage, a as KVReplicationController, K as KVReplicationDeps, a2 as KVResponse, a3 as KVResponseHeaders, a4 as KVServiceConfig, a5 as KVSignedReadUrlResponse, L as LocalGetResult, g as LocalListResult, h as LocalReadMeta, i as LocalReplicaStatus, j as LocalSyncResult, k as PendingWriteRecord, l as PendingWriteState, P as PendingWriteStore, m as PinnedKey, n as PurgeTarget, o as ReplicaAuthorityState, p as ReplicaCoverage, q as ReplicaDevice, r as ReplicaGrantInfo, s as ReplicaState, t as ReplicaStatusEntry, u as ReplicationAuthority, v as ReplicationControl, w as ReplicationEvent, R as ReplicationIdentity, x as ReplicationOptions, y as ReplicationPurgeReport, z as ReplicationReason, B as ReplicationScheduler, D as ResolvedReplicationOptions, E as canonicalReplicationIdentity, F as kvPrefixCovers, G as replicationIdentityKey, H as requiresSecretsOptIn } from './scope-BmLxwyl-.js';
8
9
  export { BatchOptions, BatchResponse, DatabaseHandle, ExecuteOptions, ExecuteResponse, IDatabaseHandle, ISQLMigrations, ISQLService, QueryOptions, QueryResponse, SQLAction, SQLActionType, SQLMigrations, SQLService, SQLServiceConfig, SqlMigration, SqlMigrationApplyOptions, SqlMigrationApplyResponse, SqlStatement, SqlValue } from './sql/index.js';
9
10
  import { IEncryptionService, DecryptCapabilityProof } from './encryption/index.js';
10
11
  export { BuildCanonicalDecryptRequestInput, BuildDecryptFactsInput, BuildDecryptInvocationInput, BuiltDecryptInvocation, CanonicalDecryptRequest, CanonicalJson, DECRYPT_ACTION, DECRYPT_FACT_TYPE, DECRYPT_RESULT_TYPE, DEFAULT_ENCRYPTION_ALG, DEFAULT_KEY_VERSION, DecryptEnvelopeOptions, DecryptInvocationFact, DecryptInvocationSigner, DecryptRequestBody, DecryptResponseBody, DecryptTransport, DiscoverNetworkInput, DiscoveredNetwork, DiscoverySource, ENCRYPTION_NETWORK_URN_PREFIX, ENCRYPTION_SERVICE, ENCRYPTION_SERVICE_SHORT, ENVELOPE_VERSION, EncryptToNetworkInput, EncryptToNetworkOptions, EncryptToNetworkResult, EncryptionCrypto, EncryptionError, EncryptionErrorInput, EncryptionService, EncryptionServiceConfig, InlineEncryptedEnvelope, Json, NETWORK_NAME_PATTERN, NetworkDescriptor, NetworkIdError, NodeDescriptorFetcher, ParsedNetworkId, RandomReceiverKeyInput, ReceiverKeyPair, ReceiverKeySigner, SignedReceiverKeyInput, VerifyDecryptResponseInput, WellKnownDescriptorFetcher, base64Decode, base64Encode, buildCanonicalDecryptRequest, buildDecryptAttenuation, buildDecryptFacts, buildDecryptInvocation, buildNetworkId, canonicalHashHex, canonicalSignedResponse, canonicalize as canonicalizeEncryptionJson, checkDecryptInvocationInput, decryptEnvelopeWithKey, deriveSignedReceiverKey, discoverNetwork, encryptToNetwork, encryptionError, ensureNetworkUsableForDecrypt, generateRandomReceiverKey, hexDecode, hexEncode, isNetworkId, networkDiscoveryKey, openWrappedKey, parseNetworkId, utf8Decode, utf8Encode, validateEnvelope, verifyDecryptResponse } from './encryption/index.js';
@@ -92,14 +93,14 @@ declare const ServiceErrorSchema: z.ZodObject<{
92
93
  /** Additional metadata about the error - passthrough allows any object properties */
93
94
  meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
94
95
  }, "strip", z.ZodTypeAny, {
95
- message: string;
96
96
  code: string;
97
+ message: string;
97
98
  service: string;
98
99
  cause?: unknown;
99
100
  meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
100
101
  }, {
101
- message: string;
102
102
  code: string;
103
+ message: string;
103
104
  service: string;
104
105
  cause?: unknown;
105
106
  meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -177,22 +178,22 @@ declare const GenericResultSchema: z.ZodDiscriminatedUnion<"ok", [z.ZodObject<{
177
178
  /** Additional metadata about the error - passthrough allows any object properties */
178
179
  meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
179
180
  }, "strip", z.ZodTypeAny, {
180
- message: string;
181
181
  code: string;
182
+ message: string;
182
183
  service: string;
183
184
  cause?: unknown;
184
185
  meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
185
186
  }, {
186
- message: string;
187
187
  code: string;
188
+ message: string;
188
189
  service: string;
189
190
  cause?: unknown;
190
191
  meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
191
192
  }>;
192
193
  }, "strip", z.ZodTypeAny, {
193
194
  error: {
194
- message: string;
195
195
  code: string;
196
+ message: string;
196
197
  service: string;
197
198
  cause?: unknown;
198
199
  meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -200,8 +201,8 @@ declare const GenericResultSchema: z.ZodDiscriminatedUnion<"ok", [z.ZodObject<{
200
201
  ok: false;
201
202
  }, {
202
203
  error: {
203
- message: string;
204
204
  code: string;
205
+ message: string;
205
206
  service: string;
206
207
  cause?: unknown;
207
208
  meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -488,14 +489,14 @@ declare const ServiceRequestEventSchema: z.ZodObject<{
488
489
  timestamp: number;
489
490
  service: string;
490
491
  action: string;
491
- span?: string | undefined;
492
492
  key?: string | undefined;
493
+ span?: string | undefined;
493
494
  }, {
494
495
  timestamp: number;
495
496
  service: string;
496
497
  action: string;
497
- span?: string | undefined;
498
498
  key?: string | undefined;
499
+ span?: string | undefined;
499
500
  }>;
500
501
  type ServiceRequestEventType = z.infer<typeof ServiceRequestEventSchema>;
501
502
  /**
@@ -545,22 +546,22 @@ declare const ServiceErrorEventSchema: z.ZodObject<{
545
546
  /** Additional metadata about the error - passthrough allows any object properties */
546
547
  meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
547
548
  }, "strip", z.ZodTypeAny, {
548
- message: string;
549
549
  code: string;
550
+ message: string;
550
551
  service: string;
551
552
  cause?: unknown;
552
553
  meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
553
554
  }, {
554
- message: string;
555
555
  code: string;
556
+ message: string;
556
557
  service: string;
557
558
  cause?: unknown;
558
559
  meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
559
560
  }>;
560
561
  }, "strip", z.ZodTypeAny, {
561
562
  error: {
562
- message: string;
563
563
  code: string;
564
+ message: string;
564
565
  service: string;
565
566
  cause?: unknown;
566
567
  meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -569,8 +570,8 @@ declare const ServiceErrorEventSchema: z.ZodObject<{
569
570
  span?: string | undefined;
570
571
  }, {
571
572
  error: {
572
- message: string;
573
573
  code: string;
574
+ message: string;
574
575
  service: string;
575
576
  cause?: unknown;
576
577
  meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -598,22 +599,22 @@ declare const ServiceRetryEventSchema: z.ZodObject<{
598
599
  /** Additional metadata about the error - passthrough allows any object properties */
599
600
  meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
600
601
  }, "strip", z.ZodTypeAny, {
601
- message: string;
602
602
  code: string;
603
+ message: string;
603
604
  service: string;
604
605
  cause?: unknown;
605
606
  meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
606
607
  }, {
607
- message: string;
608
608
  code: string;
609
+ message: string;
609
610
  service: string;
610
611
  cause?: unknown;
611
612
  meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
612
613
  }>;
613
614
  }, "strip", z.ZodTypeAny, {
614
615
  error: {
615
- message: string;
616
616
  code: string;
617
+ message: string;
617
618
  service: string;
618
619
  cause?: unknown;
619
620
  meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -623,8 +624,8 @@ declare const ServiceRetryEventSchema: z.ZodObject<{
623
624
  maxAttempts: number;
624
625
  }, {
625
626
  error: {
626
- message: string;
627
627
  code: string;
628
+ message: string;
628
629
  service: string;
629
630
  cause?: unknown;
630
631
  meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -656,14 +657,14 @@ declare const TelemetrySpanEventSchema: z.ZodObject<{
656
657
  /** Additional metadata about the error - passthrough allows any object properties */
657
658
  meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
658
659
  }, "strip", z.ZodTypeAny, {
659
- message: string;
660
660
  code: string;
661
+ message: string;
661
662
  service: string;
662
663
  cause?: unknown;
663
664
  meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
664
665
  }, {
665
- message: string;
666
666
  code: string;
667
+ message: string;
667
668
  service: string;
668
669
  cause?: unknown;
669
670
  meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -673,8 +674,8 @@ declare const TelemetrySpanEventSchema: z.ZodObject<{
673
674
  ok: boolean;
674
675
  span: string;
675
676
  error?: {
676
- message: string;
677
677
  code: string;
678
+ message: string;
678
679
  service: string;
679
680
  cause?: unknown;
680
681
  meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -687,8 +688,8 @@ declare const TelemetrySpanEventSchema: z.ZodObject<{
687
688
  ok: boolean;
688
689
  span: string;
689
690
  error?: {
690
- message: string;
691
691
  code: string;
692
+ message: string;
692
693
  service: string;
693
694
  cause?: unknown;
694
695
  meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
@@ -923,6 +924,7 @@ declare class ServiceContext implements IServiceContext {
923
924
  private _services;
924
925
  private _eventHandlers;
925
926
  private _abortController;
927
+ private _operationAbortSignal?;
926
928
  private _retired;
927
929
  private readonly _invoke;
928
930
  private readonly _invokeAny?;
@@ -1007,6 +1009,8 @@ declare class ServiceContext implements IServiceContext {
1007
1009
  * Get the abort signal for cancelling operations.
1008
1010
  */
1009
1011
  get abortSignal(): AbortSignal;
1012
+ get operationAbortSignal(): AbortSignal | undefined;
1013
+ setOperationAbortSignal(signal: AbortSignal | undefined): void;
1010
1014
  /**
1011
1015
  * Permanently retire this graph after its owner installs a replacement.
1012
1016
  * Unlike `abort()`, retirement never creates a fresh controller, so captured
@@ -1722,10 +1726,13 @@ interface VaultGetOptions<T = unknown> {
1722
1726
  deserialize?: (data: Uint8Array) => T;
1723
1727
  /** Return raw decrypted bytes without deserialization */
1724
1728
  raw?: boolean;
1729
+ /** Force the underlying KV read to bypass replica read-through. */
1730
+ source?: "network";
1725
1731
  /** Delegated KV service for reading from the grantor's space (used by getShared) */
1726
1732
  kv?: {
1727
1733
  get<V>(key: string, options?: {
1728
1734
  raw?: boolean;
1735
+ source?: "network";
1729
1736
  }): Promise<{
1730
1737
  ok: boolean;
1731
1738
  data?: {
@@ -1743,8 +1750,9 @@ interface VaultGetOptions<T = unknown> {
1743
1750
  interface VaultListOptions {
1744
1751
  /** Prefix filter for key names */
1745
1752
  prefix?: string;
1746
- /** Remove prefix from returned keys */
1747
1753
  removePrefix?: boolean;
1754
+ /** Force the underlying KV list to bypass replica read-through. */
1755
+ source?: "network";
1748
1756
  /** Maximum number of keys to return. */
1749
1757
  limit?: number;
1750
1758
  /** Opaque cursor returned by a prior bounded page. */
@@ -2343,6 +2351,8 @@ declare const SECRET_NAME_RE: RegExp;
2343
2351
  interface SecretScopeOptions {
2344
2352
  /** Optional logical scope. Omit for the global secret namespace. */
2345
2353
  scope?: string;
2354
+ /** Bypass replication for existence-sensitive reads. */
2355
+ source?: "network";
2346
2356
  }
2347
2357
  /** Canonical secret scope grammar shared with the TC-832 `/request` link. */
2348
2358
  declare const SECRET_SCOPE_RE: RegExp;