@tinycloud/sdk-services 2.6.3 → 2.7.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/BaseService-BwBU5CQ4.d.cts +158 -0
  2. package/dist/BaseService-CnPTKR5G.d.ts +158 -0
  3. package/dist/encryption/index.cjs +46 -6
  4. package/dist/encryption/index.cjs.map +1 -1
  5. package/dist/encryption/index.d.cts +9 -1
  6. package/dist/encryption/index.d.ts +9 -1
  7. package/dist/encryption/index.js +45 -6
  8. package/dist/encryption/index.js.map +1 -1
  9. package/dist/index.cjs +299 -21
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.d.cts +58 -9
  12. package/dist/index.d.ts +58 -9
  13. package/dist/index.js +293 -18
  14. package/dist/index.js.map +1 -1
  15. package/dist/internal/decrypt-transport-response-error.cjs +38 -0
  16. package/dist/internal/decrypt-transport-response-error.cjs.map +1 -0
  17. package/dist/internal/decrypt-transport-response-error.d.cts +10 -0
  18. package/dist/internal/decrypt-transport-response-error.d.ts +10 -0
  19. package/dist/internal/decrypt-transport-response-error.js +13 -0
  20. package/dist/internal/decrypt-transport-response-error.js.map +1 -0
  21. package/dist/kv/index.cjs +46 -4
  22. package/dist/kv/index.cjs.map +1 -1
  23. package/dist/kv/index.d.cts +2 -1
  24. package/dist/kv/index.d.ts +2 -1
  25. package/dist/kv/index.js +46 -4
  26. package/dist/kv/index.js.map +1 -1
  27. package/dist/sql/index.cjs +6 -2
  28. package/dist/sql/index.cjs.map +1 -1
  29. package/dist/sql/index.d.cts +2 -1
  30. package/dist/sql/index.d.ts +2 -1
  31. package/dist/sql/index.js +6 -2
  32. package/dist/sql/index.js.map +1 -1
  33. package/dist/{BaseService-BdRvNm2s.d.cts → types-DAY1O1kW.d.cts} +14 -156
  34. package/dist/{BaseService-BdRvNm2s.d.ts → types-DAY1O1kW.d.ts} +14 -156
  35. package/package.json +11 -3
package/dist/index.d.cts CHANGED
@@ -1,11 +1,13 @@
1
- import { I as IServiceContext, a as InvokeFunction, b as InvokeAnyFunction, F as FetchFunction, S as ServiceSession, R as RetryPolicy, T as TelemetryConfig, c as IService, E as EventHandler, d as ServiceError, e as Result, B as BaseService, f as StorageQuotaInfo } from './BaseService-BdRvNm2s.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 './BaseService-BdRvNm2s.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-DAY1O1kW.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-DAY1O1kW.cjs';
3
3
  import { z } from 'zod';
4
+ import { B as BaseService } from './BaseService-BwBU5CQ4.cjs';
4
5
  import { IKVService } from './kv/index.cjs';
5
6
  export { DEFAULT_SIGNED_READ_URL_EXPIRY_MS, IPrefixedKVService, KVAction, KVActionType, KVBatchPutItem, KVBatchPutOptions, KVBatchPutResponse, KVCreateSignedReadUrlOptions, KVDeleteOptions, KVGetOptions, KVHeadOptions, KVListOptions, KVListResponse, KVPutOptions, KVResponse, KVResponseHeaders, KVService, KVServiceConfig, KVSignedReadUrlResponse, PrefixedKVService } from './kv/index.cjs';
6
7
  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';
7
8
  import { IEncryptionService, DecryptCapabilityProof } from './encryption/index.cjs';
8
9
  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';
10
+ export { DecryptTransportResponseError } from '@tinycloud/sdk-services/internal/decrypt-transport-response-error';
9
11
 
10
12
  type TinyCloudDebugLevel = "debug";
11
13
  interface TinyCloudDebugEvent {
@@ -491,18 +493,18 @@ declare const ServiceResponseEventSchema: z.ZodObject<{
491
493
  durationMs: z.ZodOptional<z.ZodNumber>;
492
494
  status: z.ZodOptional<z.ZodNumber>;
493
495
  }, "strip", z.ZodTypeAny, {
494
- service: string;
496
+ duration: number;
495
497
  ok: boolean;
498
+ service: string;
496
499
  action: string;
497
- duration: number;
498
500
  durationMs?: number | undefined;
499
501
  status?: number | undefined;
500
502
  span?: string | undefined;
501
503
  }, {
502
- service: string;
504
+ duration: number;
503
505
  ok: boolean;
506
+ service: string;
504
507
  action: string;
505
- duration: number;
506
508
  durationMs?: number | undefined;
507
509
  status?: number | undefined;
508
510
  span?: string | undefined;
@@ -660,8 +662,8 @@ declare const TelemetrySpanEventSchema: z.ZodObject<{
660
662
  cause?: unknown;
661
663
  meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
662
664
  } | undefined;
663
- service?: string | undefined;
664
665
  status?: number | undefined;
666
+ service?: string | undefined;
665
667
  action?: string | undefined;
666
668
  }, {
667
669
  durationMs: number;
@@ -674,8 +676,8 @@ declare const TelemetrySpanEventSchema: z.ZodObject<{
674
676
  cause?: unknown;
675
677
  meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
676
678
  } | undefined;
677
- service?: string | undefined;
678
679
  status?: number | undefined;
680
+ service?: string | undefined;
679
681
  action?: string | undefined;
680
682
  }>;
681
683
  type TelemetrySpanEventType = z.infer<typeof TelemetrySpanEventSchema>;
@@ -904,6 +906,7 @@ declare class ServiceContext implements IServiceContext {
904
906
  private _services;
905
907
  private _eventHandlers;
906
908
  private _abortController;
909
+ private _retired;
907
910
  private readonly _invoke;
908
911
  private readonly _invokeAny?;
909
912
  private readonly _fetch;
@@ -987,6 +990,12 @@ declare class ServiceContext implements IServiceContext {
987
990
  * Get the abort signal for cancelling operations.
988
991
  */
989
992
  get abortSignal(): AbortSignal;
993
+ /**
994
+ * Permanently retire this graph after its owner installs a replacement.
995
+ * Unlike `abort()`, retirement never creates a fresh controller, so captured
996
+ * services cannot resume calls under a superseded session.
997
+ */
998
+ retire(): void;
990
999
  /**
991
1000
  * Abort all pending operations and notify services.
992
1001
  * Creates a new AbortController for future operations.
@@ -1001,10 +1010,16 @@ declare class ServiceContext implements IServiceContext {
1001
1010
  */
1002
1011
  get retryPolicy(): RetryPolicy;
1003
1012
  private wrapInvoke;
1013
+ private assertActive;
1004
1014
  private wrapInvokeAny;
1005
1015
  private wrapFetch;
1016
+ private combineSignals;
1006
1017
  }
1007
1018
 
1019
+ /** Validate one structured node permission hint without accepting raw errors. */
1020
+ declare function parsePermissionHint(value: unknown): PermissionHint | undefined;
1021
+ /** Extract only a validated structured hint from an SDK-owned error body. */
1022
+ declare function parsePermissionHintFromErrorText(text: string): PermissionHint | undefined;
1008
1023
  /**
1009
1024
  * Create a service error for authentication required.
1010
1025
  */
@@ -1601,6 +1616,32 @@ interface VaultEntry<T> {
1601
1616
  /** Key ID used for encryption */
1602
1617
  keyId: string;
1603
1618
  }
1619
+ /**
1620
+ * Safe classification for a network-encrypted vault read.
1621
+ *
1622
+ * Failure variants intentionally contain no node response, encrypted envelope,
1623
+ * plaintext, or key material. Consumers that need to distinguish an authorized
1624
+ * absence from a failed read should use this instead of {@link IDataVaultService.get}.
1625
+ */
1626
+ type VaultNetworkReadResult<T> = {
1627
+ status: "ok";
1628
+ entry: VaultEntry<T>;
1629
+ } | {
1630
+ status: "not_found";
1631
+ } | {
1632
+ status: "node_unreachable";
1633
+ } | {
1634
+ status: "permission_required";
1635
+ hint: PermissionHint;
1636
+ } | {
1637
+ status: "read_failed";
1638
+ } | {
1639
+ status: "corrupt_envelope";
1640
+ } | {
1641
+ status: "decrypt_failed";
1642
+ } | {
1643
+ status: "invalid_payload";
1644
+ };
1604
1645
  /**
1605
1646
  * Structured error codes for vault operations.
1606
1647
  */
@@ -1969,6 +2010,14 @@ declare class DataVaultService extends BaseService implements IDataVaultService
1969
2010
  onSignOut(): void;
1970
2011
  private putNetworkEncrypted;
1971
2012
  private getNetworkEncrypted;
2013
+ /**
2014
+ * Read a network-encrypted entry while preserving safe failure phases.
2015
+ *
2016
+ * Unlike {@link getNetworkEncrypted}, this is intentionally message-free so
2017
+ * an operation layer can distinguish an authorized absence from a failed
2018
+ * read without receiving node, envelope, plaintext, or key material.
2019
+ */
2020
+ readNetworkEncrypted<T = unknown>(key: string, options?: VaultGetOptions<T>): Promise<VaultNetworkReadResult<T>>;
1972
2021
  private headNetworkEncrypted;
1973
2022
  /**
1974
2023
  * Encrypt and store a value at the given key.
@@ -2151,4 +2200,4 @@ declare class SecretsService implements ISecretsService {
2151
2200
  list(options?: SecretScopeOptions): Promise<Result<string[], SecretsError>>;
2152
2201
  }
2153
2202
 
2154
- export { BaseService, type BaseServiceOptions, type ColumnInfo, type DataVaultConfig, DataVaultService, DecryptCapabilityProof, DuckDbAction, type DuckDbActionType, type DuckDbBatchOptions, type BatchResponse as DuckDbBatchResponse, DuckDbDatabaseHandle, type DuckDbExecuteOptions, type ExecuteResponse as DuckDbExecuteResponse, type DuckDbOptions, type DuckDbQueryOptions, type QueryResponse as DuckDbQueryResponse, DuckDbService, type DuckDbServiceConfig, type DuckDbStatement, type DuckDbValue, EventHandler, FetchFunction, GenericKVResponseSchema, type GenericKVResponseType, GenericResultSchema, type HookEvent, type HookServiceName, type HookStreamEvent, type HookSubscription, type HookWebhookListOptions, type HookWebhookRecord, type HookWebhookRegistration, type HookWebhookScope, type HookWebhookUnregisterOptions, HooksService, type HooksServiceConfig, type IDataVaultService, type IDuckDbDatabaseHandle, type IDuckDbService, IEncryptionService, type IHooksService, IKVService, type ISecretsService, IService, IServiceContext, InvokeAnyFunction, InvokeFunction, KVListResponseSchema, type KVListResponseType, KVListResultSchema, type KVListResultType, KVResponseHeadersSchema, type KVResponseHeadersType, type QuotaConfig, type QuotaStatus, type ResolvedSecretPath, Result, RetryPolicy, RetryPolicySchema, type RetryPolicyType, SECRET_NAME_RE, type SchemaInfo, type SecretPayload, type SecretScopeOptions, type SecretsError, SecretsService, type ServiceConstructor, ServiceContext, type ServiceContextConfig, ServiceError, ServiceErrorEventSchema, type ServiceErrorEventType, ServiceErrorSchema, type ServiceErrorType, type ServiceRegistration, ServiceRequestEventSchema, type ServiceRequestEventType, ServiceResponseEventSchema, type ServiceResponseEventType, ServiceRetryEventSchema, type ServiceRetryEventType, ServiceSession, ServiceSessionSchema, type ServiceSessionType, StorageQuotaInfo, type SubscribeOptions, type TableInfo, TelemetryConfig, TelemetrySpanEventSchema, type TelemetrySpanEventType, type TinyCloudDebugEnableOptions, type TinyCloudDebugEvent, type TinyCloudDebugLevel, TinyCloudDebugLogger, type TinyCloudDebugTimer, TinyCloudQuota, type ValidationError, type VaultCrypto, type VaultEntry, type VaultError, type VaultGetOptions, type VaultGrantOptions, VaultHeaders, type VaultListOptions, VaultPublicSpaceKVActions, type VaultPutOptions, type ViewInfo, type WasmVaultFunctions, abortedError, authExpiredError, authRequiredError, authUnauthorizedError, canonicalizeSecretScope, clearTinyCloudDebugLogs, createKVResponseSchema, createResultSchema, createVaultCrypto, disableTinyCloudDebug, enableTinyCloudDebug, errorResult, getTinyCloudDebugLogs, installTinyCloudDebugGlobals, networkError, notFoundError, parseAuthError, permissionDeniedError, resolveSecretListPrefix, resolveSecretPath, storageLimitReachedError, storageQuotaExceededError, timeoutError, tinyCloudDebugLogger, validateKVListResponse, validateKVResponseHeaders, validateRetryPolicy, validateServiceError, validateServiceRequestEvent, validateServiceResponseEvent, validateServiceSession, validateTelemetrySpanEvent, wrapError };
2203
+ export { BaseService, type BaseServiceOptions, type ColumnInfo, type DataVaultConfig, DataVaultService, DecryptCapabilityProof, DuckDbAction, type DuckDbActionType, type DuckDbBatchOptions, type BatchResponse as DuckDbBatchResponse, DuckDbDatabaseHandle, type DuckDbExecuteOptions, type ExecuteResponse as DuckDbExecuteResponse, type DuckDbOptions, type DuckDbQueryOptions, type QueryResponse as DuckDbQueryResponse, DuckDbService, type DuckDbServiceConfig, type DuckDbStatement, type DuckDbValue, EventHandler, FetchFunction, GenericKVResponseSchema, type GenericKVResponseType, GenericResultSchema, type HookEvent, type HookServiceName, type HookStreamEvent, type HookSubscription, type HookWebhookListOptions, type HookWebhookRecord, type HookWebhookRegistration, type HookWebhookScope, type HookWebhookUnregisterOptions, HooksService, type HooksServiceConfig, type IDataVaultService, type IDuckDbDatabaseHandle, type IDuckDbService, IEncryptionService, type IHooksService, IKVService, type ISecretsService, IService, IServiceContext, InvokeAnyFunction, InvokeFunction, KVListResponseSchema, type KVListResponseType, KVListResultSchema, type KVListResultType, KVResponseHeadersSchema, type KVResponseHeadersType, PermissionHint, type QuotaConfig, type QuotaStatus, type ResolvedSecretPath, Result, RetryPolicy, RetryPolicySchema, type RetryPolicyType, SECRET_NAME_RE, type SchemaInfo, type SecretPayload, type SecretScopeOptions, type SecretsError, SecretsService, type ServiceConstructor, ServiceContext, type ServiceContextConfig, ServiceError, ServiceErrorEventSchema, type ServiceErrorEventType, ServiceErrorSchema, type ServiceErrorType, type ServiceRegistration, ServiceRequestEventSchema, type ServiceRequestEventType, ServiceResponseEventSchema, type ServiceResponseEventType, ServiceRetryEventSchema, type ServiceRetryEventType, ServiceSession, ServiceSessionSchema, type ServiceSessionType, StorageQuotaInfo, type SubscribeOptions, type TableInfo, TelemetryConfig, TelemetrySpanEventSchema, type TelemetrySpanEventType, type TinyCloudDebugEnableOptions, type TinyCloudDebugEvent, type TinyCloudDebugLevel, TinyCloudDebugLogger, type TinyCloudDebugTimer, TinyCloudQuota, type ValidationError, type VaultCrypto, type VaultEntry, type VaultError, type VaultGetOptions, type VaultGrantOptions, VaultHeaders, type VaultListOptions, type VaultNetworkReadResult, VaultPublicSpaceKVActions, type VaultPutOptions, type ViewInfo, type WasmVaultFunctions, abortedError, authExpiredError, authRequiredError, authUnauthorizedError, canonicalizeSecretScope, clearTinyCloudDebugLogs, createKVResponseSchema, createResultSchema, createVaultCrypto, disableTinyCloudDebug, enableTinyCloudDebug, errorResult, getTinyCloudDebugLogs, installTinyCloudDebugGlobals, networkError, notFoundError, parseAuthError, parsePermissionHint, parsePermissionHintFromErrorText, permissionDeniedError, resolveSecretListPrefix, resolveSecretPath, storageLimitReachedError, storageQuotaExceededError, timeoutError, tinyCloudDebugLogger, validateKVListResponse, validateKVResponseHeaders, validateRetryPolicy, validateServiceError, validateServiceRequestEvent, validateServiceResponseEvent, validateServiceSession, validateTelemetrySpanEvent, wrapError };
package/dist/index.d.ts CHANGED
@@ -1,11 +1,13 @@
1
- import { I as IServiceContext, a as InvokeFunction, b as InvokeAnyFunction, F as FetchFunction, S as ServiceSession, R as RetryPolicy, T as TelemetryConfig, c as IService, E as EventHandler, d as ServiceError, e as Result, B as BaseService, f as StorageQuotaInfo } from './BaseService-BdRvNm2s.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 './BaseService-BdRvNm2s.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-DAY1O1kW.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-DAY1O1kW.js';
3
3
  import { z } from 'zod';
4
+ import { B as BaseService } from './BaseService-CnPTKR5G.js';
4
5
  import { IKVService } from './kv/index.js';
5
6
  export { DEFAULT_SIGNED_READ_URL_EXPIRY_MS, IPrefixedKVService, KVAction, KVActionType, KVBatchPutItem, KVBatchPutOptions, KVBatchPutResponse, KVCreateSignedReadUrlOptions, KVDeleteOptions, KVGetOptions, KVHeadOptions, KVListOptions, KVListResponse, KVPutOptions, KVResponse, KVResponseHeaders, KVService, KVServiceConfig, KVSignedReadUrlResponse, PrefixedKVService } from './kv/index.js';
6
7
  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';
7
8
  import { IEncryptionService, DecryptCapabilityProof } from './encryption/index.js';
8
9
  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';
10
+ export { DecryptTransportResponseError } from '@tinycloud/sdk-services/internal/decrypt-transport-response-error';
9
11
 
10
12
  type TinyCloudDebugLevel = "debug";
11
13
  interface TinyCloudDebugEvent {
@@ -491,18 +493,18 @@ declare const ServiceResponseEventSchema: z.ZodObject<{
491
493
  durationMs: z.ZodOptional<z.ZodNumber>;
492
494
  status: z.ZodOptional<z.ZodNumber>;
493
495
  }, "strip", z.ZodTypeAny, {
494
- service: string;
496
+ duration: number;
495
497
  ok: boolean;
498
+ service: string;
496
499
  action: string;
497
- duration: number;
498
500
  durationMs?: number | undefined;
499
501
  status?: number | undefined;
500
502
  span?: string | undefined;
501
503
  }, {
502
- service: string;
504
+ duration: number;
503
505
  ok: boolean;
506
+ service: string;
504
507
  action: string;
505
- duration: number;
506
508
  durationMs?: number | undefined;
507
509
  status?: number | undefined;
508
510
  span?: string | undefined;
@@ -660,8 +662,8 @@ declare const TelemetrySpanEventSchema: z.ZodObject<{
660
662
  cause?: unknown;
661
663
  meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
662
664
  } | undefined;
663
- service?: string | undefined;
664
665
  status?: number | undefined;
666
+ service?: string | undefined;
665
667
  action?: string | undefined;
666
668
  }, {
667
669
  durationMs: number;
@@ -674,8 +676,8 @@ declare const TelemetrySpanEventSchema: z.ZodObject<{
674
676
  cause?: unknown;
675
677
  meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
676
678
  } | undefined;
677
- service?: string | undefined;
678
679
  status?: number | undefined;
680
+ service?: string | undefined;
679
681
  action?: string | undefined;
680
682
  }>;
681
683
  type TelemetrySpanEventType = z.infer<typeof TelemetrySpanEventSchema>;
@@ -904,6 +906,7 @@ declare class ServiceContext implements IServiceContext {
904
906
  private _services;
905
907
  private _eventHandlers;
906
908
  private _abortController;
909
+ private _retired;
907
910
  private readonly _invoke;
908
911
  private readonly _invokeAny?;
909
912
  private readonly _fetch;
@@ -987,6 +990,12 @@ declare class ServiceContext implements IServiceContext {
987
990
  * Get the abort signal for cancelling operations.
988
991
  */
989
992
  get abortSignal(): AbortSignal;
993
+ /**
994
+ * Permanently retire this graph after its owner installs a replacement.
995
+ * Unlike `abort()`, retirement never creates a fresh controller, so captured
996
+ * services cannot resume calls under a superseded session.
997
+ */
998
+ retire(): void;
990
999
  /**
991
1000
  * Abort all pending operations and notify services.
992
1001
  * Creates a new AbortController for future operations.
@@ -1001,10 +1010,16 @@ declare class ServiceContext implements IServiceContext {
1001
1010
  */
1002
1011
  get retryPolicy(): RetryPolicy;
1003
1012
  private wrapInvoke;
1013
+ private assertActive;
1004
1014
  private wrapInvokeAny;
1005
1015
  private wrapFetch;
1016
+ private combineSignals;
1006
1017
  }
1007
1018
 
1019
+ /** Validate one structured node permission hint without accepting raw errors. */
1020
+ declare function parsePermissionHint(value: unknown): PermissionHint | undefined;
1021
+ /** Extract only a validated structured hint from an SDK-owned error body. */
1022
+ declare function parsePermissionHintFromErrorText(text: string): PermissionHint | undefined;
1008
1023
  /**
1009
1024
  * Create a service error for authentication required.
1010
1025
  */
@@ -1601,6 +1616,32 @@ interface VaultEntry<T> {
1601
1616
  /** Key ID used for encryption */
1602
1617
  keyId: string;
1603
1618
  }
1619
+ /**
1620
+ * Safe classification for a network-encrypted vault read.
1621
+ *
1622
+ * Failure variants intentionally contain no node response, encrypted envelope,
1623
+ * plaintext, or key material. Consumers that need to distinguish an authorized
1624
+ * absence from a failed read should use this instead of {@link IDataVaultService.get}.
1625
+ */
1626
+ type VaultNetworkReadResult<T> = {
1627
+ status: "ok";
1628
+ entry: VaultEntry<T>;
1629
+ } | {
1630
+ status: "not_found";
1631
+ } | {
1632
+ status: "node_unreachable";
1633
+ } | {
1634
+ status: "permission_required";
1635
+ hint: PermissionHint;
1636
+ } | {
1637
+ status: "read_failed";
1638
+ } | {
1639
+ status: "corrupt_envelope";
1640
+ } | {
1641
+ status: "decrypt_failed";
1642
+ } | {
1643
+ status: "invalid_payload";
1644
+ };
1604
1645
  /**
1605
1646
  * Structured error codes for vault operations.
1606
1647
  */
@@ -1969,6 +2010,14 @@ declare class DataVaultService extends BaseService implements IDataVaultService
1969
2010
  onSignOut(): void;
1970
2011
  private putNetworkEncrypted;
1971
2012
  private getNetworkEncrypted;
2013
+ /**
2014
+ * Read a network-encrypted entry while preserving safe failure phases.
2015
+ *
2016
+ * Unlike {@link getNetworkEncrypted}, this is intentionally message-free so
2017
+ * an operation layer can distinguish an authorized absence from a failed
2018
+ * read without receiving node, envelope, plaintext, or key material.
2019
+ */
2020
+ readNetworkEncrypted<T = unknown>(key: string, options?: VaultGetOptions<T>): Promise<VaultNetworkReadResult<T>>;
1972
2021
  private headNetworkEncrypted;
1973
2022
  /**
1974
2023
  * Encrypt and store a value at the given key.
@@ -2151,4 +2200,4 @@ declare class SecretsService implements ISecretsService {
2151
2200
  list(options?: SecretScopeOptions): Promise<Result<string[], SecretsError>>;
2152
2201
  }
2153
2202
 
2154
- export { BaseService, type BaseServiceOptions, type ColumnInfo, type DataVaultConfig, DataVaultService, DecryptCapabilityProof, DuckDbAction, type DuckDbActionType, type DuckDbBatchOptions, type BatchResponse as DuckDbBatchResponse, DuckDbDatabaseHandle, type DuckDbExecuteOptions, type ExecuteResponse as DuckDbExecuteResponse, type DuckDbOptions, type DuckDbQueryOptions, type QueryResponse as DuckDbQueryResponse, DuckDbService, type DuckDbServiceConfig, type DuckDbStatement, type DuckDbValue, EventHandler, FetchFunction, GenericKVResponseSchema, type GenericKVResponseType, GenericResultSchema, type HookEvent, type HookServiceName, type HookStreamEvent, type HookSubscription, type HookWebhookListOptions, type HookWebhookRecord, type HookWebhookRegistration, type HookWebhookScope, type HookWebhookUnregisterOptions, HooksService, type HooksServiceConfig, type IDataVaultService, type IDuckDbDatabaseHandle, type IDuckDbService, IEncryptionService, type IHooksService, IKVService, type ISecretsService, IService, IServiceContext, InvokeAnyFunction, InvokeFunction, KVListResponseSchema, type KVListResponseType, KVListResultSchema, type KVListResultType, KVResponseHeadersSchema, type KVResponseHeadersType, type QuotaConfig, type QuotaStatus, type ResolvedSecretPath, Result, RetryPolicy, RetryPolicySchema, type RetryPolicyType, SECRET_NAME_RE, type SchemaInfo, type SecretPayload, type SecretScopeOptions, type SecretsError, SecretsService, type ServiceConstructor, ServiceContext, type ServiceContextConfig, ServiceError, ServiceErrorEventSchema, type ServiceErrorEventType, ServiceErrorSchema, type ServiceErrorType, type ServiceRegistration, ServiceRequestEventSchema, type ServiceRequestEventType, ServiceResponseEventSchema, type ServiceResponseEventType, ServiceRetryEventSchema, type ServiceRetryEventType, ServiceSession, ServiceSessionSchema, type ServiceSessionType, StorageQuotaInfo, type SubscribeOptions, type TableInfo, TelemetryConfig, TelemetrySpanEventSchema, type TelemetrySpanEventType, type TinyCloudDebugEnableOptions, type TinyCloudDebugEvent, type TinyCloudDebugLevel, TinyCloudDebugLogger, type TinyCloudDebugTimer, TinyCloudQuota, type ValidationError, type VaultCrypto, type VaultEntry, type VaultError, type VaultGetOptions, type VaultGrantOptions, VaultHeaders, type VaultListOptions, VaultPublicSpaceKVActions, type VaultPutOptions, type ViewInfo, type WasmVaultFunctions, abortedError, authExpiredError, authRequiredError, authUnauthorizedError, canonicalizeSecretScope, clearTinyCloudDebugLogs, createKVResponseSchema, createResultSchema, createVaultCrypto, disableTinyCloudDebug, enableTinyCloudDebug, errorResult, getTinyCloudDebugLogs, installTinyCloudDebugGlobals, networkError, notFoundError, parseAuthError, permissionDeniedError, resolveSecretListPrefix, resolveSecretPath, storageLimitReachedError, storageQuotaExceededError, timeoutError, tinyCloudDebugLogger, validateKVListResponse, validateKVResponseHeaders, validateRetryPolicy, validateServiceError, validateServiceRequestEvent, validateServiceResponseEvent, validateServiceSession, validateTelemetrySpanEvent, wrapError };
2203
+ export { BaseService, type BaseServiceOptions, type ColumnInfo, type DataVaultConfig, DataVaultService, DecryptCapabilityProof, DuckDbAction, type DuckDbActionType, type DuckDbBatchOptions, type BatchResponse as DuckDbBatchResponse, DuckDbDatabaseHandle, type DuckDbExecuteOptions, type ExecuteResponse as DuckDbExecuteResponse, type DuckDbOptions, type DuckDbQueryOptions, type QueryResponse as DuckDbQueryResponse, DuckDbService, type DuckDbServiceConfig, type DuckDbStatement, type DuckDbValue, EventHandler, FetchFunction, GenericKVResponseSchema, type GenericKVResponseType, GenericResultSchema, type HookEvent, type HookServiceName, type HookStreamEvent, type HookSubscription, type HookWebhookListOptions, type HookWebhookRecord, type HookWebhookRegistration, type HookWebhookScope, type HookWebhookUnregisterOptions, HooksService, type HooksServiceConfig, type IDataVaultService, type IDuckDbDatabaseHandle, type IDuckDbService, IEncryptionService, type IHooksService, IKVService, type ISecretsService, IService, IServiceContext, InvokeAnyFunction, InvokeFunction, KVListResponseSchema, type KVListResponseType, KVListResultSchema, type KVListResultType, KVResponseHeadersSchema, type KVResponseHeadersType, PermissionHint, type QuotaConfig, type QuotaStatus, type ResolvedSecretPath, Result, RetryPolicy, RetryPolicySchema, type RetryPolicyType, SECRET_NAME_RE, type SchemaInfo, type SecretPayload, type SecretScopeOptions, type SecretsError, SecretsService, type ServiceConstructor, ServiceContext, type ServiceContextConfig, ServiceError, ServiceErrorEventSchema, type ServiceErrorEventType, ServiceErrorSchema, type ServiceErrorType, type ServiceRegistration, ServiceRequestEventSchema, type ServiceRequestEventType, ServiceResponseEventSchema, type ServiceResponseEventType, ServiceRetryEventSchema, type ServiceRetryEventType, ServiceSession, ServiceSessionSchema, type ServiceSessionType, StorageQuotaInfo, type SubscribeOptions, type TableInfo, TelemetryConfig, TelemetrySpanEventSchema, type TelemetrySpanEventType, type TinyCloudDebugEnableOptions, type TinyCloudDebugEvent, type TinyCloudDebugLevel, TinyCloudDebugLogger, type TinyCloudDebugTimer, TinyCloudQuota, type ValidationError, type VaultCrypto, type VaultEntry, type VaultError, type VaultGetOptions, type VaultGrantOptions, VaultHeaders, type VaultListOptions, type VaultNetworkReadResult, VaultPublicSpaceKVActions, type VaultPutOptions, type ViewInfo, type WasmVaultFunctions, abortedError, authExpiredError, authRequiredError, authUnauthorizedError, canonicalizeSecretScope, clearTinyCloudDebugLogs, createKVResponseSchema, createResultSchema, createVaultCrypto, disableTinyCloudDebug, enableTinyCloudDebug, errorResult, getTinyCloudDebugLogs, installTinyCloudDebugGlobals, networkError, notFoundError, parseAuthError, parsePermissionHint, parsePermissionHintFromErrorText, permissionDeniedError, resolveSecretListPrefix, resolveSecretPath, storageLimitReachedError, storageQuotaExceededError, timeoutError, tinyCloudDebugLogger, validateKVListResponse, validateKVResponseHeaders, validateRetryPolicy, validateServiceError, validateServiceRequestEvent, validateServiceResponseEvent, validateServiceSession, validateTelemetrySpanEvent, wrapError };