@verax-ai/proxy 0.4.6 → 0.4.7
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/ledger.d.ts +3 -0
- package/dist/ledger.js +10 -2
- package/package.json +1 -1
package/dist/ledger.d.ts
CHANGED
|
@@ -122,6 +122,7 @@ export declare class FileLedger implements Ledger {
|
|
|
122
122
|
private readonly countedAt;
|
|
123
123
|
countsReadable: boolean;
|
|
124
124
|
private readonly heartbeatPath;
|
|
125
|
+
readonly startedAtMs: number;
|
|
125
126
|
private decisionCount;
|
|
126
127
|
private effectCount;
|
|
127
128
|
private lastDecisionMs;
|
|
@@ -210,6 +211,8 @@ export declare class FileLedger implements Ledger {
|
|
|
210
211
|
countedTimes(): number[];
|
|
211
212
|
hasPrimaryEffect(ref: string): boolean;
|
|
212
213
|
private pulse;
|
|
214
|
+
/** A running body pulses even when no decision or effect is appended. */
|
|
215
|
+
pulseHeartbeat(beat: "timer" | "row"): void;
|
|
213
216
|
private storeEffect;
|
|
214
217
|
}
|
|
215
218
|
export declare function lookupDecisionByRef(ledger: Ledger, ref: string, key?: string): Promise<DecisionIndexRow | null>;
|
package/dist/ledger.js
CHANGED
|
@@ -352,6 +352,7 @@ export class FileLedger {
|
|
|
352
352
|
countedAt = [];
|
|
353
353
|
countsReadable = true;
|
|
354
354
|
heartbeatPath;
|
|
355
|
+
startedAtMs = Date.now();
|
|
355
356
|
decisionCount = 0;
|
|
356
357
|
effectCount = 0;
|
|
357
358
|
lastDecisionMs = null;
|
|
@@ -1018,12 +1019,19 @@ export class FileLedger {
|
|
|
1018
1019
|
this.decisionCount += 1;
|
|
1019
1020
|
else
|
|
1020
1021
|
this.effectCount += 1;
|
|
1021
|
-
|
|
1022
|
+
this.pulseHeartbeat("row");
|
|
1023
|
+
}
|
|
1024
|
+
/** A running body pulses even when no decision or effect is appended. */
|
|
1025
|
+
pulseHeartbeat(beat) {
|
|
1026
|
+
this.assertOwned();
|
|
1027
|
+
writeFileAtomic(this.heartbeatPath, `${JSON.stringify({
|
|
1022
1028
|
atMs: Date.now(),
|
|
1023
1029
|
pid: process.pid,
|
|
1030
|
+
startedAtMs: this.startedAtMs,
|
|
1031
|
+
beat,
|
|
1024
1032
|
lastDecisionN: this.decisionCount,
|
|
1025
1033
|
lastEffectN: this.effectCount,
|
|
1026
|
-
})}\n
|
|
1034
|
+
})}\n`);
|
|
1027
1035
|
}
|
|
1028
1036
|
async storeEffect(row, witnessClass, resultHash, externalReceipt) {
|
|
1029
1037
|
// Never ask the body or its same-org witness to sign an external receipt.
|