opencode-supertask 0.1.36 → 0.1.38

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.
@@ -48,7 +48,7 @@ interface RunLogPresentation {
48
48
  errors: string[];
49
49
  tools: string[];
50
50
  }
51
- declare function presentRunLog(log: string): RunLogPresentation;
51
+ declare function presentRunLog(log: string, includeErrors?: boolean): RunLogPresentation;
52
52
  declare const dashboardApp: Hono<hono_types.BlankEnv, hono_types.BlankSchema, "/">;
53
53
  declare const _default: {
54
54
  hostname: string;
package/dist/web/index.js CHANGED
@@ -20800,7 +20800,7 @@ function shellQuote(value) {
20800
20800
  if (/^[A-Za-z0-9_./:@%+=,-]+$/.test(value)) return value;
20801
20801
  return `'${value.replace(/'/g, `'"'"'`)}'`;
20802
20802
  }
20803
- function presentRunLog(log) {
20803
+ function presentRunLog(log, includeErrors = true) {
20804
20804
  let command = null;
20805
20805
  const textParts = [];
20806
20806
  const errors = [];
@@ -20812,7 +20812,7 @@ function presentRunLog(log) {
20812
20812
  try {
20813
20813
  parsed = recordValue(JSON.parse(trimmed));
20814
20814
  } catch {
20815
- errors.push(line);
20815
+ if (includeErrors) errors.push(line);
20816
20816
  continue;
20817
20817
  }
20818
20818
  if (!parsed) continue;
@@ -20836,7 +20836,7 @@ function presentRunLog(log) {
20836
20836
  const tool = typeof part?.tool === "string" ? part.tool : typeof parsed.tool === "string" ? parsed.tool : null;
20837
20837
  if (tool && (eventType === "tool_use" || partType === "tool")) tools.push(tool);
20838
20838
  const error = typeof parsed.error === "string" ? parsed.error : typeof part?.error === "string" ? part.error : null;
20839
- if (error) errors.push(error);
20839
+ if (error && includeErrors) errors.push(error);
20840
20840
  }
20841
20841
  return {
20842
20842
  command,
@@ -20845,8 +20845,8 @@ function presentRunLog(log) {
20845
20845
  tools
20846
20846
  };
20847
20847
  }
20848
- function renderRunLog(runId, taskName, log, locale) {
20849
- const presentation = presentRunLog(log);
20848
+ function renderRunLog(runId, taskName, log, locale, includeErrors) {
20849
+ const presentation = presentRunLog(log, includeErrors);
20850
20850
  const command = presentation.command ? `<div class="run-command"><div class="log-section-head"><strong>${t(locale, "logs.command")}</strong><button type="button" class="btn" onclick="copyRunCommand(${runId})">${icon("copy")}${t(locale, "action.copyCommand")}</button></div><div class="command-cwd">${esc(presentation.command.cwd)}</div><pre id="command-${runId}">${esc(presentation.command.command)}</pre></div>` : "";
20851
20851
  const errors = presentation.errors.length > 0 ? `<div class="run-error"><strong>${t(locale, "logs.error")}</strong><pre>${esc(presentation.errors.join("\n"))}</pre></div>` : "";
20852
20852
  const tools = presentation.tools.length > 0 ? `<div class="run-tools"><strong>${t(locale, "logs.tools")}</strong><div class="actions">${presentation.tools.map((tool) => `<span class="tag">${esc(tool)}</span>`).join("")}</div></div>` : "";
@@ -21204,7 +21204,7 @@ app.get("/runs", async (c) => {
21204
21204
  const rows = runs.map((run) => {
21205
21205
  const status = safeStatus(run.status);
21206
21206
  const resumable = isValidSessionId(run.sessionId);
21207
- const log = run.log ? renderRunLog(run.id, run.taskName, run.log, locale) : "";
21207
+ const log = run.log ? renderRunLog(run.id, run.taskName, run.log, locale, run.status !== "done") : "";
21208
21208
  return `<tr class="run-summary-row">
21209
21209
  <td class="faint" data-label="${t(locale, "table.run")}">#${run.id}</td>
21210
21210
  <td data-primary data-label="${t(locale, "table.task")}"><div class="task-name">${esc(run.taskName)} <span class="faint">#${run.taskId}</span></div>${run.model ? `<div style="margin-top:4px"><span class="tag">${esc(run.model)}</span></div>` : ""}</td>
@@ -21335,7 +21335,7 @@ app.get("/api/tasks/:id", async (c) => {
21335
21335
  const runs = await TaskRunService.listByTaskId(id);
21336
21336
  return c.json({
21337
21337
  ...task,
21338
- _resultPresentation: task.resultLog ? presentRunLog(task.resultLog) : null,
21338
+ _resultPresentation: task.resultLog ? presentRunLog(task.resultLog, task.status !== "done") : null,
21339
21339
  _runs: runs
21340
21340
  });
21341
21341
  });