@whittlelabs/sifter 0.42.1 → 0.42.3

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 (3) hide show
  1. package/bin.js +12 -8
  2. package/bin.js.map +2 -2
  3. package/package.json +1 -1
package/bin.js CHANGED
@@ -9811,9 +9811,6 @@ var require_seed_workflows = __commonJS({
9811
9811
  ownerClass = "org";
9812
9812
  ownerId = opts.platformOrgId;
9813
9813
  visibility = "published";
9814
- } else if ("service" in workflow.owner) {
9815
- ownerClass = "service";
9816
- ownerId = workflow.owner.service;
9817
9814
  } else {
9818
9815
  const orgId = opts.ownerSlugToOrgId[workflow.owner.orgSlug];
9819
9816
  if (orgId === void 0) {
@@ -68697,6 +68694,7 @@ var require_subscribe = __commonJS({
68697
68694
  }
68698
68695
  var STOPPED = Symbol("stopped");
68699
68696
  var STREAMING_POLL_MS = 3e5;
68697
+ var STREAM_RETRY_MS = 3e5;
68700
68698
  var HINT_JITTER_MS = 250;
68701
68699
  var DECLINE_WINDOW = 25;
68702
68700
  var DECLINED_MEMORY = 1e3;
@@ -68713,7 +68711,8 @@ var require_subscribe = __commonJS({
68713
68711
  let pollAgain = false;
68714
68712
  let hintStream = null;
68715
68713
  let streamLive = false;
68716
- let streamSupported = opts.stream ?? true;
68714
+ const streamWanted = opts.stream ?? true;
68715
+ let streamRefusedAt = null;
68717
68716
  let inflight = 0;
68718
68717
  let resolvedPoolIds = [];
68719
68718
  const controllers = /* @__PURE__ */ new Map();
@@ -68870,8 +68869,11 @@ var require_subscribe = __commonJS({
68870
68869
  schedulePoll(pollIntervalMs);
68871
68870
  }
68872
68871
  function openHintStream(mySession) {
68873
- if (!streamSupported || typeof opts.jobsClient.openHintStream !== "function")
68872
+ if (!streamWanted || hintStream || typeof opts.jobsClient.openHintStream !== "function")
68874
68873
  return;
68874
+ if (streamRefusedAt !== null && Date.now() - streamRefusedAt < STREAM_RETRY_MS)
68875
+ return;
68876
+ streamRefusedAt = null;
68875
68877
  hintStream = (0, realtime_client_1.connectStream)({
68876
68878
  open: ({ lastEventId }, signal) => opts.jobsClient.openHintStream({ ...shift ? { shift: shift.id } : {}, lastEventId, signal }),
68877
68879
  onMessage: (message) => {
@@ -68886,9 +68888,9 @@ var require_subscribe = __commonJS({
68886
68888
  return;
68887
68889
  streamLive = status === "live";
68888
68890
  if (status === "stopped") {
68889
- streamSupported = false;
68891
+ streamRefusedAt = Date.now();
68890
68892
  hintStream = null;
68891
- logger.debug?.("Jobs offers no hint stream; polling instead");
68893
+ logger.debug?.("Jobs offers no hint stream; polling instead, and asking again in five minutes");
68892
68894
  }
68893
68895
  if (!streamLive)
68894
68896
  pollSoon(pollIntervalMs);
@@ -69035,6 +69037,8 @@ var require_subscribe = __commonJS({
69035
69037
  }
69036
69038
  }
69037
69039
  async function pollOnce(mySession) {
69040
+ if (!hintStream && streamRefusedAt !== null)
69041
+ openHintStream(mySession);
69038
69042
  let nextPollMs = streamLive ? STREAMING_POLL_MS : pollIntervalMs;
69039
69043
  try {
69040
69044
  const paused = holds.size > 0;
@@ -75996,7 +76000,7 @@ var import_path = require("path");
75996
76000
  var import_promises = require("fs/promises");
75997
76001
  var import_yaml = __toESM(require_dist5());
75998
76002
  var import_shuttle = __toESM(require_dist8());
75999
- var buildVersion = true ? "0.42.1" : pkg.version;
76003
+ var buildVersion = true ? "0.42.3" : pkg.version;
76000
76004
  var AGENT_EXECUTORS = ["claude-code", "codex", "copilot"];
76001
76005
  var sifterBrand = {
76002
76006
  product: {