@wrenautomation/aerie 0.5.0 → 0.5.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
@@ -36654,7 +36654,7 @@ function grokRunner(o = {}) {
36654
36654
  }
36655
36655
  };
36656
36656
  }
36657
- var DO_LINE = /^(done|needs-human|failed|planned) via (\S+)(?: (\S+))?: (.*)$/;
36657
+ var DO_LINE = /^(done|needs-human|failed|planned) via (\S+)(?: ([^:]+))?: (.*)$/;
36658
36658
  function autobrowseRunner(o = {}) {
36659
36659
  return {
36660
36660
  name: "autobrowse-do",
@@ -36705,6 +36705,12 @@ function apiRunner(o) {
36705
36705
  async run(t, ctx) {
36706
36706
  const { modelFromSpec } = await import("@wrenautomation/models/spec");
36707
36707
  const spec = ctx.model ?? o.spec;
36708
+ if (!spec)
36709
+ return {
36710
+ outcome: "needs-input",
36711
+ summary: "no model for the api runner",
36712
+ question: `No model for ${t.id} on the api runner: set AERIE_API_MODEL, or a route rule with a model?`
36713
+ };
36708
36714
  const m = modelFromSpec(spec, { ...process.env, ...o.env, ...ctx.env });
36709
36715
  await ctx.emit({ kind: "init", text: m.id, data: { spec, model: m.id } });
36710
36716
  try {
@@ -36749,7 +36755,7 @@ function headlessRunners(get2) {
36749
36755
  codexRunner(opt("codex")),
36750
36756
  grokRunner(opt("grok")),
36751
36757
  autobrowseRunner(opt("autobrowse")),
36752
- apiRunner({ spec: get2("AERIE_API_MODEL") ?? "openrouter" })
36758
+ apiRunner({ spec: get2("AERIE_API_MODEL") })
36753
36759
  ];
36754
36760
  return new Map(rs.map((r) => [r.name, r]));
36755
36761
  }
@@ -36838,15 +36844,17 @@ async function route(a, coord, id, by, pick2) {
36838
36844
  await coord.queueAdd([t.id], queueSpot(r));
36839
36845
  return r;
36840
36846
  }
36847
+ var RUN_FAILED = "Run failed";
36841
36848
  async function afterDecision(a, coord, d, by, pick2) {
36842
36849
  const out = [];
36850
+ const worker = d.askedBy.startsWith("runner:") && d.question.startsWith(`${RUN_FAILED} `);
36843
36851
  for (const id of d.blocks) {
36844
36852
  const t = await a.get(id);
36845
36853
  if (t?.status !== "To Do" || !await a.lastEvent(t.id, "run.start")) continue;
36846
- if (d.answer === "william") {
36854
+ if (worker && d.answer === "william") {
36847
36855
  await a.edit(t.id, { assignees: ["@william"] }, by, { why: `decision ${d.id}` });
36848
36856
  out.push({ id: t.id, lane: null });
36849
- } else if (d.answer === "session") {
36857
+ } else if (worker && d.answer === "session") {
36850
36858
  await a.log(
36851
36859
  t.id,
36852
36860
  by,
@@ -36974,7 +36982,7 @@ async function workOnce(o) {
36974
36982
  }
36975
36983
  const d2 = await store.ask(
36976
36984
  {
36977
- question: `Run failed ${fails} times on ${runner.name}: what next for ${id}?`,
36985
+ question: `${RUN_FAILED} ${fails} times on ${runner.name}: what next for ${id}?`,
36978
36986
  options: [
36979
36987
  { key: "retry", text: `run it on ${runner.name} again` },
36980
36988
  { key: "session", text: "give it to a live session" },