agl 43.0.3 → 43.0.5

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 (35) hide show
  1. package/changelog.md +18 -0
  2. package/dist_serve/bundle.js +1 -1
  3. package/dist_serve/bundle.js.map +1 -1
  4. package/dist_ts/00_commitinfo_data.js +1 -1
  5. package/dist_ts/classes.flexframedtransport.d.ts +16 -0
  6. package/dist_ts/classes.flexframedtransport.js +35 -20
  7. package/dist_ts/classes.flexservice.d.ts +7 -2
  8. package/dist_ts/classes.flexservice.js +11 -40
  9. package/dist_ts/classes.flexstore.js +4 -1
  10. package/dist_ts/classes.flexsupervisor.d.ts +47 -3
  11. package/dist_ts/classes.flexsupervisor.js +179 -32
  12. package/dist_ts/flexharness.child.js +9 -4
  13. package/dist_ts/functions.flexchildshutdown.d.ts +7 -0
  14. package/dist_ts/functions.flexchildshutdown.js +18 -1
  15. package/dist_ts_migration/index.d.ts +1 -2
  16. package/dist_ts_migration/index.js +2 -3
  17. package/dist_ts_migration/v43_flexpostharnessmigrationmarkers.d.ts +33 -0
  18. package/dist_ts_migration/v43_flexpostharnessmigrationmarkers.js +116 -0
  19. package/package.json +1 -1
  20. package/ts/00_commitinfo_data.ts +1 -1
  21. package/ts/classes.flexframedtransport.ts +42 -17
  22. package/ts/classes.flexservice.ts +9 -56
  23. package/ts/classes.flexstore.ts +6 -0
  24. package/ts/classes.flexsupervisor.ts +236 -32
  25. package/ts/flexharness.child.ts +8 -3
  26. package/ts/functions.flexchildshutdown.ts +22 -0
  27. package/ts_migration/index.ts +1 -2
  28. package/ts_migration/v43_flexpostharnessmigrationmarkers.ts +66 -0
  29. package/ts_web/00_commitinfo_data.ts +1 -1
  30. package/dist_ts_migration/classes.flexpostharnessmigrationrunner.d.ts +0 -10
  31. package/dist_ts_migration/classes.flexpostharnessmigrationrunner.js +0 -15
  32. package/dist_ts_migration/v19_flexprojectmanagement.d.ts +0 -11
  33. package/dist_ts_migration/v19_flexprojectmanagement.js +0 -21
  34. package/ts_migration/classes.flexpostharnessmigrationrunner.ts +0 -22
  35. package/ts_migration/v19_flexprojectmanagement.ts +0 -28
@@ -1,5 +1,5 @@
1
1
  import { FlexIpcNotSentError } from './classes.flexframedtransport.js';
2
- import type { IFailureDescription } from './functions.failuredescription.js';
2
+ import { type IFailureDescription } from './functions.failuredescription.js';
3
3
  import { type IFlexServiceConfiguration, type IFlexServiceStatus, type TFlexChildEvent, type TFlexHostRequestMethod, type TFlexHostRequest, type TFlexHostResponse, type TFlexRequest, type TFlexRequestMethod, type TFlexResponse } from './interfaces.flexipc.js';
4
4
  export interface IFlexSupervisorStatus {
5
5
  state: IFlexServiceStatus['state'];
@@ -23,7 +23,21 @@ export interface IFlexSupervisorLogEntry {
23
23
  line: string;
24
24
  truncated: boolean;
25
25
  }
26
+ /** An error of a child's log pipe, or of a started child process, the supervisor recorded and ignored. */
27
+ export interface IFlexSupervisorIgnoredError {
28
+ source: 'stdout' | 'stderr' | 'process';
29
+ /** The child generation, counted from 1 per supervisor, whose pipe or process the error came from. */
30
+ generation: number;
31
+ code?: string;
32
+ timestamp: number;
33
+ }
26
34
  export interface IFlexSupervisorOptions {
35
+ /**
36
+ * Writes one record to the controller log; the controller's stderr (`console.error`) unless a test
37
+ * captures it. Each child stdout and stderr line arrives here as it is read, tagged with its child
38
+ * generation, credential-redacted and bounded, and so does every abnormal child exit.
39
+ */
40
+ writeControllerLog?: (lineArg: string) => void;
27
41
  onChildExitObserved?: (exitArg: IFlexSupervisorExit) => void;
28
42
  onChildExit?: (exitArg: IFlexSupervisorExit) => void;
29
43
  cancellationGraceTimeoutMs?: number;
@@ -87,8 +101,10 @@ export declare class FlexSupervisor {
87
101
  private readonly settledHostRequestIds;
88
102
  private readonly eventListeners;
89
103
  private readonly logs;
90
- private readonly stdoutAccumulator;
91
- private readonly stderrAccumulator;
104
+ private readonly ignoredChildErrors;
105
+ /** Child generations observed so far; the controller log names each child by its number. */
106
+ private childGenerations;
107
+ private readonly writeControllerLog;
92
108
  private readonly cancellationGraceTimeoutMs;
93
109
  private readonly childTaskDrainTimeoutMs;
94
110
  /** The writer identity of the current child generation, until its exit is confirmed. */
@@ -98,6 +114,8 @@ export declare class FlexSupervisor {
98
114
  constructor(options?: IFlexSupervisorOptions);
99
115
  getStatus(): IFlexSupervisorStatus;
100
116
  getLogSnapshot(): IFlexSupervisorLogEntry[];
117
+ /** The child log-pipe and started-process errors the supervisor ignored, oldest first, the last 16. */
118
+ getIgnoredChildErrors(): IFlexSupervisorIgnoredError[];
101
119
  ownsChildPeer(peerIdArg: string): boolean;
102
120
  ownsBrowserPeer(peerIdArg: string): boolean;
103
121
  ownsHostPeer(peerIdArg: string): boolean;
@@ -124,6 +142,14 @@ export declare class FlexSupervisor {
124
142
  private performStop;
125
143
  private terminateOwnedChild;
126
144
  private observeChild;
145
+ /**
146
+ * Writes an exit the supervisor did not ask for, or one with a failure code or a signal, to the
147
+ * controller log: the generation, its exit code and signal or why it never started, and the pipe
148
+ * and process errors of that generation the supervisor ignored so far.
149
+ */
150
+ private logAbnormalExit;
151
+ private describeChildGeneration;
152
+ private recordIgnoredChildError;
127
153
  private reapOrphanedGroup;
128
154
  private reapRetainedProcessGroup;
129
155
  private notifyChildExitCleanup;
@@ -144,6 +170,24 @@ export declare class FlexSupervisor {
144
170
  private rememberSettledHostRequest;
145
171
  private normalizeDeadline;
146
172
  private consumeLog;
173
+ private consumeLogText;
147
174
  private flushLog;
148
175
  private addLog;
176
+ /**
177
+ * Writes a child line to the controller log as it arrives, within the generation's rate window.
178
+ * Lines over the window's budget are counted and the last `supervisorControllerLogSuppressedTailLines`
179
+ * of each stream kept as buffered, not redacted; they are reported when the next window opens or
180
+ * the generation's pipes closed.
181
+ */
182
+ private writeChildLine;
183
+ /**
184
+ * Writes one child line to the controller log, live or from a suppression tail: at most
185
+ * `supervisorControllerLogLineBytes`, control characters spaced out and every credential hidden
186
+ * before the cut (`sanitizeFailureText`, then `redactAndBound`), so the cut never keeps part of a
187
+ * credential. The input is the buffered line, at most 8 KiB, whose unread rest lies far beyond the
188
+ * kept head.
189
+ */
190
+ private emitChildLine;
191
+ /** Writes the rate window's suppression record, then its stdout tail and its stderr tail, and empties them. */
192
+ private reportSuppressedLines;
149
193
  }