dsh-mobile 0.6.15 → 0.6.17

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
@@ -394,6 +394,8 @@ interface ResolvedGatewayConfig {
394
394
  readonly excludedClientModules: readonly string[];
395
395
  readonly websocketCompression: ResolvedWebSocketCompressionConfig;
396
396
  readonly instanceId: string;
397
+ /** Plugin-wide installation identity, disclosed only after native authentication. */
398
+ readonly installationId?: string;
397
399
  /** Identity returned only for authenticated legacy native credentials without a stored binding. */
398
400
  readonly legacyInstanceId?: string;
399
401
  readonly pairingCaFile?: string;
@@ -430,6 +432,12 @@ interface ClientModuleEntry {
430
432
  readonly id: string;
431
433
  readonly required: boolean;
432
434
  readonly dependencies: readonly string[];
435
+ /** Source bytes of the upstream bundle, when the Gateway could measure them. */
436
+ readonly bytes?: number;
437
+ /** Gzipped bytes the phone would receive, when the Gateway could measure them. */
438
+ readonly gzipBytes?: number;
439
+ /** The plugin package's own one-line description, when it could be read. */
440
+ readonly description?: string;
433
441
  }
434
442
  /** Selection returned to the computer administrator or the authenticated device. */
435
443
  interface ClientModulePreferenceView {
@@ -567,6 +575,18 @@ type HttpFailureEntry = ({
567
575
  readonly suppressed?: number;
568
576
  };
569
577
  //#endregion
578
+ //#region src/api-latency-log.d.ts
579
+ /** One sampled API wait; `durationMs` spans the client's request to response close. */
580
+ type ApiLatencyEntry = {
581
+ readonly kind: 'api';
582
+ readonly method: 'GET' | 'HEAD' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OTHER';
583
+ readonly path: string;
584
+ readonly status: number;
585
+ readonly durationMs: number;
586
+ } & {
587
+ readonly suppressed?: number;
588
+ };
589
+ //#endregion
570
590
  //#region src/upstream-auth-log.d.ts
571
591
  /** Fixed outcomes of the Gateway's private DSH launch-token exchange. */
572
592
  type UpstreamAuthOutcome = 'accepted' | 'invalid-target' | 'unexpected-status' | 'invalid-cookie' | 'timeout' | 'transport-error';
@@ -1015,6 +1035,7 @@ export declare class MobileAccessGateway {
1015
1035
  private readonly mobileBootBatches;
1016
1036
  private readonly mobileDocumentViews;
1017
1037
  private readonly mobileGraphTasks;
1038
+ private readonly workspaceDirectoryTasks;
1018
1039
  /** Cached upstream bundle byte sizes (HEAD probes), keyed by resource URL. */
1019
1040
  private readonly bootEntrySizeCache;
1020
1041
  private readonly extensionEventListeners;
@@ -1042,15 +1063,20 @@ export declare class MobileAccessGateway {
1042
1063
  private readonly probeDeviceLimiter;
1043
1064
  private readonly probeInFlight;
1044
1065
  private readonly clientModulePreferences;
1066
+ private readonly clientModuleSizeCache;
1067
+ private readonly clientModuleDescriptionCache;
1068
+ private clientModuleMetadataRevision;
1069
+ private clientModuleMeasurementActive;
1045
1070
  private readonly clientModuleOperations;
1046
1071
  private readonly clientModuleTasks;
1047
1072
  private readonly clientModuleRevocations;
1048
1073
  private readonly authFailures;
1049
1074
  private readonly httpFailures;
1075
+ private readonly apiLatency;
1050
1076
  private readonly upstreamAuthDiagnostics;
1051
1077
  constructor(config: ResolvedGatewayConfig, store: DeviceStore, extensions?: MobileAccessService | undefined, upstreamAuthenticatedUrl?: string | undefined, extraWebSocketPaths?: {
1052
1078
  has(pathname: string): boolean;
1053
- } | undefined, blockedUpgradeLog?: BlockedUpgradePathLog | undefined, onDiscoveryDegraded?: ((source: 'broadcast' | 'mdns', code: string) => void) | undefined, clientModulePreferences?: ClientModulePreferenceStore, authFailureLog?: (entry: AuthFailureEntry) => void, httpFailureLog?: (entry: HttpFailureEntry) => void, upstreamAuthLog?: (entry: UpstreamAuthEntry) => void);
1079
+ } | undefined, blockedUpgradeLog?: BlockedUpgradePathLog | undefined, onDiscoveryDegraded?: ((source: 'broadcast' | 'mdns', code: string) => void) | undefined, clientModulePreferences?: ClientModulePreferenceStore, authFailureLog?: (entry: AuthFailureEntry) => void, httpFailureLog?: (entry: HttpFailureEntry) => void, upstreamAuthLog?: (entry: UpstreamAuthEntry) => void, apiLatencyLog?: (entry: ApiLatencyEntry) => void);
1054
1080
  /** Initialize durable state, validate TLS, and bind the externally reachable listener. */
1055
1081
  start(): Promise<void>;
1056
1082
  /** Install a newly signed provided leaf for future TLS handshakes without dropping sessions. */
@@ -1093,6 +1119,8 @@ export declare class MobileAccessGateway {
1093
1119
  private handleRenew;
1094
1120
  /** CA-backed entries retain their pin; public entries project the authenticated credential's identity. */
1095
1121
  private nativeResponseInstanceId;
1122
+ /** Older Apps require exact wire keys; expose this hint only to explicit opt-in clients after authentication. */
1123
+ private nativeResponseInstallationIdentity;
1096
1124
  private handleNativePair;
1097
1125
  private handleNativeRenew;
1098
1126
  private handleNativeProbe;
@@ -1109,6 +1137,12 @@ export declare class MobileAccessGateway {
1109
1137
  * @returns The installed catalog and effective module selection.
1110
1138
  */
1111
1139
  describeClientModules(deviceId?: string, callerSignal?: AbortSignal): Promise<ClientModulePreferenceView>;
1140
+ /** Measure optional catalog metadata without changing saved module selections.
1141
+ * @param deviceId - Authenticated device identity, or computer defaults when omitted.
1142
+ * @param callerSignal - Cancels measurement and drains its admitted requests.
1143
+ * @returns Current selections with the measurements completed within the budget.
1144
+ */
1145
+ measureClientModules(deviceId?: string, callerSignal?: AbortSignal): Promise<ClientModulePreferenceView>;
1112
1146
  /** Persist a validated device override or computer default.
1113
1147
  * @param excluded - Untrusted module IDs to validate against the current boot graph.
1114
1148
  * @param deviceId - Authenticated device identity; omitted for computer defaults.
@@ -1122,6 +1156,25 @@ export declare class MobileAccessGateway {
1122
1156
  * @returns The catalog and inherited selection.
1123
1157
  */
1124
1158
  resetClientModules(deviceId?: string, callerSignal?: AbortSignal): Promise<ClientModulePreferenceView>;
1159
+ /** Return cached metadata only; catalog reads and saves never start bundle probes. */
1160
+ private describeMobileModulesWithSizes;
1161
+ /** Refresh metadata only after an explicit user action, with bounded concurrency. */
1162
+ private measureMobileModules;
1163
+ /**
1164
+ * Read the installed package description for one catalog module.
1165
+ *
1166
+ * This is best-effort package metadata lookup from the state directory's Node
1167
+ * resolution context and this plugin's dependencies. Unexported or unavailable
1168
+ * package metadata stays unknown; arbitrary paths and subpaths are not read.
1169
+ */
1170
+ private installedModuleDescription;
1171
+ /**
1172
+ * Measure one upstream bundle's source and gzipped size.
1173
+ *
1174
+ * Measurements are cached for ten minutes: the settings panel is opened rarely
1175
+ * and upstream bundle bytes only change on a plugin rebuild or host restart.
1176
+ */
1177
+ private upstreamBundleMeasurement;
1125
1178
  private clientModulePreferenceOperation;
1126
1179
  private fetchAuthenticatedUpstreamIndex;
1127
1180
  private proxyMobileIndex;