dsh-mobile 0.6.16 → 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
@@ -432,6 +432,12 @@ interface ClientModuleEntry {
432
432
  readonly id: string;
433
433
  readonly required: boolean;
434
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;
435
441
  }
436
442
  /** Selection returned to the computer administrator or the authenticated device. */
437
443
  interface ClientModulePreferenceView {
@@ -569,6 +575,18 @@ type HttpFailureEntry = ({
569
575
  readonly suppressed?: number;
570
576
  };
571
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
572
590
  //#region src/upstream-auth-log.d.ts
573
591
  /** Fixed outcomes of the Gateway's private DSH launch-token exchange. */
574
592
  type UpstreamAuthOutcome = 'accepted' | 'invalid-target' | 'unexpected-status' | 'invalid-cookie' | 'timeout' | 'transport-error';
@@ -1017,6 +1035,7 @@ export declare class MobileAccessGateway {
1017
1035
  private readonly mobileBootBatches;
1018
1036
  private readonly mobileDocumentViews;
1019
1037
  private readonly mobileGraphTasks;
1038
+ private readonly workspaceDirectoryTasks;
1020
1039
  /** Cached upstream bundle byte sizes (HEAD probes), keyed by resource URL. */
1021
1040
  private readonly bootEntrySizeCache;
1022
1041
  private readonly extensionEventListeners;
@@ -1044,15 +1063,20 @@ export declare class MobileAccessGateway {
1044
1063
  private readonly probeDeviceLimiter;
1045
1064
  private readonly probeInFlight;
1046
1065
  private readonly clientModulePreferences;
1066
+ private readonly clientModuleSizeCache;
1067
+ private readonly clientModuleDescriptionCache;
1068
+ private clientModuleMetadataRevision;
1069
+ private clientModuleMeasurementActive;
1047
1070
  private readonly clientModuleOperations;
1048
1071
  private readonly clientModuleTasks;
1049
1072
  private readonly clientModuleRevocations;
1050
1073
  private readonly authFailures;
1051
1074
  private readonly httpFailures;
1075
+ private readonly apiLatency;
1052
1076
  private readonly upstreamAuthDiagnostics;
1053
1077
  constructor(config: ResolvedGatewayConfig, store: DeviceStore, extensions?: MobileAccessService | undefined, upstreamAuthenticatedUrl?: string | undefined, extraWebSocketPaths?: {
1054
1078
  has(pathname: string): boolean;
1055
- } | 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);
1056
1080
  /** Initialize durable state, validate TLS, and bind the externally reachable listener. */
1057
1081
  start(): Promise<void>;
1058
1082
  /** Install a newly signed provided leaf for future TLS handshakes without dropping sessions. */
@@ -1113,6 +1137,12 @@ export declare class MobileAccessGateway {
1113
1137
  * @returns The installed catalog and effective module selection.
1114
1138
  */
1115
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>;
1116
1146
  /** Persist a validated device override or computer default.
1117
1147
  * @param excluded - Untrusted module IDs to validate against the current boot graph.
1118
1148
  * @param deviceId - Authenticated device identity; omitted for computer defaults.
@@ -1126,6 +1156,25 @@ export declare class MobileAccessGateway {
1126
1156
  * @returns The catalog and inherited selection.
1127
1157
  */
1128
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;
1129
1178
  private clientModulePreferenceOperation;
1130
1179
  private fetchAuthenticatedUpstreamIndex;
1131
1180
  private proxyMobileIndex;