@g9tm/app-diagnostic 0.2.1 → 0.3.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@g9tm/app-diagnostic",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "Device diagnostics client for apps in the field: tester reports (resumable upload) to a G9AppDiagnostic gateway. No platform code: the host reads the archive.",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -48,6 +48,8 @@ export function bundleManifest(m: BundleManifestInput): string {
48
48
  preferences: s.includePreferences,
49
49
  secureStorage: s.includeSecureStorage,
50
50
  },
51
+ // Which database copy this is: a package that trims nothing always says «full».
52
+ sqliteRows: s.includeSqlite ? 'full' : null,
51
53
  },
52
54
  null,
53
55
  2,
@@ -73,5 +75,6 @@ export function normalizeScopes(raw: Partial<BackupBuildRequestPayload> | null |
73
75
  includePreferences: r.includePreferences === true,
74
76
  includeSecureStorage: r.includeSecureStorage === true,
75
77
  includeErrors: r.includeErrors === true,
78
+ sqliteChangedRowsOnly: r.sqliteChangedRowsOnly === true,
76
79
  };
77
80
  }
@@ -173,6 +173,8 @@ export interface BackupBuildRequestPayload {
173
173
  includePreferences: boolean;
174
174
  includeSecureStorage: boolean;
175
175
  includeErrors: boolean;
176
+ /** The lighter backup: the app's heavy tables keep only their changed rows. Absent = the whole database. */
177
+ sqliteChangedRowsOnly?: boolean;
176
178
  }
177
179
 
178
180
  /** BackupSource (a number on the wire). */
@@ -193,9 +195,24 @@ export interface BackupUploadInitRequest {
193
195
  includeLogs: boolean;
194
196
  includePreferences: boolean;
195
197
  includeSecureStorage: boolean;
198
+ /** The database copy holds only the changed rows of the app's heavy tables. */
199
+ sqliteChangedRowsOnly?: boolean;
196
200
  source: number;
197
201
  }
198
202
 
203
+ /** The main admin opens the live session without the user's tap; the device verifies the signature itself. */
204
+ export interface AdminLiveRequestPayload {
205
+ challenge: { v: number; nonceBase64: string; clientId: string; issuedAtUtc: string; roleKind: string; operatorBundle?: unknown };
206
+ signatureBase64: string;
207
+ adminName: string;
208
+ reason?: string | null;
209
+ }
210
+
211
+ export interface AdminLiveResultPayload {
212
+ accepted: boolean;
213
+ reason?: string | null;
214
+ }
215
+
199
216
  export interface BackupUploadInitResponse {
200
217
  accepted: boolean;
201
218
  rejectionReason?: string | null;
@@ -388,6 +388,8 @@ export class TesterEngine {
388
388
  this.timeline.touch(e.x, e.y, e.fingers, this.now());
389
389
  return;
390
390
  }
391
+ // Only a tap or a whole gesture counts: a watcher may report more (a `seq` trace of a touch, 2026-11-15).
392
+ if (e.type !== 'tap' && e.type !== 'gesture') return;
391
393
  const s = this.state$.get();
392
394
  if (!s.enabled) return;
393
395
  const excluded = e.excluded === true;
package/src/wire.ts CHANGED
@@ -86,6 +86,7 @@ export const DeviceHubMethods = {
86
86
  pushSyncCacheCleared: 'PushSyncCacheCleared',
87
87
  pushSyncRunResult: 'PushSyncRunResult',
88
88
  pushNfcWriteResult: 'PushNfcWriteResult',
89
+ pushAdminLiveResult: 'PushAdminLiveResult',
89
90
  pushRestoreResult: 'PushRestoreResult',
90
91
  pushRestoreReady: 'PushRestoreReady',
91
92
  backupUploadInit: 'BackupUploadInit',
@@ -118,6 +119,7 @@ export const DeviceHubListeners = {
118
119
  clearSyncCacheRequest: 'OnClearSyncCacheRequestAsync',
119
120
  runSyncRequest: 'OnRunSyncRequestAsync',
120
121
  nfcWriteRequest: 'OnNfcWriteRequestAsync',
122
+ adminLiveRequest: 'OnAdminLiveRequestAsync',
121
123
  qaCommand: 'OnQaCommandAsync',
122
124
  deviceSettingsChanged: 'OnDeviceSettingsChangedAsync',
123
125
  } as const;
@@ -126,7 +128,13 @@ export const DeviceHubListeners = {
126
128
  * What this client build serves (DeviceCapabilities.Current). The contract: absent = the client predates the tag = not
127
129
  * capable, so a request it cannot answer fails fast at the gateway instead of timing out.
128
130
  */
129
- export const DeviceCapabilities = { logFiles: 'logfiles' } as const;
131
+ export const DeviceCapabilities = {
132
+ logFiles: 'logfiles',
133
+ /** The main admin's direct live session (OnAdminLiveRequestAsync). Served by the .NET client; not by this one yet. */
134
+ adminLive: 'adminlive',
135
+ /** The APP's backup honours sqliteChangedRowsOnly; the app adds it (channel options), never this package. */
136
+ backupChangedRows: 'backup-changed-rows',
137
+ } as const;
130
138
  export const CURRENT_CAPABILITIES: readonly string[] = [DeviceCapabilities.logFiles];
131
139
 
132
140
  /** The archive upload over the hub (x-transfer): 256 KiB per stream item, 4 MiB per stream call. */