sessionpipe 0.1.0 → 0.2.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/dist/run.d.ts CHANGED
@@ -10,6 +10,13 @@ export interface Job {
10
10
  ppid?: number;
11
11
  at: number;
12
12
  }
13
+ /** A job file the worker will pick up: random suffix, 0600, in a 0700 dir. */
14
+ export declare function enqueueJob(state: string, job: Job): string;
15
+ /** Jobs another worker left behind (a lost lock race, a killed worker): every
16
+ * worker sweeps the ones older than `olderThanMs` before it exits, so no event
17
+ * is lost (ground rule 4). Each is removed before it runs, so two sweepers
18
+ * never run one twice. */
19
+ export declare function sweepJobs(state: string, olderThanMs?: number, limit?: number): Promise<number>;
13
20
  export declare function log(state: string, line: string): void;
14
21
  /** <state>/facts/<harness>/<session>.json — what the machine learned about a session. */
15
22
  export declare function factsState(state: string): FactsState;
@@ -22,7 +29,12 @@ export declare function runJob(job: Job, opts?: {
22
29
  events: Event[];
23
30
  delivered: Record<string, number>;
24
31
  }>;
25
- /** Drain every sink from its cursor: this session first, then any backlog. */
32
+ /** Drain every sink from its cursor: this session first, then any backlog. Events
33
+ * from many sessions are packed into one batch of up to BATCH, so a first
34
+ * install's 400-session backfill is nine POSTs, not four hundred (the receiver's
35
+ * write limit ended the first replay at 278 events, 2026-09-28). A cursor moves
36
+ * only after its batch was acknowledged; a refused batch stops the sink for this
37
+ * run and the next worker starts from the same cursors. */
26
38
  export declare function flush(state: string, sinkConfigs: SinkConfig[], outbox: Outbox, first?: {
27
39
  harness: string;
28
40
  session: string;
package/dist/run.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAKA,OAAO,EAGL,KAAK,KAAK,EACV,KAAK,UAAU,EAMf,MAAM,EAGN,KAAK,IAAI,EACT,KAAK,UAAU,EAOhB,MAAM,mBAAmB,CAAC;AAI3B,QAAA,MAAM,OAAO,QAAkF,C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