dsh-mobile 0.8.4 → 0.8.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.d.mts CHANGED
@@ -382,6 +382,8 @@ interface PluginConfig {
382
382
  upstreamTimeoutMs?: number;
383
383
  /** Authenticated /api response and established DSH plugin-event stream idle timeout; zero disables it. */
384
384
  upstreamApiTimeoutMs?: number;
385
+ /** Serve the two model-catalog RPCs from a narrow stale-while-revalidate cache. */
386
+ catalogCache?: boolean;
385
387
  rateLimitWindowMs?: number;
386
388
  maxPairingAttempts?: number;
387
389
  maxRateLimitKeys?: number;
@@ -426,6 +428,7 @@ interface ResolvedGatewayConfig {
426
428
  readonly maxBodyBytes: number;
427
429
  readonly upstreamTimeoutMs: number;
428
430
  readonly upstreamApiTimeoutMs: number;
431
+ readonly catalogCache: boolean;
429
432
  readonly rateLimitWindowMs: number;
430
433
  readonly maxPairingAttempts: number;
431
434
  readonly maxRateLimitKeys: number;
@@ -1021,6 +1024,17 @@ interface PushRegistration extends PushRecipientKey {
1021
1024
  readonly enabled: boolean;
1022
1025
  readonly health: 'ready' | 'suspended' | 'repair-required';
1023
1026
  }
1027
+ interface PushCustomNotification {
1028
+ readonly sessionId: string;
1029
+ readonly title: string;
1030
+ readonly body: string;
1031
+ readonly category?: Exclude<PushCategory, 'test'>;
1032
+ readonly expiresAt?: number;
1033
+ }
1034
+ interface PushCustomNotificationResult {
1035
+ readonly queued: number;
1036
+ readonly expiresAt: number;
1037
+ }
1024
1038
  interface PushTarget {
1025
1039
  readonly sessionId: string;
1026
1040
  readonly interaction: 'current' | 'resolved';
@@ -1069,6 +1083,7 @@ interface PushGatewayService {
1069
1083
  logout(owner: PushOwner): Promise<void>;
1070
1084
  /** Resolves only an owned, still-valid opaque reference. */
1071
1085
  test(owner: PushOwner, installationId: string): Promise<void>;
1086
+ notifyCustom?(input: PushCustomNotification): Promise<PushCustomNotificationResult>;
1072
1087
  resolve(owner: PushOwner, reference: string): Promise<PushTarget | undefined>;
1073
1088
  }
1074
1089
  /** A graph-selection conflict with a bounded diagnostic safe for authenticated callers. */
@@ -1080,6 +1095,7 @@ export declare class ClientModuleConflictError extends HttpError {
1080
1095
  export declare function rewriteMobileIndex(html: string, excludedClientModules?: readonly string[]): string;
1081
1096
  /** Authenticated TLS edge in front of the ordinary loopback-only DSH Web server. */
1082
1097
  export declare class MobileAccessGateway {
1098
+ #private;
1083
1099
  readonly config: ResolvedGatewayConfig;
1084
1100
  private readonly extensions?;
1085
1101
  private readonly upstreamAuthenticatedUrl?;
@@ -1128,6 +1144,8 @@ export declare class MobileAccessGateway {
1128
1144
  private upstreamCookie;
1129
1145
  private upstreamCookieExpiresAt;
1130
1146
  private upstreamCookieTask;
1147
+ /** The catalog SWR cache, or undefined when `catalogCache` is disabled. */
1148
+ private get catalogCache();
1131
1149
  private upstreamAuthRequest;
1132
1150
  private nextOperationId;
1133
1151
  private closing;
@@ -1314,6 +1332,15 @@ export declare class MobileAccessGateway {
1314
1332
  private readUpstreamClientBundleWithRetry;
1315
1333
  private readUpstreamClientBundle;
1316
1334
  private allocateRequest;
1335
+ /** Read one bounded request body verbatim; the caller owns replaying it upstream. */
1336
+ private readRequestBody;
1337
+ /** One gateway-owned catalog fill: its own socket, rpcId, deadline and byte cap. */
1338
+ private catalogFill;
1339
+ /**
1340
+ * Serve one eligible catalog request from the SWR cache.
1341
+ * @returns true when the response was committed here; false for the ordinary path.
1342
+ */
1343
+ private serveCatalogCache;
1317
1344
  /**
1318
1345
  * Proxy one request, retrying transient failures for plugin and asset GETs.
1319
1346
  * Only bodyless GETs can be replayed, before response headers reach the client.
@@ -1333,6 +1360,12 @@ export declare class MobileAccessGateway {
1333
1360
  private broadcastDeviceRevoked;
1334
1361
  private pollLegacyCustomChanges;
1335
1362
  private openExtensionEventStream;
1363
+ /**
1364
+ * Native background notifications need only Host task and revocation events.
1365
+ * They use the paired session cookie but no mobile document view, because the
1366
+ * App has no live WebView while this stream is serving a suspended page.
1367
+ */
1368
+ private openBackgroundEventStream;
1336
1369
  private readUpgradeResponse;
1337
1370
  /** Snapshot of rejected upgrade paths for the approval UI (newest first). */
1338
1371
  blockedUpgradePathReport(): BlockedUpgradePathEntry[];
@@ -1350,6 +1383,27 @@ export declare class MobileAccessGateway {
1350
1383
  readonly failed: number;
1351
1384
  };
1352
1385
  }
1386
+ type SendCustomPush = (input: PushCustomNotification) => Promise<PushCustomNotificationResult>;
1387
+ declare module '@deepseek-ai/cordis' {
1388
+ interface Context {
1389
+ /** Trusted Host-plugin API for explicit, consent-checked web-push notifications. */
1390
+ mobilePush: MobilePushService;
1391
+ }
1392
+ }
1393
+ /**
1394
+ * Small Cordis service exposed to trusted Host plugins. The provider owns the
1395
+ * runtime lifetime and all recipient, category, session, and expiry checks.
1396
+ */
1397
+ export declare class MobilePushService extends Service {
1398
+ private readonly send;
1399
+ constructor(ctx: Context, send: SendCustomPush);
1400
+ /**
1401
+ * Queue a notification for enabled web-push recipients.
1402
+ * @param input - Session, text, optional category and optional expiry.
1403
+ * @returns The number of newly queued recipient deliveries and the applied expiry.
1404
+ */
1405
+ notify(input: PushCustomNotification): Promise<PushCustomNotificationResult>;
1406
+ }
1353
1407
  interface FrpArtifact {
1354
1408
  readonly platform: NodeJS.Platform;
1355
1409
  readonly arch: string;
@@ -2587,6 +2641,10 @@ interface IrohControllerOptions {
2587
2641
  readonly onStatus?: (status: IrohStatus) => void;
2588
2642
  readonly launchSidecar?: (executable: string, args: readonly string[]) => ChildProcessWithoutNullStreams;
2589
2643
  readonly resolveIdentity?: (executable: string, dataDir: string) => Promise<string>;
2644
+ readonly onFailure?: (failure: {
2645
+ readonly errorCode: string;
2646
+ readonly diagnostic?: string;
2647
+ }) => void;
2590
2648
  readonly readyTimeoutMs?: number;
2591
2649
  readonly pairingTimeoutMs?: number;
2592
2650
  }
@@ -2775,5 +2833,5 @@ export declare const inject: string[];
2775
2833
  export declare function originGatewayConfig(template: ResolvedGatewayConfig, settings: OriginSettings, stateFile: string, instanceId: string, listenPort?: number, legacyInstanceId?: string): ResolvedGatewayConfig;
2776
2834
  /** Mount the resident control route and its optional authenticated LAN gateway. */
2777
2835
  export declare function apply(ctx: Context, config: PluginConfig): Promise<void>;
2778
- export { type AccessControllerOptions, type AuthoritySpec, type BlockedUpgradePathEntry, type CaddySiteOptions, type CertRenewalStatus, type ClientModuleEntry, type ClientModulePreferenceSelection, type ClientModulePreferenceView, type CloudflaredComponentStatus, type CloudflaredControllerOptions, type CloudflaredState, type CloudflaredStatus, type CloudflaredTunnelMode, type CloudflaredTunnelSettings, type CloudflaredTunnelStatus, FRP_VHOST_HTTP_PORT as DEFAULT_VHOST_HTTP_PORT, type DeviceProbeResult, type DeviceSnapshot, type DeviceStore, type DeviceSummary, type DisabledTlsConfig, type FrpAttachOptions, type FrpAttachPlan, type FrpAttachPlanLocal, type FrpAttachPlanStep, type FrpAttachStepId, type FrpAttachTemplate, type FrpAttachVpsParts, type FrpComponentStatus, type FrpConfigurationStatus, type FrpControllerOptions, type FrpEntryTls, type FrpIngressCertificate, type FrpIngressPaths, type FrpIngressSelfCheck, type FrpSettings, type FrpState, type FrpStatus, type HostExecutionConfig, type IrohArtifact, type IrohComponentManagerOptions, type IrohComponentStatus, type IrohControllerOptions, type IrohPairingDescriptor, type IrohState, type IrohStatus, type IrohTlsCertificate, type IrohTlsPaths, type LocalExtensionManifest, type MobileAccessControlState, type MobileAccessControlStore, type MobileAccessService as MobileAccessRegistry, type MobileAccessRuntime, type MobileActionContext, type MobileExtensionClientEntry, type MobileExtensionDefinition, type MobileExtensionManifest, type MobileExtensionStatus, type MobileHostAction, type MobileHostRoute, type MobileRouteRequest, type MobileRouteResponse, type MobileWorkerHostApi, type OriginConfigurationStatus, type OriginControllerOptions, type OriginSettings, type OriginState, type OriginStatus, type PairingDescriptorField, type PairingResult, type ParsedCidr, type PluginConfig, type ProvidedTlsConfig, type RemoteProvider, type RemoteProviderController, type RemoteProviderState, type RemoteProviderStatus, type RenewalResult, type ResolvedGatewayConfig, type ResolvedHostExecutionConfig, type ServerCertificateAuthority, type ServerCertificateFiles, type ServerCertificateTarget, type SessionAuthorization, type SessionEndReason, type StoredDevice, type TaskCompletionEvent, type TaskEventContext, type TaskEventSession, type TaskEventSink, type TaskEventWatcherOptions, type TaskTurnEvent, type TlsConfig };
2836
+ export { type AccessControllerOptions, type AuthoritySpec, type BlockedUpgradePathEntry, type CaddySiteOptions, type CertRenewalStatus, type ClientModuleEntry, type ClientModulePreferenceSelection, type ClientModulePreferenceView, type CloudflaredComponentStatus, type CloudflaredControllerOptions, type CloudflaredState, type CloudflaredStatus, type CloudflaredTunnelMode, type CloudflaredTunnelSettings, type CloudflaredTunnelStatus, FRP_VHOST_HTTP_PORT as DEFAULT_VHOST_HTTP_PORT, type DeviceProbeResult, type DeviceSnapshot, type DeviceStore, type DeviceSummary, type DisabledTlsConfig, type FrpAttachOptions, type FrpAttachPlan, type FrpAttachPlanLocal, type FrpAttachPlanStep, type FrpAttachStepId, type FrpAttachTemplate, type FrpAttachVpsParts, type FrpComponentStatus, type FrpConfigurationStatus, type FrpControllerOptions, type FrpEntryTls, type FrpIngressCertificate, type FrpIngressPaths, type FrpIngressSelfCheck, type FrpSettings, type FrpState, type FrpStatus, type HostExecutionConfig, type IrohArtifact, type IrohComponentManagerOptions, type IrohComponentStatus, type IrohControllerOptions, type IrohPairingDescriptor, type IrohState, type IrohStatus, type IrohTlsCertificate, type IrohTlsPaths, type LocalExtensionManifest, type MobileAccessControlState, type MobileAccessControlStore, type MobileAccessService as MobileAccessRegistry, type MobileAccessRuntime, type MobileActionContext, type MobileExtensionClientEntry, type MobileExtensionDefinition, type MobileExtensionManifest, type MobileExtensionStatus, type MobileHostAction, type MobileHostRoute, type MobileRouteRequest, type MobileRouteResponse, type MobileWorkerHostApi, type OriginConfigurationStatus, type OriginControllerOptions, type OriginSettings, type OriginState, type OriginStatus, type PairingDescriptorField, type PairingResult, type ParsedCidr, type PluginConfig, type ProvidedTlsConfig, type PushCustomNotification, type PushCustomNotificationResult, type RemoteProvider, type RemoteProviderController, type RemoteProviderState, type RemoteProviderStatus, type RenewalResult, type ResolvedGatewayConfig, type ResolvedHostExecutionConfig, type SendCustomPush, type ServerCertificateAuthority, type ServerCertificateFiles, type ServerCertificateTarget, type SessionAuthorization, type SessionEndReason, type StoredDevice, type TaskCompletionEvent, type TaskEventContext, type TaskEventSession, type TaskEventSink, type TaskEventWatcherOptions, type TaskTurnEvent, type TlsConfig };
2779
2837
  //# sourceMappingURL=index.d.mts.map