primcli 1.54.0 → 1.55.1
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/{api-command-C_Fn9Zef.js → api-command-0FiEAuQi.js} +31 -29
- package/dist/{cli-config-DGrZCUfw.js → cli-config-DMszFbGn.js} +6 -9
- package/dist/{json-output-Cf-GFeff.js → json-output-CEskSQJi.js} +1 -1
- package/dist/{listen-background-CMfxkeVP.js → listen-background--0peztKE.js} +8 -7
- package/dist/{machine-session-Do3mw2_w.js → machine-session-CufQfBvp.js} +57 -46
- package/dist/{notify-session-DhV0DLAA.js → notify-session-BGzeKcQO.js} +12 -8
- package/dist/oclif/auto-signal-worker.js +3 -3
- package/dist/oclif/auto-signals.js +9 -9
- package/dist/oclif/index.js +424 -66
- package/dist/oclif/listen-supervisor.js +1 -1
- package/dist/oclif/proxy-auto-detect.js +1 -1
- package/dist/oclif/receiver-heal.js +6 -5
- package/dist/oclif/root-signup-hint.js +7 -4
- package/dist/{repeats-D2xtLium-DmtVD6ol.js → repeats-x4QM2yoG-De3MV3st.js} +92 -34
- package/dist/{scoped-chat-BrLq4dXH.js → scoped-chat-C7cpIxVS.js} +4 -3
- package/dist/{shared-mail-files-SPPcis9g.js → shared-mail-files-MwlVE90c.js} +2 -1
- package/dist/{shared-mail-watch-CWhpfJ0N.js → shared-mail-watch-DtKpsgg8.js} +1 -1
- package/dist/{signal-command-CqfODMCp.js → signal-command-COQff2Vq.js} +23 -343
- package/package.json +16 -16
- package/dist/rolldown-runtime-CNZpIYwj.js +0 -33
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as readMailJson, h as writeMailJson, i as mailId, l as privateMailDirectory, r as mailAddress } from "../shared-mail-files-
|
|
2
|
-
import { a as scopedChatSenderTrust, n as isPlainChatReply } from "../scoped-chat-
|
|
1
|
+
import { d as readMailJson, h as writeMailJson, i as mailId, l as privateMailDirectory, r as mailAddress } from "../shared-mail-files-MwlVE90c.js";
|
|
2
|
+
import { a as scopedChatSenderTrust, n as isPlainChatReply } from "../scoped-chat-C7cpIxVS.js";
|
|
3
3
|
import { existsSync, readFileSync, readdirSync, unlinkSync, writeFileSync } from "node:fs";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
5
5
|
import { join } from "node:path";
|
|
@@ -25,7 +25,7 @@ const AUTO_WORKING_EXPIRES_SECONDS = 55;
|
|
|
25
25
|
/** Renew well before expiry so the indicator does not flicker off. */
|
|
26
26
|
const AUTO_WORKING_RENEW_MS = 4e4;
|
|
27
27
|
/** Stop renewing after this long even if no answer was seen. */
|
|
28
|
-
const AUTO_WORKING_CAP_MS =
|
|
28
|
+
const AUTO_WORKING_CAP_MS = 9e5;
|
|
29
29
|
/**
|
|
30
30
|
* A renewal in flight is never older than this: the signal send and its
|
|
31
31
|
* reconciliation each abort after 5 seconds. Past it the marker is stale.
|
|
@@ -102,7 +102,7 @@ function emailDirectory(configDir, emailId) {
|
|
|
102
102
|
}
|
|
103
103
|
function parseClaim(value) {
|
|
104
104
|
const row = value;
|
|
105
|
-
if (
|
|
105
|
+
if (row?.version !== 1 || typeof row.profile !== "string" || !profilePattern.test(row.profile) || row.thread_id !== null && typeof row.thread_id !== "string") return null;
|
|
106
106
|
try {
|
|
107
107
|
return {
|
|
108
108
|
version: 1,
|
|
@@ -193,8 +193,8 @@ function readStop(configDir, emailId) {
|
|
|
193
193
|
}
|
|
194
194
|
function readWorkingLease(configDir, emailId) {
|
|
195
195
|
try {
|
|
196
|
-
const row = readMailJson(leasePath(configDir, emailId),
|
|
197
|
-
if (
|
|
196
|
+
const row = readMailJson(leasePath(configDir, emailId), 65536);
|
|
197
|
+
if (row?.version !== 1 || typeof row.profile !== "string" || !profilePattern.test(row.profile) || typeof row.started_at !== "number" || !Number.isFinite(row.started_at) || row.stopped_at !== null && typeof row.stopped_at !== "number" || !Array.isArray(row.signal_sent_ids)) return null;
|
|
198
198
|
const stop = readStop(configDir, emailId);
|
|
199
199
|
return {
|
|
200
200
|
version: 1,
|
|
@@ -384,7 +384,7 @@ function sendingInFlight(configDir, emailId) {
|
|
|
384
384
|
* A stopped lease stays indexed this long, so a later answer to the same
|
|
385
385
|
* sender can still find it and hold its stop against a refused earlier one.
|
|
386
386
|
*/
|
|
387
|
-
const STOPPED_INDEX_MS =
|
|
387
|
+
const STOPPED_INDEX_MS = 6e5;
|
|
388
388
|
function indexedLeases(configDir, now) {
|
|
389
389
|
let entries;
|
|
390
390
|
try {
|
|
@@ -395,7 +395,7 @@ function indexedLeases(configDir, now) {
|
|
|
395
395
|
return entries.flatMap((entry) => {
|
|
396
396
|
if (!/^[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}$/.test(entry)) return [];
|
|
397
397
|
const lease = readWorkingLease(configDir, entry);
|
|
398
|
-
if (!lease || lease.stopped_at !== null && now() - lease.stopped_at >= STOPPED_INDEX_MS || now() - lease.started_at >=
|
|
398
|
+
if (!lease || lease.stopped_at !== null && now() - lease.stopped_at >= STOPPED_INDEX_MS || now() - lease.started_at >= 18e5) {
|
|
399
399
|
unmarkActive(configDir, entry);
|
|
400
400
|
return [];
|
|
401
401
|
}
|
|
@@ -577,7 +577,7 @@ function renewerAlive(configDir, emailId) {
|
|
|
577
577
|
try {
|
|
578
578
|
const value = JSON.parse(readFileSync(renewerPath(configDir, emailId), "utf8"));
|
|
579
579
|
if (typeof value.pid !== "number" || typeof value.at !== "number") return false;
|
|
580
|
-
if (Date.now() - value.at >
|
|
580
|
+
if (Date.now() - value.at > 8e4) return false;
|
|
581
581
|
process.kill(value.pid, 0);
|
|
582
582
|
return true;
|
|
583
583
|
} catch {
|