@wrenautomation/aerie 0.6.0 → 0.6.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/bin.js CHANGED
@@ -38027,6 +38027,7 @@ function normal(w) {
38027
38027
  return unmark(w).toLowerCase().replace(/[‘’`´]/g, "'").replace(/[“”„]/g, '"').replace(/[–—]/g, "-").replace(/\s+/g, " ").trim().replace(/^[\s"'.,;:!?-]+|[\s"'.,;:!?-]+$/g, "");
38028
38028
  }
38029
38029
  var sentences = (w) => unmark(w).split(/(?<=[.!?])\s+|\n+/).map((x) => x.trim()).filter(Boolean);
38030
+ var COVERS = 20;
38030
38031
  function check3(words, split, o) {
38031
38032
  const src = normal(words);
38032
38033
  const covered = new Uint8Array(src.length);
@@ -38059,7 +38060,7 @@ function check3(words, split, o) {
38059
38060
  from = i + n.length;
38060
38061
  let hit = 0;
38061
38062
  for (let j = i; j < i + n.length; j++) hit += covered[j] ?? 0;
38062
- if (hit / n.length < 0.5) out.missed.push(raw);
38063
+ if (hit < Math.min(n.length / 2, COVERS)) out.missed.push(raw);
38063
38064
  }
38064
38065
  return out;
38065
38066
  }
@@ -38268,10 +38269,22 @@ async function intake(a, input2, by, o = {}) {
38268
38269
  },
38269
38270
  taskIds: ids
38270
38271
  });
38271
- if (input2.route && o.coord)
38272
+ if (input2.route)
38272
38273
  for (const id of ids) {
38273
- const r = await route(a, o.coord, id, by, o.pick);
38274
- res.routed.push({ id, runner: r.runner, lane: r.lane });
38274
+ if (!o.coord)
38275
+ res.routed.push({
38276
+ id,
38277
+ runner: null,
38278
+ lane: null,
38279
+ error: "no board: route needs Postgres"
38280
+ });
38281
+ else
38282
+ try {
38283
+ const r = await route(a, o.coord, id, by, o.pick);
38284
+ res.routed.push({ id, runner: r.runner, lane: r.lane });
38285
+ } catch (e) {
38286
+ res.routed.push({ id, runner: null, lane: null, error: e.message });
38287
+ }
38275
38288
  }
38276
38289
  }
38277
38290
  return res;
@@ -38298,7 +38311,10 @@ function plain(r) {
38298
38311
  for (const s of r.failedSpans)
38299
38312
  out.push(` not filed: "${s.title}": span not in the words: "${s.span}"`);
38300
38313
  for (const m of r.missed) out.push(` missed: "${m}"`);
38301
- for (const x of r.routed) out.push(` ${x.id} \u2192 ${x.runner}${x.lane ? ` on ${x.lane}` : ""}`);
38314
+ for (const x of r.routed)
38315
+ out.push(
38316
+ x.error ? ` ${x.id} not routed: ${x.error}` : ` ${x.id} \u2192 ${x.runner}${x.lane ? ` on ${x.lane}` : ""}`
38317
+ );
38302
38318
  return `${out.join("\n")}
38303
38319
  `;
38304
38320
  }