agl 43.13.0 → 44.0.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.
Files changed (99) hide show
  1. package/changelog.md +28 -0
  2. package/dist_serve/bundle.js +4473 -4235
  3. package/dist_serve/bundle.js.map +2 -2
  4. package/dist_serve/bundle.js.third-party-notices.json +29 -29
  5. package/dist_serve/bundle.js.third-party-notices.txt +29 -29
  6. package/dist_ts/00_commitinfo_data.js +2 -2
  7. package/dist_ts/aglapi/aglapisurface.document.js +37 -4
  8. package/dist_ts/classes.authstore.d.ts +60 -3
  9. package/dist_ts/classes.authstore.js +161 -13
  10. package/dist_ts/classes.controller.d.ts +63 -0
  11. package/dist_ts/classes.controller.js +502 -43
  12. package/dist_ts/classes.embeddeddb.js +7 -2
  13. package/dist_ts/classes.flexmodels.private.d.ts +39 -0
  14. package/dist_ts/classes.flexmodels.private.js +127 -1
  15. package/dist_ts/classes.flexprojectpreparation.d.ts +21 -0
  16. package/dist_ts/classes.flexprojectpreparation.js +69 -0
  17. package/dist_ts/classes.flexpromptqueue.d.ts +21 -1
  18. package/dist_ts/classes.flexpromptqueue.js +67 -7
  19. package/dist_ts/classes.flexrequestqueue.d.ts +11 -0
  20. package/dist_ts/classes.flexrequestqueue.js +40 -0
  21. package/dist_ts/classes.flexservice.d.ts +46 -14
  22. package/dist_ts/classes.flexservice.js +179 -55
  23. package/dist_ts/classes.flexstore.d.ts +68 -3
  24. package/dist_ts/classes.flexstore.js +277 -11
  25. package/dist_ts/classes.flexsubmissionmodels.d.ts +58 -0
  26. package/dist_ts/classes.flexsubmissionmodels.js +162 -0
  27. package/dist_ts/classes.flexsubmissionstore.d.ts +70 -0
  28. package/dist_ts/classes.flexsubmissionstore.js +323 -0
  29. package/dist_ts/classes.flexsupervisor.d.ts +10 -0
  30. package/dist_ts/classes.flexsupervisor.js +27 -1
  31. package/dist_ts/classes.harnessoperationmanager.d.ts +31 -0
  32. package/dist_ts/classes.harnessoperationmanager.js +69 -7
  33. package/dist_ts/classes.mcpclient.js +4 -3
  34. package/dist_ts/classes.mcpcontrollerhost.js +3 -2
  35. package/dist_ts/classes.pendingpromptstore.d.ts +11 -3
  36. package/dist_ts/classes.pendingpromptstore.js +66 -10
  37. package/dist_ts/classes.sessionidentityservice.d.ts +18 -1
  38. package/dist_ts/classes.sessionidentityservice.js +34 -4
  39. package/dist_ts/classes.ticketstore.d.ts +5 -3
  40. package/dist_ts/classes.ticketstore.js +7 -2
  41. package/dist_ts/classes.validation.d.ts +3 -0
  42. package/dist_ts/classes.validation.js +50 -1
  43. package/dist_ts/functions.deviceapi.js +7 -3
  44. package/dist_ts/interfaces.auth.d.ts +3 -1
  45. package/dist_ts/interfaces.auth.js +1 -1
  46. package/dist_ts/interfaces.flexipc.d.ts +29 -5
  47. package/dist_ts/interfaces.flexipc.js +13 -4
  48. package/dist_ts_authswitch/classes.authoritydatabase.d.ts +1 -0
  49. package/dist_ts_authswitch/classes.authoritydatabase.js +17 -5
  50. package/dist_ts_interfaces/flexadmission.d.ts +69 -0
  51. package/dist_ts_interfaces/flexadmission.js +2 -0
  52. package/dist_ts_interfaces/index.d.ts +1 -0
  53. package/dist_ts_interfaces/index.js +2 -1
  54. package/dist_ts_interfaces/interfaces.d.ts +10 -1
  55. package/dist_ts_interfaces/interfaces.js +2 -2
  56. package/dist_ts_interfaces/requests.d.ts +2 -1
  57. package/dist_ts_interfaces/requests.js +1 -1
  58. package/dist_ts_interfaces/tickets.d.ts +9 -1
  59. package/dist_ts_interfaces/tickets.js +11 -2
  60. package/dist_ts_migration/v10_flexharnessv3migration.js +4 -1
  61. package/docs/nosqldb11-migration.md +59 -0
  62. package/package.json +10 -9
  63. package/readme.md +5 -1
  64. package/ts/00_commitinfo_data.ts +1 -1
  65. package/ts/aglapi/aglapisurface.document.ts +36 -3
  66. package/ts/classes.authstore.ts +179 -11
  67. package/ts/classes.controller.ts +498 -40
  68. package/ts/classes.embeddeddb.ts +6 -1
  69. package/ts/classes.flexmodels.private.ts +109 -0
  70. package/ts/classes.flexprojectpreparation.ts +69 -0
  71. package/ts/classes.flexpromptqueue.ts +69 -6
  72. package/ts/classes.flexrequestqueue.ts +47 -0
  73. package/ts/classes.flexservice.ts +187 -51
  74. package/ts/classes.flexstore.ts +352 -10
  75. package/ts/classes.flexsubmissionmodels.ts +89 -0
  76. package/ts/classes.flexsubmissionstore.ts +312 -0
  77. package/ts/classes.flexsupervisor.ts +26 -0
  78. package/ts/classes.harnessoperationmanager.ts +79 -6
  79. package/ts/classes.mcpclient.ts +3 -2
  80. package/ts/classes.mcpcontrollerhost.ts +2 -1
  81. package/ts/classes.pendingpromptstore.ts +55 -6
  82. package/ts/classes.sessionidentityservice.ts +33 -2
  83. package/ts/classes.ticketstore.ts +11 -4
  84. package/ts/classes.validation.ts +42 -0
  85. package/ts/functions.deviceapi.ts +6 -2
  86. package/ts/interfaces.auth.ts +3 -1
  87. package/ts/interfaces.flexipc.ts +38 -4
  88. package/ts_authswitch/classes.authoritydatabase.ts +19 -5
  89. package/ts_interfaces/flexadmission.ts +52 -0
  90. package/ts_interfaces/index.ts +2 -0
  91. package/ts_interfaces/interfaces.ts +10 -1
  92. package/ts_interfaces/requests.ts +3 -0
  93. package/ts_interfaces/tickets.ts +12 -2
  94. package/ts_migration/v10_flexharnessv3migration.ts +3 -0
  95. package/ts_web/00_commitinfo_data.ts +1 -1
  96. package/ts_web/classes.browsersubmissions.ts +279 -0
  97. package/ts_web/classes.sessiondraftsync.ts +64 -1
  98. package/ts_web/elements.harnesscontrollerapp.ts +340 -5
  99. package/ts_web/functions.flexsubmissions.ts +88 -0
@@ -30,7 +30,28 @@ export interface IFlexStoreOptions {
30
30
  retiredWriterIds?: readonly string[];
31
31
  projectManagementHost: IFlexProjectManagementHost;
32
32
  onFatalError?: (errorArg: Error) => void;
33
+ /**
34
+ * Called once each time FlexHarness qualifies a namespace explicitly (`prepareScope` with
35
+ * `qualifyLegacy`), with what the store found when the namespace's provenance first read
36
+ * unqualified. The Flex child writes it to the controller log.
37
+ */
38
+ onWriteProvenanceQualified?: (qualificationArg: TFlexWriteProvenanceQualification) => void;
33
39
  }
40
+ /**
41
+ * Why a namespace needed explicit qualification: no write witness (`absent`: the first start after
42
+ * the upgrade that added it, or a new project), or writes the witness does not know (`stale`: a
43
+ * writer whose provenance was not activated wrote it; `writeCount` equal to `knownWriteCount` means
44
+ * only the recovery proof was out of date).
45
+ */
46
+ export type TFlexWriteProvenanceQualification = {
47
+ storageKey: string;
48
+ reason: 'absent';
49
+ } | {
50
+ storageKey: string;
51
+ reason: 'stale';
52
+ writeCount: number;
53
+ knownWriteCount: number;
54
+ };
34
55
  /** What a migration may do in its storage key's writer turn; see `FlexStore.runMigrationTurn`. */
35
56
  export interface IFlexMigrationTurn {
36
57
  readonly controllerId: string;
@@ -156,9 +177,24 @@ export declare class FlexStore implements plugins.flexharness.IFlexHarnessStores
156
177
  readonly projectManagement: plugins.flexharness.IFlexProjectManagementStore;
157
178
  readonly agentEvents: plugins.flexharness.IFlexAgentEventStoreProvider;
158
179
  readonly jobs: plugins.flexharness.IFlexToolJobStoreProvider;
180
+ /**
181
+ * FlexHarness's recovery sidecar for this storage (`scopes.sessionLocal`): the proof lives in
182
+ * `flex_scope_recovery`, the write provenance in `flex_namespace_writes`, which every write
183
+ * transaction of the namespace counts (`renewLeaseAndCountWrite`).
184
+ */
185
+ readonly scopeRecovery: plugins.flexharness.IFlexScopeRecoveryStore;
159
186
  private readonly database;
160
187
  private readonly controllerId;
161
188
  private readonly writerId;
189
+ private readonly onWriteProvenanceQualified?;
190
+ /** Storage keys whose writes this store records as known: FlexHarness activated their provenance. */
191
+ private readonly knownWriteKeys;
192
+ /**
193
+ * What the first unqualified provenance read of a storage key found since its last qualification,
194
+ * reported when FlexHarness qualifies it. A qualifying load writes before it qualifies, so a later
195
+ * read would no longer see the state the preparation started from.
196
+ */
197
+ private readonly unqualifiedProvenance;
162
198
  private readonly retiredWriterIds;
163
199
  private readonly onFatalError?;
164
200
  private readonly manager;
@@ -237,6 +273,11 @@ export declare class FlexStore implements plugins.flexharness.IFlexHarnessStores
237
273
  * committed snapshot, at the same revision, storing the records it lacks again.
238
274
  */
239
275
  private repairTranscript;
276
+ /**
277
+ * Takes this store's writer lease for the storage key in its writer turn, or proves it still holds
278
+ * it. The Flex child prepares a project's FlexHarness namespace only after this.
279
+ */
280
+ holdWriterLease(storageKeyArg: string): Promise<void>;
240
281
  purgeScope(storageKeyArg: string): Promise<void>;
241
282
  reconcileOrphans(nowArg?: number, abortSignalArg?: AbortSignal): Promise<void>;
242
283
  /**
@@ -367,10 +408,34 @@ export declare class FlexStore implements plugins.flexharness.IFlexHarnessStores
367
408
  private commitHeadMutation;
368
409
  private commitHeadMutationWithLease;
369
410
  /**
370
- * Renews the held lease inside a transaction, so the transaction commits only while this store
371
- * still owns the lease and a concurrent takeover conflicts with it.
411
+ * The first step of both Flex namespace write transactions (`commitHeadMutationWithLease`,
412
+ * `deleteScopeRecordBatchWithLease`) and of nothing else. It renews the held lease, so the
413
+ * transaction commits only while this store still owns the lease and a concurrent takeover
414
+ * conflicts with it, and counts the write in the namespace's witness (`flex_namespace_writes`):
415
+ * a write of a storage key whose provenance FlexHarness activated (`knownWriteKeys`) requires
416
+ * every earlier write to be known and counts itself as known; any other write counts as unknown.
417
+ * A known write that finds an unknown one fails with `FlexHarnessStoreFormatError`, so the
418
+ * transaction and its data write abort. Acquiring, renewing and taking over a lease never count.
419
+ * Only a purge's last step, which deletes the witness itself, skips the count.
420
+ */
421
+ private renewLeaseAndCountWrite;
422
+ private readNamespaceWrites;
423
+ private readScopeRecovery;
424
+ /**
425
+ * True only when the namespace's witness exists and knows every write; then this store records
426
+ * its writes of the key as known. An absent witness is unqualified whatever the namespace holds:
427
+ * the store never assumes an empty namespace is new. Reads metadata only.
428
+ */
429
+ private loadWriteProvenance;
430
+ /**
431
+ * Marks every write so far as known, in the storage key's writer turn under its lease, and records
432
+ * this store's later writes as known. FlexHarness calls it only at the end of an explicit
433
+ * qualification (`prepareScope` with `qualifyLegacy`), after its complete load and repair.
372
434
  */
373
- private renewLeaseInTransaction;
435
+ private qualifyWriteProvenance;
436
+ private loadScopeRecovery;
437
+ /** A compare-and-swap on the proof's revision through the namespace's head mutation path. */
438
+ private saveScopeRecovery;
374
439
  private applyHeadMutation;
375
440
  private deleteScopeRecords;
376
441
  private deleteScopeRecordBatch;