@whittlelabs/sifter 0.42.1 → 0.42.2
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/bin.js +12 -5
- package/bin.js.map +2 -2
- package/package.json +1 -1
package/bin.js
CHANGED
|
@@ -68697,6 +68697,7 @@ var require_subscribe = __commonJS({
|
|
|
68697
68697
|
}
|
|
68698
68698
|
var STOPPED = Symbol("stopped");
|
|
68699
68699
|
var STREAMING_POLL_MS = 3e5;
|
|
68700
|
+
var STREAM_RETRY_MS = 3e5;
|
|
68700
68701
|
var HINT_JITTER_MS = 250;
|
|
68701
68702
|
var DECLINE_WINDOW = 25;
|
|
68702
68703
|
var DECLINED_MEMORY = 1e3;
|
|
@@ -68713,7 +68714,8 @@ var require_subscribe = __commonJS({
|
|
|
68713
68714
|
let pollAgain = false;
|
|
68714
68715
|
let hintStream = null;
|
|
68715
68716
|
let streamLive = false;
|
|
68716
|
-
|
|
68717
|
+
const streamWanted = opts.stream ?? true;
|
|
68718
|
+
let streamRefusedAt = null;
|
|
68717
68719
|
let inflight = 0;
|
|
68718
68720
|
let resolvedPoolIds = [];
|
|
68719
68721
|
const controllers = /* @__PURE__ */ new Map();
|
|
@@ -68870,8 +68872,11 @@ var require_subscribe = __commonJS({
|
|
|
68870
68872
|
schedulePoll(pollIntervalMs);
|
|
68871
68873
|
}
|
|
68872
68874
|
function openHintStream(mySession) {
|
|
68873
|
-
if (!
|
|
68875
|
+
if (!streamWanted || hintStream || typeof opts.jobsClient.openHintStream !== "function")
|
|
68874
68876
|
return;
|
|
68877
|
+
if (streamRefusedAt !== null && Date.now() - streamRefusedAt < STREAM_RETRY_MS)
|
|
68878
|
+
return;
|
|
68879
|
+
streamRefusedAt = null;
|
|
68875
68880
|
hintStream = (0, realtime_client_1.connectStream)({
|
|
68876
68881
|
open: ({ lastEventId }, signal) => opts.jobsClient.openHintStream({ ...shift ? { shift: shift.id } : {}, lastEventId, signal }),
|
|
68877
68882
|
onMessage: (message) => {
|
|
@@ -68886,9 +68891,9 @@ var require_subscribe = __commonJS({
|
|
|
68886
68891
|
return;
|
|
68887
68892
|
streamLive = status === "live";
|
|
68888
68893
|
if (status === "stopped") {
|
|
68889
|
-
|
|
68894
|
+
streamRefusedAt = Date.now();
|
|
68890
68895
|
hintStream = null;
|
|
68891
|
-
logger.debug?.("Jobs offers no hint stream; polling instead");
|
|
68896
|
+
logger.debug?.("Jobs offers no hint stream; polling instead, and asking again in five minutes");
|
|
68892
68897
|
}
|
|
68893
68898
|
if (!streamLive)
|
|
68894
68899
|
pollSoon(pollIntervalMs);
|
|
@@ -69035,6 +69040,8 @@ var require_subscribe = __commonJS({
|
|
|
69035
69040
|
}
|
|
69036
69041
|
}
|
|
69037
69042
|
async function pollOnce(mySession) {
|
|
69043
|
+
if (!hintStream && streamRefusedAt !== null)
|
|
69044
|
+
openHintStream(mySession);
|
|
69038
69045
|
let nextPollMs = streamLive ? STREAMING_POLL_MS : pollIntervalMs;
|
|
69039
69046
|
try {
|
|
69040
69047
|
const paused = holds.size > 0;
|
|
@@ -75996,7 +76003,7 @@ var import_path = require("path");
|
|
|
75996
76003
|
var import_promises = require("fs/promises");
|
|
75997
76004
|
var import_yaml = __toESM(require_dist5());
|
|
75998
76005
|
var import_shuttle = __toESM(require_dist8());
|
|
75999
|
-
var buildVersion = true ? "0.42.
|
|
76006
|
+
var buildVersion = true ? "0.42.2" : pkg.version;
|
|
76000
76007
|
var AGENT_EXECUTORS = ["claude-code", "codex", "copilot"];
|
|
76001
76008
|
var sifterBrand = {
|
|
76002
76009
|
product: {
|