agl 43.14.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 (89) hide show
  1. package/changelog.md +22 -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.pendingpromptstore.d.ts +11 -3
  34. package/dist_ts/classes.pendingpromptstore.js +66 -10
  35. package/dist_ts/classes.sessionidentityservice.d.ts +18 -1
  36. package/dist_ts/classes.sessionidentityservice.js +34 -4
  37. package/dist_ts/classes.validation.d.ts +3 -0
  38. package/dist_ts/classes.validation.js +50 -1
  39. package/dist_ts/functions.deviceapi.js +3 -1
  40. package/dist_ts/interfaces.auth.d.ts +3 -1
  41. package/dist_ts/interfaces.auth.js +1 -1
  42. package/dist_ts/interfaces.flexipc.d.ts +29 -5
  43. package/dist_ts/interfaces.flexipc.js +13 -4
  44. package/dist_ts_authswitch/classes.authoritydatabase.d.ts +1 -0
  45. package/dist_ts_authswitch/classes.authoritydatabase.js +17 -5
  46. package/dist_ts_interfaces/flexadmission.d.ts +69 -0
  47. package/dist_ts_interfaces/flexadmission.js +2 -0
  48. package/dist_ts_interfaces/index.d.ts +1 -0
  49. package/dist_ts_interfaces/index.js +2 -1
  50. package/dist_ts_interfaces/interfaces.d.ts +10 -1
  51. package/dist_ts_interfaces/interfaces.js +2 -2
  52. package/dist_ts_interfaces/requests.d.ts +2 -1
  53. package/dist_ts_interfaces/requests.js +1 -1
  54. package/dist_ts_migration/v10_flexharnessv3migration.js +4 -1
  55. package/docs/nosqldb11-migration.md +59 -0
  56. package/package.json +10 -9
  57. package/readme.md +5 -1
  58. package/ts/00_commitinfo_data.ts +1 -1
  59. package/ts/aglapi/aglapisurface.document.ts +36 -3
  60. package/ts/classes.authstore.ts +179 -11
  61. package/ts/classes.controller.ts +498 -40
  62. package/ts/classes.embeddeddb.ts +6 -1
  63. package/ts/classes.flexmodels.private.ts +109 -0
  64. package/ts/classes.flexprojectpreparation.ts +69 -0
  65. package/ts/classes.flexpromptqueue.ts +69 -6
  66. package/ts/classes.flexrequestqueue.ts +47 -0
  67. package/ts/classes.flexservice.ts +187 -51
  68. package/ts/classes.flexstore.ts +352 -10
  69. package/ts/classes.flexsubmissionmodels.ts +89 -0
  70. package/ts/classes.flexsubmissionstore.ts +312 -0
  71. package/ts/classes.flexsupervisor.ts +26 -0
  72. package/ts/classes.harnessoperationmanager.ts +79 -6
  73. package/ts/classes.pendingpromptstore.ts +55 -6
  74. package/ts/classes.sessionidentityservice.ts +33 -2
  75. package/ts/classes.validation.ts +42 -0
  76. package/ts/functions.deviceapi.ts +2 -0
  77. package/ts/interfaces.auth.ts +3 -1
  78. package/ts/interfaces.flexipc.ts +38 -4
  79. package/ts_authswitch/classes.authoritydatabase.ts +19 -5
  80. package/ts_interfaces/flexadmission.ts +52 -0
  81. package/ts_interfaces/index.ts +2 -0
  82. package/ts_interfaces/interfaces.ts +10 -1
  83. package/ts_interfaces/requests.ts +3 -0
  84. package/ts_migration/v10_flexharnessv3migration.ts +3 -0
  85. package/ts_web/00_commitinfo_data.ts +1 -1
  86. package/ts_web/classes.browsersubmissions.ts +279 -0
  87. package/ts_web/classes.sessiondraftsync.ts +64 -1
  88. package/ts_web/elements.harnesscontrollerapp.ts +340 -5
  89. package/ts_web/functions.flexsubmissions.ts +88 -0
@@ -1,3 +1,4 @@
1
+ import { ControllerFlexSubmissionStore } from './classes.flexsubmissionstore.js';
1
2
  import { ControllerCodexConnectionStore } from './classes.codexconnectionstore.js';
2
3
  import { ControllerClaudeSessionStore } from './classes.claudesessionstore.js';
3
4
  import { ControllerPendingPromptStore } from './classes.pendingpromptstore.js';
@@ -47,6 +48,7 @@ export declare class SmartDataAuthStore implements IAuthStore, IAuthStoreSession
47
48
  private codexConnectionStore?;
48
49
  private claudeSessionStore?;
49
50
  private pendingPromptStore?;
51
+ private flexSubmissionStore?;
50
52
  private codexTurnStore?;
51
53
  private readonly modelOwner;
52
54
  private releaseModelOwnership?;
@@ -143,6 +145,12 @@ export declare class SmartDataAuthStore implements IAuthStore, IAuthStoreSession
143
145
  private withPendingProjectRemovalSessionIdentityMutation;
144
146
  admitManagedSession(inputArg: IAdmitControllerManagedSessionInput): Promise<IControllerSessionManagedObservation>;
145
147
  /** The messages this controller's conversations have not taken in; needs the resolved controller. */
148
+ requireFlexSubmissions(): ControllerFlexSubmissionStore;
149
+ /**
150
+ * Same lifecycle writer as managed identity: retirement cannot overtake a durable admission. A
151
+ * project that is not registered, or whose removal started, is `project_not_found`.
152
+ */
153
+ withFlexSubmissionAdmission<TResult>(projectIdArg: string, operationArg: (storeArg: ControllerFlexSubmissionStore) => Promise<TResult>): Promise<TResult>;
146
154
  requirePendingPrompts(): ControllerPendingPromptStore;
147
155
  /** The turn records of this controller's Codex conversations; needs the resolved controller. */
148
156
  requireCodexTurns(): ControllerCodexTurnStore;
@@ -233,7 +241,17 @@ export declare class SmartDataAuthStore implements IAuthStore, IAuthStoreSession
233
241
  */
234
242
  setProjectAgentMessages(projectIdArg: string, enabledArg: boolean): Promise<IControllerProjectDocument | undefined>;
235
243
  listPendingProjectRemovals(): Promise<IControllerProjectDocument[]>;
236
- /** A caller whose `signalArg` aborts while it waits for its turn withdraws its operation. */
244
+ /**
245
+ * Whether this store reached an embedded engine another process owns (a CLI command or the
246
+ * upgrade worker beside a running controller). Such a store never takes the project mutation lane.
247
+ */
248
+ get attachedToForeignEngine(): boolean;
249
+ /**
250
+ * The single writer lane: projects, session locators and managed sessions are written only here,
251
+ * and only by the controller process that owns the embedded engine. A store attached to another
252
+ * process's engine is refused before anything is read or written. A caller whose `signalArg`
253
+ * aborts while it waits for its turn withdraws its operation.
254
+ */
237
255
  private withProjectMutation;
238
256
  private insertResourceDocument;
239
257
  private transitionResourceDocument;
@@ -399,8 +417,36 @@ export declare class SmartDataAuthStore implements IAuthStore, IAuthStoreSession
399
417
  listProjectSessionIntelligenceCleanupObligations(projectIdArg: string): Promise<IControllerInterruptedIntelligenceRecovery['temporarySessionIds']>;
400
418
  getSessionIntelligenceCleanupObligations(projectIdArg: string, sessionIdArg: IControllerRuntimeId): Promise<IControllerInterruptedIntelligenceRecovery['temporarySessionIds']>;
401
419
  findProjectSessionIntelligenceTemporarySessionIds(projectIdArg: string, candidateIdsArg: string[], signalArg?: AbortSignal): Promise<Set<string>>;
420
+ /**
421
+ * The generation of the session's live Flex project-management record, or undefined when the
422
+ * state holds none or only a tombstone.
423
+ */
424
+ liveFlexProjectManagementGeneration(projectIdArg: string, sessionIdArg: IControllerRuntimeId): Promise<TFlexSessionGeneration | undefined>;
425
+ /**
426
+ * Ends a Flex session's state after FlexHarness answered its generation-fenced deletion `absent`
427
+ * (no live session and no retained cleanup tombstone of any generation holds the id), in one
428
+ * session-state mutation that reads the latest document: a missing document is written deleted,
429
+ * a deleted one stays as it is, a live one without a project-management record or with a live
430
+ * record of `generationArg` (an orphan FlexHarness no longer knows, logged as a warning) ends.
431
+ * A live record of any other generation means a newer session took the id meanwhile: nothing is
432
+ * written and its generation is returned.
433
+ */
434
+ settleAbsentFlexSessionState(projectIdArg: string, sessionIdArg: IControllerRuntimeId, generationArg: Readonly<TFlexSessionGeneration>): Promise<{
435
+ outcome: 'ended';
436
+ } | {
437
+ outcome: 'other-generation';
438
+ generation: TFlexSessionGeneration;
439
+ }>;
402
440
  isSessionStateTombstoned(projectIdArg: string, sessionIdArg: IControllerRuntimeId): Promise<boolean>;
403
- retireProjectSessionStates(projectIdArg: string, cleanupTemporarySessionArg: (temporarySessionIdArg: string) => Promise<void>, signalArg?: AbortSignal): Promise<{
441
+ /**
442
+ * Retires every live session state of a project being removed. `full` follows FlexHarness's
443
+ * project removal, which ended every Flex session's project-management record it knew: a record
444
+ * still live then is ended here with its own generation and reported. `metadata-only` removes a
445
+ * project whose directory is not trusted, without FlexHarness: a document whose Flex
446
+ * project-management record is live stays FlexHarness's to end, so only AGL's own fields are
447
+ * cleared (and nothing is written when none is held); every other document ends as in `full`.
448
+ */
449
+ retireProjectSessionStates(projectIdArg: string, cleanupTemporarySessionArg: (temporarySessionIdArg: string) => Promise<void>, signalArg?: AbortSignal, modeArg?: 'full' | 'metadata-only'): Promise<{
404
450
  retiredCount: number;
405
451
  temporarySessionIds: string[];
406
452
  }>;
@@ -409,7 +455,18 @@ export declare class SmartDataAuthStore implements IAuthStore, IAuthStoreSession
409
455
  tombstoneSessionState(projectIdArg: string, sessionIdArg: IControllerRuntimeId): Promise<void>;
410
456
  private tombstoneSessionStateUnqueued;
411
457
  private applyFlexProjectManagementScratchpad;
412
- private applySessionStateTombstone;
458
+ /**
459
+ * Clears the fields of a session's state that AGL owns: its Session Intelligence exchanges, its
460
+ * model and account choice and its limit-resume plan. The Flex project-management record, its
461
+ * scratchpad mirror and the document's end are not among them.
462
+ */
463
+ private clearControllerSessionFields;
464
+ /**
465
+ * Ends a session state's life: a live Flex project-management record becomes a tombstone of its
466
+ * own generation at its next revision with the document's deletion time (the invariant 41.1.0
467
+ * asserts), the scratchpad is emptied and AGL's own fields are cleared.
468
+ */
469
+ private endSessionStateLifecycle;
413
470
  createTempPassword(ttlMsArg: number): Promise<IMintedTempPassword>;
414
471
  verifyTempPassword(passwordArg: string): Promise<{
415
472
  credentialId: string;