opencode-supertask 0.1.37 → 0.1.39
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/CHANGELOG.md +19 -0
- package/README.md +5 -5
- package/dist/cli/index.js +123 -70
- package/dist/cli/index.js.map +1 -1
- package/dist/gateway/index.js +7 -7
- package/dist/gateway/index.js.map +1 -1
- package/dist/plugin/supertask.js +322 -8
- package/dist/plugin/supertask.js.map +1 -1
- package/dist/web/index.d.ts +1 -1
- package/dist/web/index.js +7 -7
- package/dist/web/index.js.map +1 -1
- package/package.json +1 -1
package/dist/gateway/index.js
CHANGED
|
@@ -22238,7 +22238,7 @@ function shellQuote(value) {
|
|
|
22238
22238
|
if (/^[A-Za-z0-9_./:@%+=,-]+$/.test(value)) return value;
|
|
22239
22239
|
return `'${value.replace(/'/g, `'"'"'`)}'`;
|
|
22240
22240
|
}
|
|
22241
|
-
function presentRunLog(log) {
|
|
22241
|
+
function presentRunLog(log, includeErrors = true) {
|
|
22242
22242
|
let command = null;
|
|
22243
22243
|
const textParts = [];
|
|
22244
22244
|
const errors = [];
|
|
@@ -22250,7 +22250,7 @@ function presentRunLog(log) {
|
|
|
22250
22250
|
try {
|
|
22251
22251
|
parsed = recordValue(JSON.parse(trimmed));
|
|
22252
22252
|
} catch {
|
|
22253
|
-
errors.push(line);
|
|
22253
|
+
if (includeErrors) errors.push(line);
|
|
22254
22254
|
continue;
|
|
22255
22255
|
}
|
|
22256
22256
|
if (!parsed) continue;
|
|
@@ -22274,7 +22274,7 @@ function presentRunLog(log) {
|
|
|
22274
22274
|
const tool = typeof part?.tool === "string" ? part.tool : typeof parsed.tool === "string" ? parsed.tool : null;
|
|
22275
22275
|
if (tool && (eventType === "tool_use" || partType === "tool")) tools.push(tool);
|
|
22276
22276
|
const error = typeof parsed.error === "string" ? parsed.error : typeof part?.error === "string" ? part.error : null;
|
|
22277
|
-
if (error) errors.push(error);
|
|
22277
|
+
if (error && includeErrors) errors.push(error);
|
|
22278
22278
|
}
|
|
22279
22279
|
return {
|
|
22280
22280
|
command,
|
|
@@ -22283,8 +22283,8 @@ function presentRunLog(log) {
|
|
|
22283
22283
|
tools
|
|
22284
22284
|
};
|
|
22285
22285
|
}
|
|
22286
|
-
function renderRunLog(runId, taskName, log, locale) {
|
|
22287
|
-
const presentation = presentRunLog(log);
|
|
22286
|
+
function renderRunLog(runId, taskName, log, locale, includeErrors) {
|
|
22287
|
+
const presentation = presentRunLog(log, includeErrors);
|
|
22288
22288
|
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>` : "";
|
|
22289
22289
|
const errors = presentation.errors.length > 0 ? `<div class="run-error"><strong>${t(locale, "logs.error")}</strong><pre>${esc(presentation.errors.join("\n"))}</pre></div>` : "";
|
|
22290
22290
|
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>` : "";
|
|
@@ -22732,7 +22732,7 @@ var init_web = __esm({
|
|
|
22732
22732
|
const rows = runs.map((run) => {
|
|
22733
22733
|
const status = safeStatus(run.status);
|
|
22734
22734
|
const resumable = isValidSessionId(run.sessionId);
|
|
22735
|
-
const log = run.log ? renderRunLog(run.id, run.taskName, run.log, locale) : "";
|
|
22735
|
+
const log = run.log ? renderRunLog(run.id, run.taskName, run.log, locale, run.status !== "done") : "";
|
|
22736
22736
|
return `<tr class="run-summary-row">
|
|
22737
22737
|
<td class="faint" data-label="${t(locale, "table.run")}">#${run.id}</td>
|
|
22738
22738
|
<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>
|
|
@@ -22863,7 +22863,7 @@ var init_web = __esm({
|
|
|
22863
22863
|
const runs = await TaskRunService.listByTaskId(id);
|
|
22864
22864
|
return c.json({
|
|
22865
22865
|
...task,
|
|
22866
|
-
_resultPresentation: task.resultLog ? presentRunLog(task.resultLog) : null,
|
|
22866
|
+
_resultPresentation: task.resultLog ? presentRunLog(task.resultLog, task.status !== "done") : null,
|
|
22867
22867
|
_runs: runs
|
|
22868
22868
|
});
|
|
22869
22869
|
});
|