specrails-desktop 2.43.2 → 2.44.0
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/README.md +1 -1
- package/client/dist/assets/{ActivityFeedPage-C7XJ5-bJ.js → ActivityFeedPage-CG2fhd_k.js} +1 -1
- package/client/dist/assets/{AgentBrowserCapture-C_WpXceT.js → AgentBrowserCapture-C6BVsTfo.js} +1 -1
- package/client/dist/assets/{AgentModeAnalyticsPane-PEZKjyZS.js → AgentModeAnalyticsPane-90q1FOYY.js} +2 -2
- package/client/dist/assets/{AgentModeCodePane-D_Xcq5t5.js → AgentModeCodePane-CzNPXJND.js} +2 -2
- package/client/dist/assets/{AgentModeJobsPane-CDSkOuNP.js → AgentModeJobsPane-CS4XPM5K.js} +1 -1
- package/client/dist/assets/{AgentsPage-D577NzIM.js → AgentsPage-DgF8yxlz.js} +1 -1
- package/client/dist/assets/{AnalyticsPage-C6ZZI_zg.js → AnalyticsPage-BZRZpWTe.js} +1 -1
- package/client/dist/assets/{CodePage-B5z5oLnP.js → CodePage-CobZpY2J.js} +1 -1
- package/client/dist/assets/{DesktopAnalyticsPage-D_V9RuGg.js → DesktopAnalyticsPage-B75I8Hyl.js} +1 -1
- package/client/dist/assets/{DocsDialog-Beg82MEe.js → DocsDialog-AEU1MV8y.js} +1 -1
- package/client/dist/assets/{DocsPage-BkE4m4wp.js → DocsPage-Dn2j2nSl.js} +1 -1
- package/client/dist/assets/{ExportDropdown-ophapHrT.js → ExportDropdown-Xvbax18F.js} +1 -1
- package/client/dist/assets/InteractiveJobComposer-COH-v0lE.js +19 -0
- package/client/dist/assets/{JobDetailModal-BCxue_Do.js → JobDetailModal-CyFzkOM-.js} +1 -1
- package/client/dist/assets/{JobDetailPage-_rIDpNfo.js → JobDetailPage-CAILeuTY.js} +1 -1
- package/client/dist/assets/{JobsPage-C6xcijbs.js → JobsPage-CzOmMhkp.js} +1 -1
- package/client/dist/assets/{LoopBuilderPage-A-Mt6EjT.js → LoopBuilderPage-_Snk4Cv7.js} +1 -1
- package/client/dist/assets/{LoopPreviewModal-DqHiG4Dt.js → LoopPreviewModal-C2yekwCg.js} +1 -1
- package/client/dist/assets/{LoopsPage-B-ketPET.js → LoopsPage-C4GXI81g.js} +1 -1
- package/client/dist/assets/{MinimizedChatsContext-Deg39peL.js → MinimizedChatsContext-0mMk-eoH.js} +1 -1
- package/client/dist/assets/{PluginsPage-Dn2jPvJL.js → PluginsPage-pPmHG9nI.js} +1 -1
- package/client/dist/assets/{ProjectSettingsDialog-CVTj4VLt.js → ProjectSettingsDialog-Bcsq5o0U.js} +1 -1
- package/client/dist/assets/{RepositoryDeliveries-IiQCcndQ.js → RepositoryDeliveries-DJTjRht9.js} +1 -1
- package/client/dist/assets/{RepositoryScopeSelector-D-RCaknl.js → RepositoryScopeSelector-CvOfpd2g.js} +1 -1
- package/client/dist/assets/{ReviewPacketPage-BBd617OM.js → ReviewPacketPage-BPG3cVpM.js} +1 -1
- package/client/dist/assets/{TemplatePreviewModal-COHFkUS4.js → TemplatePreviewModal-Dx_3cTQN.js} +1 -1
- package/client/dist/assets/{TicketDetailModalContext-BNa1mdXq.js → TicketDetailModalContext-0sPSvSmT.js} +1 -1
- package/client/dist/assets/{Trans-SnMX4MhW.js → Trans-BrG0crRZ.js} +1 -1
- package/client/dist/assets/{formatDistanceToNow-DSj5DprF.js → formatDistanceToNow-CEH5-6MR.js} +1 -1
- package/client/dist/assets/{getTimezoneOffsetInMilliseconds-YhD8rIEs.js → getTimezoneOffsetInMilliseconds-C4NbLIYo.js} +1 -1
- package/client/dist/assets/{index-m5pKr1T6.js → index-BIEV2BG8.js} +6 -6
- package/client/dist/assets/{index-D5n_jg_I.css → index-Bfj8HvX1.css} +1 -1
- package/client/dist/assets/{jira-api-CSCqGr-Q.js → jira-api-BuMzFZx1.js} +1 -1
- package/client/dist/assets/{jobs-BS6RTurf.js → jobs-5PQJbdOf.js} +1 -1
- package/client/dist/assets/{jobs-CezU69AE.js → jobs-B2B08Oy9.js} +1 -1
- package/client/dist/assets/{jobs-ClFJae0s.js → jobs-BJZtBbwb.js} +1 -1
- package/client/dist/assets/{jobs-BTT0Bsks.js → jobs-BlWEsQb7.js} +1 -1
- package/client/dist/assets/{jobs-DJSFIFVy.js → jobs-ConfD8xD.js} +1 -1
- package/client/dist/assets/jobs-DMPU64ms.js +1 -0
- package/client/dist/assets/{jobs-DhgGr8vm.js → jobs-DojASiTp.js} +1 -1
- package/client/dist/assets/{jobs-B8rrzfyZ.js → jobs-kVHkNpB-.js} +1 -1
- package/client/dist/assets/{project-repositories-DYhTvwQ1.js → project-repositories-CAW6v3SO.js} +1 -1
- package/client/dist/assets/{spending-BqbdPm_4.js → spending-DI73ic0T.js} +1 -1
- package/client/dist/assets/{useDesktop-RSMTyy7V.js → useDesktop-DA-nfO01.js} +1 -1
- package/client/dist/assets/{useSharedWebSocket-BOdS5_Iz.js → useSharedWebSocket-D-czsPTl.js} +2 -2
- package/client/dist/index.html +15 -15
- package/docs/README.md +6 -1
- package/docs/agents/README.md +13 -0
- package/docs/agents/mcp.md +103 -0
- package/docs/guide/de/integrations/5-mcp-server.md +2 -0
- package/docs/guide/en/integrations/5-mcp-server.md +3 -30
- package/docs/guide/en/pipeline/3-batch-implement-and-multi-feature.md +29 -0
- package/docs/guide/en/settings/3-pipeline-telemetry-and-diagnostics.md +9 -0
- package/docs/guide/es/integrations/5-mcp-server.md +3 -30
- package/docs/guide/es/pipeline/3-batch-implement-and-multi-feature.md +30 -0
- package/docs/guide/es/settings/3-pipeline-telemetry-and-diagnostics.md +10 -0
- package/docs/guide/fr/integrations/5-mcp-server.md +2 -0
- package/docs/guide/it/integrations/5-mcp-server.md +2 -0
- package/docs/guide/ja/integrations/5-mcp-server.md +2 -0
- package/docs/guide/pt/integrations/5-mcp-server.md +2 -0
- package/docs/guide/zh/integrations/5-mcp-server.md +2 -0
- package/docs/mcp.md +18 -48
- package/package.json +1 -1
- package/server/dist/core-completion.js +58 -0
- package/server/dist/core-execution.js +2 -1
- package/server/dist/loop-executors.js +15 -2
- package/server/dist/loop-graph.js +2 -1
- package/server/dist/loop-run-manager.js +18 -1
- package/client/dist/assets/InteractiveJobComposer-wBBBNaJn.js +0 -19
- package/client/dist/assets/jobs-DzMjUcaN.js +0 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseCoreCompletion = parseCoreCompletion;
|
|
4
|
+
exports.readCoreCompletion = readCoreCompletion;
|
|
5
|
+
const node_child_process_1 = require("node:child_process");
|
|
6
|
+
const node_fs_1 = require("node:fs");
|
|
7
|
+
const node_path_1 = require("node:path");
|
|
8
|
+
const node_util_1 = require("node:util");
|
|
9
|
+
const path_resolver_1 = require("./path-resolver");
|
|
10
|
+
const obj = (value) => value !== null && typeof value === 'object' && !Array.isArray(value) ? value : null;
|
|
11
|
+
const strings = (value) => Array.isArray(value) && value.every(item => typeof item === 'string');
|
|
12
|
+
const count = (value) => typeof value === 'number' && Number.isFinite(value) && value >= 0 ? value : null;
|
|
13
|
+
/** Parse only runtime-owned status, never the model's prose or stdout JSON. */
|
|
14
|
+
function parseCoreCompletion(value, runId) {
|
|
15
|
+
const status = obj(value), completion = obj(status?.completion);
|
|
16
|
+
if (status?.schemaVersion !== 1 || status.runId !== runId || typeof status.change !== 'string' || !completion)
|
|
17
|
+
return null;
|
|
18
|
+
const enums = { implementation: ['complete', 'incomplete'], validation: ['verified', 'with-exceptions', 'pending', 'blocked'], archive: ['pending', 'running', 'done', 'blocked', 'failed', 'skipped'], delivery: ['pending-host', 'complete', 'pending'] };
|
|
19
|
+
if (Object.entries(enums).some(([key, values]) => !values.includes(String(completion[key]))) || !strings(completion.reasons))
|
|
20
|
+
return null;
|
|
21
|
+
const acceptance = obj(status.acceptance), receipt = obj(acceptance?.receipt);
|
|
22
|
+
// Even a well-shaped summary cannot claim verified with invalid backing evidence.
|
|
23
|
+
if (['verified', 'with-exceptions'].includes(String(completion.validation)) && (acceptance?.valid !== true || obj(status.verification)?.valid !== true || obj(obj(status.phases)?.reviewer)?.status !== 'done'))
|
|
24
|
+
return null;
|
|
25
|
+
const exceptions = [];
|
|
26
|
+
for (const raw of Array.isArray(receipt?.criteria) ? receipt.criteria : []) {
|
|
27
|
+
const row = obj(raw), exception = obj(row?.exception);
|
|
28
|
+
if (row?.status === 'exception' && typeof row.requirement === 'string' && exception && ['reason', 'impact', 'acceptedBy', 'approvalEvidence'].every(key => typeof exception[key] === 'string')) {
|
|
29
|
+
exceptions.push({ requirement: row.requirement, reason: exception.reason, impact: exception.impact, acceptedBy: exception.acceptedBy, approvalEvidence: exception.approvalEvidence });
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
const checks = [];
|
|
33
|
+
for (const raw of Array.isArray(receipt?.checks) ? receipt.checks : []) {
|
|
34
|
+
const check = obj(raw);
|
|
35
|
+
if (check && ['name', 'status', 'scope', 'limitations'].every(key => typeof check[key] === 'string') && typeof check.required === 'boolean' && strings(check.evidence))
|
|
36
|
+
checks.push(check);
|
|
37
|
+
}
|
|
38
|
+
return { completion: completion, recordedAt: new Date().toISOString(), change: status.change,
|
|
39
|
+
exceptions, checks, findings: strings(receipt?.findings) ? receipt.findings : [],
|
|
40
|
+
phases: Object.entries(obj(status.phases) ?? {}).flatMap(([name, raw]) => {
|
|
41
|
+
const phase = obj(raw);
|
|
42
|
+
return phase && typeof phase.status === 'string' ? [{ name, status: phase.status, durationMs: count(phase.durationMs), attempts: count(phase.attempts) }] : [];
|
|
43
|
+
}), };
|
|
44
|
+
}
|
|
45
|
+
async function readCoreCompletion(input) {
|
|
46
|
+
const runtime = (0, node_path_1.join)(input.cwd, '.specrails', 'runtime', 'pipeline.mjs');
|
|
47
|
+
if (!(0, node_fs_1.existsSync)(runtime))
|
|
48
|
+
return null;
|
|
49
|
+
try {
|
|
50
|
+
const { stdout } = await (0, node_util_1.promisify)(node_child_process_1.execFile)((0, path_resolver_1.resolveBundledNodeExe)() ?? process.execPath, [runtime, 'status', '--context', input.contextPath], {
|
|
51
|
+
cwd: input.cwd, env: input.env, encoding: 'utf8', timeout: 15_000, maxBuffer: 4 * 1024 * 1024, windowsHide: true,
|
|
52
|
+
});
|
|
53
|
+
return parseCoreCompletion(JSON.parse(stdout), input.runId);
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -43,10 +43,11 @@ function prepareCoreExecution(input) {
|
|
|
43
43
|
throw new Error('Core artifact repository is outside the run scope');
|
|
44
44
|
const rawTickets = run.spec?.tickets?.length ? run.spec.tickets : run.spec ? [{
|
|
45
45
|
id: run.spec.id ?? run.spec.ticketIds?.[0] ?? 'goal', title: run.spec.title,
|
|
46
|
-
description: run.spec.description, repositoryIds: run.spec.repositoryIds,
|
|
46
|
+
description: run.spec.description, acceptanceCriteria: run.spec.acceptanceCriteria, repositoryIds: run.spec.repositoryIds,
|
|
47
47
|
}] : run.goal ? [{ id: 'goal', title: 'Loop goal', description: run.goal }] : [];
|
|
48
48
|
const specs = rawTickets.map(ticket => ({
|
|
49
49
|
id: ticket.id, title: ticket.title ?? '', description: ticket.description ?? '',
|
|
50
|
+
...(ticket.acceptanceCriteria ? { acceptanceCriteria: [...ticket.acceptanceCriteria] } : {}),
|
|
50
51
|
...(ticket.repositoryIds ? { repositoryIds: [...ticket.repositoryIds] } : {}),
|
|
51
52
|
}));
|
|
52
53
|
if (specs.some(spec => spec.repositoryIds?.some(id => !repositories.some(repo => repo.id === id)))) {
|
|
@@ -9,6 +9,7 @@ exports.createLoopExecutors = createLoopExecutors;
|
|
|
9
9
|
* from coverage; the engine's traversal/decision logic is unit-tested against
|
|
10
10
|
* fake executors in `loop-run-manager.test.ts`.
|
|
11
11
|
*/
|
|
12
|
+
const core_completion_1 = require("./core-completion");
|
|
12
13
|
const core_execution_1 = require("./core-execution");
|
|
13
14
|
const codex_spawn_1 = require("./plugins/codex-spawn");
|
|
14
15
|
const node_child_process_1 = require("node:child_process");
|
|
@@ -161,7 +162,13 @@ function createLoopExecutors(opts = {}) {
|
|
|
161
162
|
return env;
|
|
162
163
|
}
|
|
163
164
|
};
|
|
165
|
+
const completionContexts = new Map();
|
|
164
166
|
return {
|
|
167
|
+
async readCoreCompletion(runId) {
|
|
168
|
+
const context = completionContexts.get(runId);
|
|
169
|
+
completionContexts.delete(runId);
|
|
170
|
+
return context ? (0, core_completion_1.readCoreCompletion)(context) : null;
|
|
171
|
+
},
|
|
165
172
|
// Cheap working-tree fingerprint for the engine's non-convergence guard:
|
|
166
173
|
// HEAD, tracked diffs and untracked file contents, hashed. Status/path names
|
|
167
174
|
// alone stay identical while a fixer keeps improving the same files.
|
|
@@ -266,6 +273,9 @@ function createLoopExecutors(opts = {}) {
|
|
|
266
273
|
// `is_error: true` — a usage/rate-limit notice returned AS the reply).
|
|
267
274
|
let resultIsError = false;
|
|
268
275
|
let liveBackgroundTasks = [];
|
|
276
|
+
const providerEnv = (0, runtime_1.buildProviderEnv)(adapter, buildOpts, stepEnv);
|
|
277
|
+
if (core && coreRun)
|
|
278
|
+
completionContexts.set(coreRun.runId, { cwd, contextPath: core.contextPath, env: providerEnv, runId: coreRun.runId });
|
|
269
279
|
const effectiveIdleTimeoutMs = idleTimeoutMs ?? inactivityTimeoutMs();
|
|
270
280
|
const wallStartedAt = Date.now();
|
|
271
281
|
const res = await (0, spawn_lifecycle_1.runAiCliInvocation)({
|
|
@@ -273,7 +283,7 @@ function createLoopExecutors(opts = {}) {
|
|
|
273
283
|
action,
|
|
274
284
|
buildOpts,
|
|
275
285
|
cwd,
|
|
276
|
-
env:
|
|
286
|
+
env: providerEnv,
|
|
277
287
|
// 0 ⇒ watchdog disabled (factory loops run untimed; the loop's
|
|
278
288
|
// maxIterations / cost cap remain the runaway guards).
|
|
279
289
|
timeoutMs: (aiStepTimeoutMs ?? AI_STEP_TIMEOUT_MS) > 0 ? (aiStepTimeoutMs ?? AI_STEP_TIMEOUT_MS) : undefined,
|
|
@@ -463,10 +473,13 @@ function createLoopExecutors(opts = {}) {
|
|
|
463
473
|
extraArgs,
|
|
464
474
|
};
|
|
465
475
|
const args = adapter.buildArgs('chat-stream', buildOpts);
|
|
476
|
+
const providerEnv = (0, runtime_1.buildProviderEnv)(adapter, buildOpts, stepEnv);
|
|
477
|
+
if (core && coreRun)
|
|
478
|
+
completionContexts.set(coreRun.runId, { cwd, contextPath: core.contextPath, env: providerEnv, runId: coreRun.runId });
|
|
466
479
|
const effectiveIdleTimeoutMs = idleTimeoutMs ?? inactivityTimeoutMs();
|
|
467
480
|
return {
|
|
468
481
|
adapter,
|
|
469
|
-
spec: { binary: adapter.binary, args, cwd, env:
|
|
482
|
+
spec: { binary: adapter.binary, args, cwd, env: providerEnv },
|
|
470
483
|
// The loop's ai-step timeout bounds the WHOLE step, interactive
|
|
471
484
|
// included. 0 ⇒ unbounded (the engine skips arming the step timer).
|
|
472
485
|
...(core?.promptPrefix ? { promptPrefix: core.promptPrefix } : {}),
|
|
@@ -227,9 +227,10 @@ function interpolateSpec(text, spec) {
|
|
|
227
227
|
ticketIds: spec.ticketIds,
|
|
228
228
|
title: spec.title,
|
|
229
229
|
description: spec.description,
|
|
230
|
+
acceptanceCriteria: spec.acceptanceCriteria,
|
|
230
231
|
repositoryIds: spec.repositoryIds,
|
|
231
232
|
openspecChangeName: changeName || undefined,
|
|
232
|
-
tickets: spec.tickets?.map(ticket => ({ id: ticket.id, title: ticket.title, description: ticket.description, repositoryIds: ticket.repositoryIds })),
|
|
233
|
+
tickets: spec.tickets?.map(ticket => ({ id: ticket.id, title: ticket.title, description: ticket.description, acceptanceCriteria: ticket.acceptanceCriteria, repositoryIds: ticket.repositoryIds })),
|
|
233
234
|
}, null, 2);
|
|
234
235
|
if (scope === '{}')
|
|
235
236
|
return '';
|
|
@@ -1615,6 +1615,21 @@ class LoopRunManager {
|
|
|
1615
1615
|
}
|
|
1616
1616
|
console.log(`[loop] settle run=${runId} outcome=${outcome} iterations=${iteration} ` +
|
|
1617
1617
|
(usageTelemetryAvailable ? `cost=$${totalCost.toFixed(4)}` : 'usage=unavailable'));
|
|
1618
|
+
// Execution and acceptance are separate facts. Persist the runtime's own
|
|
1619
|
+
// terminal snapshot alongside counters so history does not depend on prose.
|
|
1620
|
+
let coreCompletion = null;
|
|
1621
|
+
try {
|
|
1622
|
+
coreCompletion = await this.executors.readCoreCompletion?.(runId) ?? null;
|
|
1623
|
+
}
|
|
1624
|
+
catch { /* old/unavailable runtime */ }
|
|
1625
|
+
const executionOutcome = outcome;
|
|
1626
|
+
if (outcome === 'success' && coreCompletion && (coreCompletion.completion.implementation !== 'complete' || !['verified', 'with-exceptions'].includes(coreCompletion.completion.validation)))
|
|
1627
|
+
outcome = 'blocked';
|
|
1628
|
+
emitRunEvent('loop_completion', {
|
|
1629
|
+
version: 1, execution: executionOutcome, steps: stepNum, deciderEvaluations: iteration,
|
|
1630
|
+
turns: finalJobUsage.numTurns, costUsd: usageTelemetryAvailable ? totalCost : null,
|
|
1631
|
+
costUncertain, core: coreCompletion,
|
|
1632
|
+
});
|
|
1618
1633
|
// Settle the backing job so the Jobs list + JobDetail reflect the final
|
|
1619
1634
|
// status, and emit job.finalized so an open JobDetail re-fetches + stops the
|
|
1620
1635
|
// live stream (mirrors QueueManager).
|
|
@@ -1627,10 +1642,12 @@ class LoopRunManager {
|
|
|
1627
1642
|
// `≥` when any cost-bearing step ended unpriced (timeout/crash) — the figure
|
|
1628
1643
|
// is a lower bound, not exact. Providers without usage telemetry get an
|
|
1629
1644
|
// explicit unavailable marker, never a fabricated "$0.0000".
|
|
1630
|
-
logLine(`\n■ Loop finished: ${
|
|
1645
|
+
logLine(`\n■ Loop execution finished: ${executionOutcome} — ${stepNum} step${stepNum === 1 ? '' : 's'}, ${iteration} decider evaluation${iteration === 1 ? '' : 's'}, ${finalJobUsage.numTurns ?? 'unknown'} agent turns, ` +
|
|
1631
1646
|
(usageTelemetryAvailable
|
|
1632
1647
|
? `${costUncertain ? '≥ ' : ''}$${totalCost.toFixed(4)}`
|
|
1633
1648
|
: 'usage/cost unavailable'));
|
|
1649
|
+
if (coreCompletion)
|
|
1650
|
+
logLine(`Core result: implementation=${coreCompletion.completion.implementation}; validation=${coreCompletion.completion.validation}; archive=${coreCompletion.completion.archive}; delivery=${coreCompletion.completion.delivery}`);
|
|
1634
1651
|
const finishedAt = new Date(this.now()).toISOString();
|
|
1635
1652
|
(0, loop_runs_store_1.finishLoopRunAndJob)(this.db, runId, {
|
|
1636
1653
|
outcome,
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-CNC7AqOf.js";import{n as t,t as n}from"./jsx-runtime-zu2_FqZY.js";import{J as r,X as i,z as a}from"./TicketDetailModalContext-BNa1mdXq.js";import{h as o,l as s,r as c}from"./useSharedWebSocket-BOdS5_Iz.js";import{n as l,t as u}from"./createLucideIcon-Bjbbp_KS.js";import{a as d,r as f,s as p}from"./useDesktop-RSMTyy7V.js";import{d as m,u as h}from"./MinimizedChatsContext-Deg39peL.js";import{t as g}from"./brain-DI9lHkKY.js";import{n as _}from"./file-text-BcLCfcWZ.js";import{t as v}from"./circle-x-CMYsN4ZH.js";import{t as y}from"./git-branch-BRM0F5GN.js";import{t as b}from"./loader-circle-DcygOQpC.js";import{n as x,t as S}from"./square-Ci-PFcFe.js";import{t as C}from"./search-Cq_gE3Ik.js";import{t as w}from"./triangle-alert-H9T4jAmh.js";import{t as T}from"./x-CBMI9ejn.js";import{t as E}from"./utils-BC4DHlz2.js";import{n as D,t as O}from"./lib-CGdyxIWg.js";import{t as k}from"./button-Ccc9Dc-D.js";import{Et as A,F as j,G as M,J as ee,K as N,R as P,V as F,bt as te,dt as ne,f as I,jt as L,kt as R,lt as re,p as z,q as B,rt as ie,ut as ae,z as V}from"./index-m5pKr1T6.js";import{t as oe}from"./lib-C7Mhm-gT.js";var se=u(`chevrons-down-up`,[[`path`,{d:`m7 20 5-5 5 5`,key:`13a0gw`}],[`path`,{d:`m7 4 5 5 5-5`,key:`1kwcof`}]]),ce=u(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),le=u(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),ue=u(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),de=u(`hourglass`,[[`path`,{d:`M5 22h14`,key:`ehvnwv`}],[`path`,{d:`M5 2h14`,key:`pdyrp9`}],[`path`,{d:`M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22`,key:`1d314k`}],[`path`,{d:`M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2`,key:`1vvvr6`}]]),H=n();function fe({phases:e,phaseDefinitions:t}){return t.length===0?null:(0,H.jsx)(`div`,{className:`flex items-center`,children:t.map((n,r)=>{let i=e[n.key]??`idle`,a=r<t.length-1?e[t[r+1].key]??`idle`:null;return(0,H.jsxs)(`div`,{className:`flex items-center`,children:[(0,H.jsxs)(P,{children:[(0,H.jsx)(F,{asChild:!0,children:(0,H.jsxs)(`div`,{className:`flex flex-col items-center gap-1.5 cursor-default px-4`,children:[(0,H.jsx)(pe,{state:i}),(0,H.jsx)(`span`,{className:E(`text-xs font-medium transition-colors`,i===`running`?`text-blue-400 aurora-light:text-accent-info`:i===`done`?`text-emerald-400 aurora-light:text-accent-success`:i===`error`?`text-red-400 aurora-light:text-destructive`:`text-muted-foreground/40`),children:n.label})]})}),(0,H.jsxs)(V,{side:`bottom`,className:`max-w-[200px]`,children:[(0,H.jsx)(`p`,{className:`font-medium`,children:n.label}),(0,H.jsx)(`p`,{className:`text-muted-foreground mt-0.5`,children:n.description})]})]}),a!==null&&(0,H.jsx)(`div`,{className:E(`h-px w-12 -mt-5 shrink-0 transition-all duration-300`,a===`done`||i===`done`?`bg-emerald-500/30 aurora-light:bg-accent-success/40`:a===`running`?`bg-blue-400/40 aurora-light:bg-accent-info/40`:`bg-border/30`)})]},n.key)})})}function pe({state:e}){return(0,H.jsxs)(`div`,{className:E(`flex items-center justify-center w-10 h-10 rounded-full transition-all duration-300`,e===`running`?`bg-blue-500/10 aurora-light:bg-accent-info/10 ring-1 ring-blue-400/30 aurora-light:ring-accent-info/30 animate-pulse`:e===`done`?`bg-emerald-500/10 aurora-light:bg-accent-success/10`:e===`error`?`bg-red-500/10 aurora-light:bg-destructive/10`:`bg-muted/20`),children:[e===`running`&&(0,H.jsx)(b,{className:`w-6 h-6 text-blue-400 aurora-light:text-accent-info animate-spin`}),e===`done`&&(0,H.jsx)(L,{className:`w-6 h-6 text-emerald-400 aurora-light:text-accent-success`}),e===`error`&&(0,H.jsx)(v,{className:`w-6 h-6 text-red-400 aurora-light:text-destructive`}),e===`idle`&&(0,H.jsx)(r,{className:`w-6 h-6 text-muted-foreground/20`})]})}var U=e(t(),1);function me(e){let t=e.trimStart();return!!(/^#{1,6}\s/.test(t)||/^[-*+]\s/.test(t)||/^\d+\.\s/.test(t)||/^\|.+\|/.test(t)||t.startsWith("```")||t.startsWith(`> `)||/\*\*[^*]+\*\*/.test(e)||/`[^`]+`/.test(e)||/\[.+\]\(.+\)/.test(e)||/^(-{3,}|_{3,}|\*{3,})$/.test(t)||/^- \[[ x]\]\s/.test(t))}var he=new Set;function ge({ticketId:e,onOpen:t,children:n}){let{t:r}=l(`agent`),i=r(`refs.openTicket`,{id:e});return(0,H.jsx)(`button`,{type:`button`,"data-testid":`log-ticket-ref`,onClick:n=>{n.stopPropagation(),t(e)},title:i,"aria-label":i,className:`inline cursor-pointer p-0 align-baseline text-accent-primary/90 underline decoration-accent-primary/50 decoration-dotted underline-offset-2 transition-colors hover:text-accent-primary hover:decoration-solid`,children:n})}function _e(e){if(!e.includes(`#`))return null;let t=B(e,he);return t.some(e=>e.kind===`ticket`)?t:null}function ve(e,t){let n=_e(e);return n?n.map((e,n)=>e.kind===`ticket`?(0,H.jsx)(ge,{ticketId:e.ticketId,onOpen:t,children:e.label},n):(0,H.jsx)(U.Fragment,{children:e.kind===`text`?e.text:e.label},n)):e}var ye=new Set([`code`,`inlineCode`,`link`,`linkReference`,`image`,`imageReference`,`definition`,`html`]);function be(e){return e.kind===`ticket`?{type:`link`,url:M({kind:`ticket`,ticketId:e.ticketId}),children:[{type:`text`,value:e.label}]}:{type:`text`,value:e.kind===`text`?e.text:e.label}}function xe(e){let t=e.children;if(t)for(let e=t.length-1;e>=0;e--){let n=t[e];if(!ye.has(n.type))if(n.type===`text`&&typeof n.value==`string`){let r=B(n.value,he);r.some(e=>e.kind===`ticket`)&&t.splice(e,1,...r.map(be))}else xe(n)}}function Se(){return e=>xe(e)}function Ce(e){let{activeProjectId:t}=f(),{openRef:n}=ee(),r=e??t??void 0;return(0,U.useMemo)(()=>r?e=>{n(r,{kind:`ticket`,ticketId:e})}:void 0,[r,n])}function we(e,t){let n=`${e.id??t}`,r=e.timestamp;if(e.event_type===`log`)try{let t=JSON.parse(e.payload).line??``;return t.trim()?t.startsWith(`▸`)||t.match(/^(architect|developer|reviewer|ship|analyst)\s*:/i)?{id:n,content:t,type:`phase`,timestamp:r}:e.source===`stderr`?{id:n,content:t,type:`stderr`,timestamp:r}:me(t)?{id:n,content:t,type:`assistant`,timestamp:r}:{id:n,content:t,type:`plain`,timestamp:r}:null}catch{return null}if(e.event_type!==`log`&&e.event_type!==`result`)return null;if(e.event_type===`result`)try{let t=JSON.parse(e.payload),i=[];return t.duration_ms&&i.push(`${(t.duration_ms/1e3).toFixed(1)}s`),t.total_cost_usd&&i.push(`$${t.total_cost_usd.toFixed(4)}`),t.num_turns&&i.push(o.t(`jobs:logViewer.turns`,{count:t.num_turns})),{id:n,content:`▸ ${o.t(`jobs:logViewer.completed`)}${i.length?` — ${i.join(` · `)}`:``}`,type:`result`,timestamp:r}}catch{return null}return null}function Te(e){let t=`none`,n=[];for(let r of e){let e=r.type;if(e!==`plain`&&e!==`log`){t=`none`,n.push(r);continue}let i=r.content;i.startsWith(`--- `)?(t=`saw_minus`,n.push({...r,type:`diff-meta`})):t===`saw_minus`&&i.startsWith(`+++ `)?(t=`active`,n.push({...r,type:`diff-meta`})):t===`active`&&i.startsWith(`@@ `)?n.push({...r,type:`diff-hunk`}):t===`active`&&i.startsWith(`+`)&&!i.startsWith(`+++`)?n.push({...r,type:`diff-add`}):t===`active`&&i.startsWith(`-`)&&!i.startsWith(`---`)?n.push({...r,type:`diff-remove`}):(t===`active`&&(i.startsWith(` `)||i===``)||(t=`none`),n.push(r))}return n}function Ee(e){let t=[];for(let n of e){let e=t.length>0?t[t.length-1]:null;n.type===`assistant`&&e?.type===`assistant`?e.content+=`
|
|
2
|
-
`+n.content:t.push({...n})}return t}function De(e){let t=[{key:`__preamble__`,header:null,lines:[]}];for(let n of e)n.type===`phase`?t.push({key:n.id,header:n,lines:[]}):t[t.length-1].lines.push(n);return t.filter(e=>e.header!==null||e.lines.length>0)}function Oe({events:e,isLoading:t,projectId:n}){let{t:r,i18n:i}=l(`jobs`),[a,o]=(0,U.useState)(``),[s,c]=(0,U.useState)(!0),[u,d]=(0,U.useState)(new Set),f=(0,U.useRef)(null),m=(0,U.useRef)(null),g=Ce(n),{processedLines:_,groups:v,totalLines:y}=(0,U.useMemo)(()=>{let t=Te(Ee(e.map((e,t)=>we(e,t)).filter(e=>e!==null)));return{processedLines:t,groups:De(t),totalLines:t.length}},[e,i.language]),b=(0,U.useMemo)(()=>{if(!a)return y;let e=a.toLowerCase();return _.filter(t=>t.content.toLowerCase().includes(e)).length},[a,_,y]),x=(0,U.useCallback)(()=>{let e=m.current;e&&(e.scrollTop=e.scrollHeight)},[]);(0,U.useEffect)(()=>{s&&x()},[e.length,s,x]);function S(){let e=m.current;if(!e)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight<50;c(t)}function w(e){d(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}return t?(0,H.jsx)(`div`,{className:`flex-1 flex items-center justify-center`,children:(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(`logViewer.loading`)})}):y===0?(0,H.jsx)(`div`,{className:`flex-1 flex items-center justify-center`,children:(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(`logViewer.empty`)})}):(0,H.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,H.jsxs)(`div`,{className:`px-4 py-2 border-b border-border flex items-center gap-2`,children:[(0,H.jsxs)(`div`,{className:`relative flex-1 max-w-xs`,children:[(0,H.jsx)(C,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 w-3 h-3 text-muted-foreground`}),(0,H.jsx)(j,{placeholder:r(`logViewer.filterPlaceholder`),value:a,onChange:e=>o(e.target.value),className:`pl-7 h-7`})]}),(0,H.jsx)(k,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-muted-foreground/50 hover:text-foreground`,onClick:()=>{let e=_.map(e=>e.content).join(`
|
|
3
|
-
`);navigator.clipboard.writeText(e).then(()=>{p.success(r(`logViewer.copySuccess`))}).catch(()=>{p.error(r(`logViewer.copyFailed`))})},children:(0,H.jsx)(R,{className:`w-3.5 h-3.5`})}),(0,H.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:r(`logViewer.lineCount`,{filtered:b,total:y})})]}),(0,H.jsxs)(`div`,{ref:m,className:`flex-1 overflow-y-auto p-2 text-xs relative`,onScroll:S,children:[v.map(e=>(0,H.jsx)(ke,{group:e,filter:a,collapsed:u.has(e.key),onToggle:()=>w(e.key),onOpenTicket:g},e.key)),(0,H.jsx)(`div`,{ref:f})]}),!s&&(0,H.jsxs)(k,{size:`sm`,variant:`secondary`,onClick:()=>{c(!0),x()},className:`absolute bottom-16 right-6 h-7 gap-1 shadow-lg`,children:[(0,H.jsx)(h,{className:`w-3 h-3`}),r(`logViewer.jumpToBottom`)]})]})}var ke=(0,U.memo)(function({group:e,filter:t,collapsed:n,onToggle:r,onOpenTicket:i}){let{t:a}=l(`jobs`),o=t?e.lines.filter(e=>e.content.toLowerCase().includes(t.toLowerCase())):e.lines;if(e.header===null)return o.length===0?null:(0,H.jsx)(`div`,{children:o.map((e,t)=>(0,H.jsx)(W,{line:e,even:t%2==0,onOpenTicket:i},e.id))});let s=e.header.content;return(0,H.jsxs)(`div`,{className:`mt-3 rounded-md overflow-hidden border border-border/20`,children:[(0,H.jsxs)(`button`,{type:`button`,onClick:r,className:E(`flex items-center gap-2 w-full text-left px-3 py-2`,`bg-primary/5 border-b border-primary/20`,`hover:bg-primary/10 transition-colors duration-150 cursor-pointer`),children:[(0,H.jsx)(_,{className:E(`w-3 h-3 text-primary/60 shrink-0 transition-transform duration-150`,!n&&`rotate-90`)}),(0,H.jsx)(`span`,{className:`flex-1 text-[12px] font-semibold text-foreground leading-none`,children:s}),e.header.timestamp&&(0,H.jsx)(`span`,{className:`text-[10px] text-muted-foreground/40 font-mono tabular-nums shrink-0`,children:new Date(e.header.timestamp).toLocaleTimeString(`en`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1})}),(0,H.jsx)(`span`,{className:`text-[10px] text-muted-foreground/40 shrink-0`,children:a(`logViewer.phaseLines`,{count:e.lines.length})})]}),!n&&(0,H.jsx)(`div`,{className:`bg-muted/5`,children:o.length===0?(0,H.jsx)(`p`,{className:`px-4 py-2 text-[10px] text-muted-foreground/40 italic`,children:a(t?`logViewer.noMatchingLines`:`logViewer.noOutput`)}):o.map((e,t)=>(0,H.jsx)(W,{line:e,even:t%2==0,onOpenTicket:i},e.id))})]})}),Ae=[oe],je=[O],Me=[O,Se],W=(0,U.memo)(function({line:e,even:t,onOpenTicket:n}){let r=e.type===`assistant`,i=e.type===`diff-add`,a=e.type===`diff-remove`,o=e.type===`diff-meta`,s=e.type===`diff-hunk`,c=i||a||o||s,l=n!=null&&(e.type===`plain`||e.type===`log`),u=(0,U.useMemo)(()=>l&&n?ve(e.content,n):e.content,[l,n,e.content]),d=r&&n?Me:je,f=(0,U.useMemo)(()=>n?{a:({href:e,children:t})=>{let r=N(e);return r?.kind===`ticket`?(0,H.jsx)(ge,{ticketId:r.ticketId,onOpen:n,children:t}):(0,H.jsx)(`a`,{href:e,children:t})}}:void 0,[n]);return(0,H.jsxs)(`div`,{className:E(`flex items-start gap-2 group px-2 py-0.5 rounded-sm`,!c&&(t?`bg-muted/20`:`bg-transparent`),e.type===`result`&&`bg-emerald-500/5 aurora-light:bg-accent-success/10 border-l-2 border-emerald-500/40 aurora-light:border-accent-success/40 mt-2 py-2`,i&&`bg-emerald-500/8 aurora-light:bg-accent-success/10 border-l-2 border-emerald-500/50 aurora-light:border-accent-success/50`,a&&`bg-red-500/8 aurora-light:bg-destructive/10 border-l-2 border-red-500/50 aurora-light:border-destructive/50`,o&&`bg-accent-primary/5 border-l-2 border-accent-primary/30`,s&&`bg-accent-info/5 border-l-2 border-accent-info/30`),children:[e.timestamp&&(0,H.jsx)(`span`,{className:`text-[10px] text-muted-foreground/40 shrink-0 mt-0.5 w-[52px] font-mono tabular-nums`,children:new Date(e.timestamp).toLocaleTimeString(`en`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1})}),r?(0,H.jsx)(`div`,{className:`flex-1 min-w-0 prose prose-invert prose-xs max-w-none
|
|
4
|
-
prose-p:my-1 prose-p:leading-relaxed
|
|
5
|
-
prose-headings:mt-2 prose-headings:mb-1 prose-headings:text-sm prose-headings:font-semibold
|
|
6
|
-
prose-ul:my-1 prose-ol:my-1 prose-li:my-0
|
|
7
|
-
prose-code:text-cyan-300 prose-code:text-[11px] prose-code:bg-muted/40 prose-code:px-1 prose-code:py-0.5 prose-code:rounded
|
|
8
|
-
prose-pre:my-1 prose-pre:bg-muted/30 prose-pre:rounded-md prose-pre:p-2 prose-pre:text-[11px]
|
|
9
|
-
prose-strong:text-foreground prose-em:text-foreground/70
|
|
10
|
-
prose-a:text-blue-400 prose-a:no-underline hover:prose-a:underline
|
|
11
|
-
prose-table:my-2 prose-table:text-[11px]
|
|
12
|
-
prose-thead:border-border prose-thead:bg-muted/30
|
|
13
|
-
prose-th:px-3 prose-th:py-1.5 prose-th:text-left prose-th:font-semibold prose-th:text-foreground/90
|
|
14
|
-
prose-td:px-3 prose-td:py-1.5 prose-td:border-border
|
|
15
|
-
prose-tr:border-border
|
|
16
|
-
text-foreground/80`,children:(0,H.jsx)(D,{remarkPlugins:d,rehypePlugins:Ae,components:f,children:e.content})}):(0,H.jsx)(`span`,{className:E(`flex-1 break-all leading-relaxed whitespace-pre-wrap font-mono`,e.type===`tool-use`&&`text-cyan-400/80 aurora-light:text-accent-info text-[11px]`,e.type===`stderr`&&`text-orange-400 aurora-light:text-accent-warning`,e.type===`result`&&`text-emerald-400 aurora-light:text-accent-success font-medium`,e.type===`log`&&`text-foreground/60`,e.type===`plain`&&`text-foreground/70`,e.type===`tool-result`&&`text-muted-foreground/50`,i&&`text-emerald-400 aurora-light:text-accent-success`,a&&`text-red-400 aurora-light:text-destructive`,o&&`text-accent-primary/80`,s&&`text-accent-info/80`),children:u})]})});function G(e){try{let t=JSON.parse(e);if(t&&typeof t==`object`&&!Array.isArray(t))return t}catch{}return null}var Ne=/^\s*━+\s*Step\s+\d+\s*·/,Pe=/\s*\(iteration\s+\d+\)\s*$/i;function K(e){return e.replace(/^[\s\uFE0F\p{Extended_Pictographic}]+/u,``).trim()||e.trim()}function q(e){let t=K(e.title);return e.iteration==null?t:t.replace(Pe,``)}function Fe(e){return e.meta.nodeId??`${e.meta.kind}::${K(e.meta.title).replace(Pe,``)}`}function Ie(e){let t=null,n=0,r=[[]],i=[];for(let a=0;a<e.length;a++){let o=e[a];if(o.event_type===`loop_graph`){let e=G(o.payload);e&&e.graph&&typeof e.graph==`object`&&!Array.isArray(e.graph)&&(t={graph:e.graph,loopId:typeof e.loopId==`string`?e.loopId:void 0,loopName:typeof e.loopName==`string`?e.loopName:void 0,provider:typeof e.provider==`string`?e.provider:void 0,model:typeof e.model==`string`?e.model:void 0,iterationLimit:typeof e.iterationLimit==`number`?e.iterationLimit:void 0});continue}if(o.event_type===`loop_step`){let e=G(o.payload);if(!e||typeof e.index!=`number`)continue;let t=typeof e.iteration==`number`?e.iteration:null;t!=null&&t>n&&(n=t),i.push({meta:{index:e.index,kind:typeof e.kind==`string`?e.kind:`ai-step`,title:typeof e.title==`string`?e.title:``,nodeId:typeof e.nodeId==`string`?e.nodeId:null,iteration:t,template:typeof e.template==`string`&&e.template?e.template:void 0,command:typeof e.command==`string`&&e.command?e.command:void 0},end:null,lastActivity:null}),r.push([]);continue}if(o.event_type===`loop_step_end`){let e=G(o.payload);if(!e||typeof e.index!=`number`)continue;for(let t=i.length-1;t>=0;t--)if(i[t].meta.index===e.index){i[t].end={index:e.index,nodeId:typeof e.nodeId==`string`?e.nodeId:null,status:e.status===`stalled`?`stalled`:e.status===`failed`?`failed`:`ok`,exitCode:typeof e.exitCode==`number`?e.exitCode:null,durationMs:typeof e.durationMs==`number`?e.durationMs:null,decision:e.decision===`continue`||e.decision===`stop`?e.decision:void 0,...e.reason===`idle_timeout`||e.reason===`provider_limit`?{reason:e.reason}:{},...typeof e.idleMs==`number`?{idleMs:e.idleMs}:{}};break}continue}let s=i.length>0,c=we(o,a);if(c&&!(s&&Ne.test(c.content))&&r[r.length-1].push(c),s){let e=z(o);e.step&&e.actionKey&&(i[i.length-1].lastActivity={actionKey:e.actionKey,actionArg:e.actionArg})}}let a=e=>Te(Ee(e)),o=a(r[0]),s=i.map((e,t)=>({key:`step-${t}-${e.meta.index}`,meta:e.meta,lines:a(r[t+1]),end:e.end,lastActivity:e.lastActivity})),c=o.length+s.reduce((e,t)=>e+t.lines.length,0);return{graphMeta:t,setup:o,segments:s,maxIteration:n,totalLines:c}}function Le(e,t){return e.end?e.end.status:t.isLast?t.jobSettled?`interrupted`:`running`:`unknown`}function Re(e){return e===`continue`?0:e===`stop`?2:1}function ze(e){let t=new Map(e.nodes.map(e=>[e.id,e])),n=new Set,r=[],i=a=>{if(n.has(a))return;let o=t.get(a);if(!o)return;n.add(a),r.push(o);let s=e.edges.filter(e=>e.source===a).slice().sort((e,t)=>Re(e.branch)-Re(t.branch));for(let e of s)i(e.target)},a=e.nodes.find(e=>e.type===`start`);a&&i(a.id);for(let t of e.nodes)i(t.id);return r}function J(e){let t=e.data?.label;return typeof t==`string`&&t.trim()?t.trim():null}function Be(e,t){let n=e.segments.length-1,r=new Map,i=new Map;e.segments.forEach((e,t)=>{let n=Fe(e);r.set(n,{seg:e,idx:t}),e.meta.kind===`decider`&&e.end?.decision&&i.set(n,e.end.decision)});let a=e=>{let r=Le(e.seg,{isLast:e.idx===n,jobSettled:t.jobSettled});return r===`unknown`?`ok`:r===`stalled`?`failed`:r};if(e.graphMeta)return ze(e.graphMeta.graph).map(e=>{if(e.type===`start`)return{key:e.id,kind:`start`,label:J(e),state:`ok`,latestSegmentKey:null};if(e.type===`end`)return{key:e.id,kind:`end`,label:J(e),state:t.jobSettled?t.jobFailed?`failed`:`ok`:`pending`,latestSegmentKey:null};let n=r.get(e.id);return n?{key:e.id,kind:e.type,label:J(e)??q(n.seg.meta),state:a(n),decision:e.type===`decider`?i.get(e.id):void 0,latestSegmentKey:n.seg.key}:{key:e.id,kind:e.type,label:J(e),state:`pending`,latestSegmentKey:null}});let o=[],s=new Map;return e.segments.forEach((e,t)=>{let n=Fe(e),r={seg:e,idx:t},c=s.get(n),l=e.meta.kind===`decider`?i.get(n):void 0;if(c!=null){let t=o[c];t.state=a(r),t.decision=l,t.latestSegmentKey=e.key}else s.set(n,o.length),o.push({key:n,kind:e.meta.kind,label:q(e.meta)||null,state:a(r),decision:l,latestSegmentKey:e.key})}),o}function Ve(e){if(!Number.isFinite(e)||e<0)return`—`;if(e<1e3)return`${Math.round(e)}ms`;let t=e/1e3;if(t<60)return`${t.toFixed(1)}s`;let n=Math.floor(t/60),r=Math.round(t%60);return n<60?`${n}m ${r}s`:`${Math.floor(n/60)}h ${n%60}m`}var He={start:x,"ai-step":g,shell:ie,decider:y,condition:y,end:A},Ue=S,We={start:`text-accent-success`,"ai-step":`text-accent-primary`,shell:`text-accent-warning`,decider:`text-accent-highlight`,condition:`text-accent-info`,end:`text-accent-secondary`},Ge={start:`border-accent-success/60`,"ai-step":`border-accent-primary/60`,shell:`border-accent-warning/60`,decider:`border-accent-highlight/60`,condition:`border-accent-info/60`,end:`border-accent-secondary/60`};function Ke(e){return He[e]??Ue}function qe({chips:e,iteration:t,onChipClick:n,variant:r}){let{t:o}=l(`jobs`);return e.length===0&&!t?null:(0,H.jsxs)(`div`,{"data-testid":`loop-overview-strip`,role:`list`,"aria-label":o(`loopExplorer.stepMapAria`),className:E(`flex items-center gap-1 overflow-x-auto border-b border-border/30 bg-surface/20`,r===`glass`?`px-3 py-1.5`:`px-4 py-2`),children:[e.map((e,t)=>{let r=Ke(e.kind),s=We[e.kind]??`text-foreground`,c=Ge[e.kind]??`border-border/40`,l=e.label??o(`loops:builder.nodes.${e.kind}`,{defaultValue:e.kind}),u=e.latestSegmentKey!=null;return(0,H.jsxs)(U.Fragment,{children:[t>0&&(0,H.jsx)(_,{className:`w-3 h-3 text-muted-foreground/30 shrink-0`}),(0,H.jsxs)(`button`,{type:`button`,role:`listitem`,"data-testid":`loop-node-chip`,"data-state":e.state,"data-kind":e.kind,"data-decision":e.decision,"aria-label":`${l} — ${e.state}`,disabled:!u,onClick:()=>e.latestSegmentKey&&n(e.latestSegmentKey),className:E(`relative flex items-center gap-1.5 shrink-0 rounded-full border bg-surface/40 px-2.5 py-1 text-[11px] transition-colors`,c,e.state===`pending`&&`opacity-45 border-border/40`,e.state===`interrupted`&&`border-dashed border-accent-warning/50`,u?`cursor-pointer hover:bg-surface/70`:`cursor-default`),children:[e.state===`running`&&(0,H.jsx)(`span`,{"aria-hidden":!0,className:`absolute -inset-px rounded-full ring-2 ring-accent-primary/50 motion-safe:animate-pulse pointer-events-none`}),(0,H.jsx)(r,{className:E(`w-3 h-3 shrink-0`,s)}),(0,H.jsx)(`span`,{className:E(`max-w-[120px] truncate font-medium text-foreground/90`,e.state===`running`&&`title-shimmer`),children:l}),e.state===`ok`&&(0,H.jsx)(m,{className:`w-3 h-3 text-accent-success shrink-0`}),e.state===`failed`&&(0,H.jsx)(T,{className:`w-3 h-3 text-destructive shrink-0`}),e.decision===`continue`&&(0,H.jsx)(a,{className:`w-3 h-3 text-accent-highlight shrink-0`}),e.decision===`stop`&&(0,H.jsx)(i,{className:`w-3 h-3 text-accent-success shrink-0`})]})]},e.key)}),t&&(0,H.jsxs)(`span`,{"data-testid":`loop-iteration-chip`,className:`ml-auto flex items-center gap-1.5 shrink-0 rounded-full border border-accent-highlight/40 bg-accent-highlight/10 px-2.5 py-1 text-[10px] font-medium text-accent-highlight tabular-nums`,children:[(0,H.jsx)(ne,{className:`w-3 h-3`}),t.limit==null?o(`loopExplorer.iterationBadge`,{count:t.current}):o(`loopExplorer.iteration`,{current:t.current,limit:t.limit})]})]})}var Je=(0,U.memo)(qe);function Ye({className:e}){return(0,H.jsxs)(`span`,{className:E(`relative flex h-2 w-2 shrink-0`,e),children:[(0,H.jsx)(`span`,{className:`motion-safe:animate-ping absolute inline-flex h-full w-full rounded-full bg-accent-primary opacity-60`}),(0,H.jsx)(`span`,{className:`relative inline-flex rounded-full h-2 w-2 bg-accent-primary`})]})}function Xe(e,t){if(!t)return e;let n=t.toLowerCase();return e.filter(e=>e.content.toLowerCase().includes(n))}function Ze(e,t,n,r){return e.length===0?(0,H.jsx)(`p`,{className:`px-4 py-2 text-[10px] text-muted-foreground/40 italic`,children:n(t?`logViewer.noMatchingLines`:`logViewer.noOutput`)}):e.map((e,t)=>(0,H.jsx)(W,{line:e,even:t%2==0,onOpenTicket:r},e.id))}function Qe({label:e,value:t,copyLabel:n}){let[r,i]=(0,U.useState)(!1),a=async()=>{try{await navigator.clipboard.writeText(t),i(!0),window.setTimeout(()=>i(!1),1500)}catch{}};return(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,H.jsx)(`span`,{className:`text-[9px] font-semibold uppercase tracking-wider text-muted-foreground/50`,children:e}),(0,H.jsx)(`button`,{type:`button`,onClick:()=>void a(),"aria-label":`${n} — ${e}`,title:n,className:`p-0.5 text-muted-foreground/40 hover:text-foreground transition-colors cursor-pointer`,children:r?(0,H.jsx)(m,{className:`w-2.5 h-2.5 text-accent-success`}):(0,H.jsx)(R,{className:`w-2.5 h-2.5`})})]}),(0,H.jsx)(`pre`,{className:`mt-0.5 text-[10px] font-mono leading-relaxed text-foreground/75 whitespace-pre-wrap break-words`,children:t})]})}function $e({segment:e,status:t,collapsed:n,filter:r,onToggle:i,onCopy:a,setRef:o,onOpenTicket:s}){let{t:c}=l(`jobs`),{meta:u,lines:d,end:f,lastActivity:p}=e,h=Ke(u.kind),g=We[u.kind]??`text-foreground`,v=Xe(d,r),y=t===`running`,b=!!(u.template||u.command),[x,S]=(0,U.useState)(!1);return(0,H.jsxs)(`div`,{ref:t=>o(e.key,t),"data-testid":`loop-step-section`,"data-status":t,"data-step-index":u.index,className:E(`mt-3 rounded-md overflow-hidden border animate-in fade-in duration-200`,t===`running`&&`border-accent-primary/40`,t===`failed`&&`border-destructive/30`,t===`stalled`&&`border-dashed border-destructive/40`,t===`interrupted`&&`border-dashed border-accent-warning/40`,(t===`ok`||t===`unknown`)&&`border-border/20`),children:[(0,H.jsxs)(`div`,{className:E(`flex items-stretch bg-primary/5 border-b`,t===`failed`||t===`stalled`?`border-destructive/20`:`border-primary/20`),children:[(0,H.jsxs)(`button`,{type:`button`,onClick:()=>i(e.key),className:`flex items-center gap-2 flex-1 min-w-0 text-left px-3 py-2 hover:bg-primary/10 transition-colors duration-150 cursor-pointer`,children:[(0,H.jsx)(_,{className:E(`w-3 h-3 text-primary/60 shrink-0 transition-transform duration-150`,!n&&`rotate-90`)}),(0,H.jsx)(`span`,{className:`text-[10px] font-mono tabular-nums text-muted-foreground/60 shrink-0 w-5 text-right`,children:u.index}),(0,H.jsx)(h,{className:E(`w-3.5 h-3.5 shrink-0`,g)}),(0,H.jsx)(`span`,{className:`text-[12px] font-semibold text-foreground leading-none truncate`,children:q(u)}),u.iteration!=null&&u.iteration>=1&&(0,H.jsx)(`span`,{className:`shrink-0 rounded-full bg-muted/60 px-1.5 py-0.5 text-[9px] font-medium text-muted-foreground tabular-nums`,children:c(`loopExplorer.iterationBadge`,{count:u.iteration})}),y&&(0,H.jsxs)(`span`,{className:`flex items-center gap-1.5 min-w-0 shrink-0 max-w-[40%]`,children:[(0,H.jsx)(Ye,{}),p&&(0,H.jsx)(`span`,{className:`title-shimmer text-[10px] truncate`,children:c(`statusPanel.activity.${p.actionKey}`,{arg:p.actionArg??``})})]}),t===`ok`&&(0,H.jsx)(m,{className:`w-3.5 h-3.5 text-accent-success shrink-0`}),t===`failed`&&f?.reason===`provider_limit`&&(0,H.jsx)(`span`,{className:`shrink-0 rounded border border-dashed border-destructive/50 px-1.5 py-0.5 text-[9px] font-medium uppercase tracking-wide text-destructive`,title:c(`loopExplorer.providerLimitHint`),"data-testid":`loop-step-provider-limit`,children:c(`loopExplorer.providerLimit`)}),t===`failed`&&(0,H.jsx)(T,{className:`w-3.5 h-3.5 text-destructive shrink-0`}),t===`stalled`&&(0,H.jsx)(`span`,{className:`shrink-0 rounded border border-dashed border-destructive/50 px-1.5 py-0.5 text-[9px] font-medium uppercase tracking-wide text-destructive`,title:f?.idleMs==null?void 0:c(`loopExplorer.stalledIdle`,{count:Math.max(1,Math.round(f.idleMs/6e4))}),children:c(`loopExplorer.stalled`)}),t===`interrupted`&&(0,H.jsx)(`span`,{className:`shrink-0 rounded border border-dashed border-accent-warning/50 px-1.5 py-0.5 text-[9px] font-medium uppercase tracking-wide text-accent-warning`,children:c(`loopExplorer.interrupted`)}),(0,H.jsx)(`span`,{className:`flex-1`}),f?.durationMs!=null&&(0,H.jsx)(`span`,{className:`text-[10px] text-muted-foreground/50 font-mono tabular-nums shrink-0`,children:Ve(f.durationMs)}),t===`failed`&&f?.exitCode!=null&&f.exitCode!==0&&(0,H.jsx)(`span`,{className:`text-[10px] text-destructive/70 font-mono shrink-0`,children:c(`activeJob.exitCode`,{code:f.exitCode})}),(0,H.jsx)(`span`,{className:`text-[10px] text-muted-foreground/40 shrink-0`,children:c(`logViewer.phaseLines`,{count:d.length})})]}),b&&(0,H.jsx)(`button`,{type:`button`,onClick:()=>S(e=>!e),"aria-label":c(`loopExplorer.stepDetail`),"aria-expanded":x,title:c(`loopExplorer.stepDetail`),className:E(`px-2 flex items-center transition-colors cursor-pointer`,x?`text-foreground bg-primary/10`:`text-muted-foreground/40 hover:text-foreground hover:bg-primary/10`),children:(0,H.jsx)(te,{className:`w-3 h-3`})}),(0,H.jsx)(`button`,{type:`button`,onClick:()=>a(e.key),"aria-label":c(`loopExplorer.copyStep`),title:c(`loopExplorer.copyStep`),className:`px-2.5 flex items-center text-muted-foreground/40 hover:text-foreground hover:bg-primary/10 transition-colors cursor-pointer`,children:(0,H.jsx)(R,{className:`w-3 h-3`})})]}),x&&b&&(0,H.jsxs)(`div`,{"data-testid":`loop-step-detail`,className:E(`px-4 py-2.5 space-y-2.5 bg-muted/10 border-b animate-in fade-in duration-150`,t===`failed`?`border-destructive/20`:`border-primary/10`),children:[u.template&&(0,H.jsx)(Qe,{label:c(`loopExplorer.stepDetailTemplate`),value:u.template,copyLabel:c(`loopExplorer.copyCommand`)}),u.command&&(0,H.jsx)(Qe,{label:c(`loopExplorer.stepDetailCommand`),value:u.command,copyLabel:c(`loopExplorer.copyCommand`)})]}),!n&&(0,H.jsx)(`div`,{className:`bg-muted/5`,children:Ze(v,r,c,s)})]})}var et=(0,U.memo)($e,(e,t)=>e.segment.key===t.segment.key&&e.segment.lines.length===t.segment.lines.length&&e.segment.lines[e.segment.lines.length-1]?.content===t.segment.lines[t.segment.lines.length-1]?.content&&e.segment.meta.template===t.segment.meta.template&&e.segment.meta.command===t.segment.meta.command&&e.segment.end?.status===t.segment.end?.status&&e.segment.end?.durationMs===t.segment.end?.durationMs&&e.segment.end?.decision===t.segment.end?.decision&&e.segment.end?.exitCode===t.segment.end?.exitCode&&e.segment.lastActivity?.actionKey===t.segment.lastActivity?.actionKey&&e.segment.lastActivity?.actionArg===t.segment.lastActivity?.actionArg&&e.status===t.status&&e.collapsed===t.collapsed&&e.filter===t.filter&&e.onOpenTicket===t.onOpenTicket),Y=`__setup__`;function tt({lines:e,collapsed:t,filter:n,onToggle:r,setRef:i,onOpenTicket:a}){let{t:o}=l(`jobs`),s=Xe(e,n);return(0,H.jsxs)(`div`,{ref:e=>i(Y,e),"data-testid":`loop-setup-section`,className:`rounded-md overflow-hidden border border-border/20`,children:[(0,H.jsxs)(`button`,{type:`button`,onClick:()=>r(Y),className:`flex items-center gap-2 w-full text-left px-3 py-2 bg-muted/10 border-b border-border/20 hover:bg-muted/20 transition-colors duration-150 cursor-pointer`,children:[(0,H.jsx)(_,{className:E(`w-3 h-3 text-muted-foreground/60 shrink-0 transition-transform duration-150`,!t&&`rotate-90`)}),(0,H.jsx)(x,{className:`w-3.5 h-3.5 text-accent-success/70 shrink-0`}),(0,H.jsx)(`span`,{className:`text-[11px] font-semibold text-muted-foreground leading-none uppercase tracking-wide`,children:o(`loopExplorer.setup`)}),(0,H.jsx)(`span`,{className:`flex-1`}),(0,H.jsx)(`span`,{className:`text-[10px] text-muted-foreground/40 shrink-0`,children:o(`logViewer.phaseLines`,{count:e.length})})]}),!t&&(0,H.jsx)(`div`,{className:`bg-muted/5`,children:Ze(s,n,o,a)})]})}var nt=(0,U.memo)(tt,(e,t)=>e.lines.length===t.lines.length&&e.lines[e.lines.length-1]?.content===t.lines[t.lines.length-1]?.content&&e.collapsed===t.collapsed&&e.filter===t.filter&&e.onOpenTicket===t.onOpenTicket);function X(){return(0,H.jsxs)(`span`,{className:`relative flex h-1.5 w-1.5 shrink-0`,children:[(0,H.jsx)(`span`,{className:`motion-safe:animate-ping absolute inline-flex h-full w-full rounded-full bg-accent-primary opacity-60`}),(0,H.jsx)(`span`,{className:`relative inline-flex rounded-full h-1.5 w-1.5 bg-accent-primary`})]})}function rt({events:e,jobStatus:t,isLoading:n,variant:r=`page`,projectId:i}){let{t:a,i18n:o}=l(`jobs`),[s,c]=(0,U.useState)(``),[u,d]=(0,U.useState)(`follow`),[f,m]=(0,U.useState)(new Set),h=(0,U.useRef)(null),g=(0,U.useRef)(new Map),_=Ce(i),v=(0,U.useMemo)(()=>Ie(e),[e,o.language]),y=t!=null&&t!==`running`&&t!==`queued`,b=t===`running`,x=(0,U.useMemo)(()=>v.segments.map((e,t)=>Le(e,{isLast:t===v.segments.length-1,jobSettled:y})),[v,y]),S=(0,U.useMemo)(()=>{let e=v.segments.map(e=>e.key);return v.setup.length>0&&e.push(Y),e},[v]),w=v.segments.length>0?v.segments[v.segments.length-1].key:Y,T=(0,U.useMemo)(()=>s?new Set(S):u===`follow`?new Set([w]):f,[s,u,w,f,S]),D=(0,U.useRef)(T);D.current=T;let O=(0,U.useRef)(v);O.current=v;let A=(0,U.useCallback)(e=>{let t=new Set(D.current);e?.(t),m(t),d(`manual`)},[]),M=(0,U.useCallback)(e=>{A(t=>{t.has(e)?t.delete(e):t.add(e)})},[A]),ee=(0,U.useCallback)(e=>{A(t=>t.add(e)),requestAnimationFrame(()=>{g.current.get(e)?.scrollIntoView?.({behavior:`smooth`,block:`start`})})},[A]),N=(0,U.useCallback)(()=>{let e=h.current;e&&(e.scrollTop=e.scrollHeight)},[]),P=(0,U.useCallback)(()=>{d(`follow`),requestAnimationFrame(N)},[N]),F=(0,U.useCallback)(()=>{m(new Set(S)),d(`manual`)},[S]),te=(0,U.useCallback)(()=>{m(new Set),d(`manual`)},[]);(0,U.useEffect)(()=>{u===`follow`&&!s&&N()},[v.totalLines,v.segments.length,u,s,N]);let ne=(0,U.useCallback)(()=>{let e=h.current;!e||u!==`follow`||e.scrollHeight-e.scrollTop-e.clientHeight>80&&A()},[u,A]),I=(0,U.useCallback)((e,t)=>{t?g.current.set(e,t):g.current.delete(e)},[]),L=(0,U.useCallback)(e=>{let t=O.current.segments.find(t=>t.key===e),n=e===`__setup__`?O.current.setup.map(e=>e.content).join(`
|
|
17
|
-
`):(t?.lines??[]).map(e=>e.content).join(`
|
|
18
|
-
`);navigator.clipboard.writeText(n).then(()=>p.success(a(`loopExplorer.copied`))).catch(()=>p.error(a(`logViewer.copyFailed`)))},[a]),re=(0,U.useCallback)(()=>{let e=O.current,t=e.setup.map(e=>e.content);for(let n of e.segments){t.push(`── Step ${n.meta.index} · ${K(n.meta.title)} ──`);for(let e of n.lines)t.push(e.content)}navigator.clipboard.writeText(t.join(`
|
|
19
|
-
`)).then(()=>p.success(a(`logViewer.copySuccess`))).catch(()=>p.error(a(`logViewer.copyFailed`)))},[a]),z=(0,U.useMemo)(()=>Be(v,{jobSettled:y,jobFailed:t===`failed`}),[v,y,t]),B=v.graphMeta?.iterationLimit??v.graphMeta?.graph.config.maxIterations??null,ie=v.maxIteration>0?{current:v.maxIteration,limit:B}:null,ae=(0,U.useMemo)(()=>{if(!s)return v.totalLines;let e=s.toLowerCase(),t=v.setup.filter(t=>t.content.toLowerCase().includes(e)).length;for(let n of v.segments)t+=n.lines.filter(t=>t.content.toLowerCase().includes(e)).length;return t},[s,v]),V=v.segments[v.segments.length-1],oe=b&&(v.segments.length===0||V?.end!=null);return n?(0,H.jsx)(`div`,{className:`flex-1 flex items-center justify-center h-full`,children:(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:a(`logViewer.loading`)})}):v.totalLines===0&&v.segments.length===0?(0,H.jsx)(`div`,{"data-testid":`loop-step-explorer`,className:`flex-1 flex items-center justify-center h-full`,children:(0,H.jsxs)(`p`,{className:`text-xs text-muted-foreground flex items-center gap-2`,children:[b&&(0,H.jsx)(X,{}),a(b?`loopExplorer.waiting`:`logViewer.empty`)]})}):(0,H.jsxs)(`div`,{"data-testid":`loop-step-explorer`,className:`relative flex flex-col h-full`,children:[(0,H.jsxs)(`div`,{className:E(`border-b border-border flex items-center gap-2`,r===`glass`?`px-3 py-1.5`:`px-4 py-2`),children:[(0,H.jsxs)(`div`,{className:`relative flex-1 max-w-xs`,children:[(0,H.jsx)(C,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 w-3 h-3 text-muted-foreground`}),(0,H.jsx)(j,{placeholder:a(`logViewer.filterPlaceholder`),value:s,onChange:e=>c(e.target.value),className:`pl-7 h-7`})]}),(0,H.jsx)(k,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-muted-foreground/50 hover:text-foreground`,onClick:F,"aria-label":a(`loopExplorer.expandAll`),title:a(`loopExplorer.expandAll`),children:(0,H.jsx)(ce,{className:`w-3.5 h-3.5`})}),(0,H.jsx)(k,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-muted-foreground/50 hover:text-foreground`,onClick:te,"aria-label":a(`loopExplorer.collapseAll`),title:a(`loopExplorer.collapseAll`),children:(0,H.jsx)(se,{className:`w-3.5 h-3.5`})}),u===`follow`&&b&&(0,H.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[10px] text-accent-primary shrink-0`,children:[(0,H.jsx)(X,{}),a(`loopExplorer.follow`)]}),(0,H.jsx)(`span`,{className:`flex-1`}),(0,H.jsx)(k,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-muted-foreground/50 hover:text-foreground`,onClick:re,"aria-label":a(`logViewer.copySuccess`),children:(0,H.jsx)(R,{className:`w-3.5 h-3.5`})}),(0,H.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:a(`logViewer.lineCount`,{filtered:ae,total:v.totalLines})})]}),(0,H.jsx)(Je,{chips:z,iteration:ie,onChipClick:ee,variant:r}),(0,H.jsxs)(`div`,{ref:h,onScroll:ne,className:`flex-1 overflow-y-auto p-2 text-xs`,children:[v.setup.length>0&&(0,H.jsx)(nt,{lines:v.setup,collapsed:!T.has(`__setup__`),filter:s,onToggle:M,setRef:I,onOpenTicket:_}),v.segments.map((e,t)=>(0,H.jsx)(et,{segment:e,status:x[t],collapsed:!T.has(e.key),filter:s,onToggle:M,onCopy:L,setRef:I,onOpenTicket:_},e.key)),oe&&(0,H.jsxs)(`div`,{"data-testid":`loop-waiting-row`,className:`mt-3 flex items-center gap-2 px-3 py-2 text-[11px] text-muted-foreground/70 italic`,children:[(0,H.jsx)(X,{}),a(`loopExplorer.waiting`)]})]}),u===`manual`&&b&&!s&&(0,H.jsxs)(`button`,{type:`button`,"data-testid":`resume-follow-pill`,onClick:P,className:`absolute bottom-4 left-1/2 -translate-x-1/2 z-10 flex items-center gap-1.5 rounded-full glass-card border border-accent-primary/30 px-3 py-1.5 text-[11px] font-medium text-foreground shadow-lg hover:border-accent-primary/60 transition-colors cursor-pointer animate-in fade-in slide-in-from-bottom-2 duration-200`,children:[(0,H.jsx)(X,{}),a(`loopExplorer.resumeFollow`)]})]})}var it=new Set(`grep.rg.ag.ack.find.fd.ls.cat.head.tail.sed.awk.cut.sort.uniq.wc.jq.yq.tr.xargs.tee.column.less.more.cd.pwd.echo.printf.which.type.test.true.false.env.export.set.source.date.basename.dirname.realpath.readlink.stat.file.tree.diff.sleep.seq.hostname.whoami.uname.mkdir.rmdir.cp.mv.rm.touch.ln.chmod.chown.install.[[.[.]].].for.while.until.if.then.else.elif.fi.do.done.case.esac.exec.eval.trap.read.shift.wait`.split(`.`)),at=new Set([`status`,`diff`,`log`,`show`,`branch`,`rev-parse`,`ls-files`,`blame`,`describe`]),ot=new Set([...at,`commit`,`add`,`stage`,`push`,`pull`,`fetch`,`checkout`,`switch`,`merge`,`rebase`,`reset`,`stash`,`tag`,`clone`,`worktree`,`cherry-pick`,`restore`,`apply`,`init`,`remote`,`config`,`update-ref`,`for-each-ref`]),st=new Set([`run`,`run-script`,`test`,`install`,`ci`,`i`,`add`,`exec`,`start`,`dlx`]),ct=[[/^(test|tests|test:.*|vitest|jest|spec)$/,`activity.testing`],[/^(build|compile|bundle|dist)$/,`activity.building`],[/^(typecheck|tsc|types?)$/,`activity.typechecking`],[/^(lint|lint:.*|eslint|format|fmt|prettier)$/,`activity.linting`]],lt=new Set([`vitest`,`jest`,`pytest`,`mocha`,`ava`,`rspec`,`phpunit`]);function ut(e){for(let[t,n]of ct)if(t.test(e))return n;return null}function dt(e){return e.split(/\s+/).map(e=>e.replace(/^['"`]+/,``).replace(/['"`]+$/,``)).filter(e=>e.length>0&&!e.startsWith(`-`))}function ft(e){let t=dt(e);if(t.length===0)return{kind:`plumbing`};let n=t[0].split(`/`).pop()??t[0],r=t.slice(1);if(it.has(n))return{kind:`plumbing`};if(lt.has(n))return{kind:`intent`,code:`activity.testing`};if((n===`npx`||n===`pnpm`||n===`yarn`||n===`bunx`)&&r.length>0){let e=r[0]===`dlx`||r[0]===`exec`?r[1]??``:r[0];if(lt.has(e))return{kind:`intent`,code:`activity.testing`};let t=ut(e===`run`?r[r.indexOf(`run`)+1]??``:e);if(t)return{kind:`intent`,code:t};if(e===`tsc`)return{kind:`intent`,code:`activity.typechecking`}}if(n===`npm`||n===`yarn`||n===`pnpm`||n===`bun`){let e=r.findIndex(e=>st.has(e)),t=e===-1?``:r[e];if(t===`install`||t===`ci`||t===`i`||t===`add`)return{kind:`intent`,code:`activity.installing`};let i=ut(t===`run`||t===`run-script`?r[e+1]??``:t);return i?{kind:`intent`,code:i}:{kind:`named`,tool:n}}if(n===`git`){let e=r.find(e=>ot.has(e))??``;return at.has(e)?{kind:`plumbing`}:e===`commit`||e===`add`||e===`stage`?{kind:`intent`,code:`activity.savingWork`}:{kind:`named`,tool:n}}if(n===`cargo`||n===`go`||n===`dotnet`||n===`mvn`||n===`gradle`){let e=r.find(e=>e===`test`||e===`build`||e===`compile`)??``;return e===`test`?{kind:`intent`,code:`activity.testing`}:e===`build`||e===`compile`?{kind:`intent`,code:`activity.building`}:{kind:`named`,tool:n}}return n===`tsc`?{kind:`intent`,code:`activity.typechecking`}:n===`openspec`?{kind:`intent`,code:`activity.checkingSpec`}:{kind:`named`,tool:n}}function pt(e){try{let t=JSON.parse(e);return t&&typeof t==`object`&&!Array.isArray(t)?t:{}}catch{return{}}}function mt(e,t){return e&&/^main-\d+$/.test(e)?`step.role.work`:e===`verify`?`step.role.verify`:e===`decide`||t===`decider`?`step.role.decide`:e===`fix`?`step.role.fix`:null}function ht(e){return e.replace(/^[^\p{L}\p{N}(]+/u,``).trim()}var Z=e=>typeof e==`number`&&Number.isFinite(e)?e:null,Q=e=>typeof e==`string`&&e.length>0?e:null,gt=new Set([`thinking`,`reasoning`]),_t=/^(MEMORY\.md|confidence-score\.json|design-confidence\.json|\d{4}-\d{2}-\d{2}-.+|feedback_.+)$/,vt=/^(proposal|design|tasks|spec|context-bundle)\.md$/,yt=new Set([`reading`,`writing`,`editing`]);function $(e,t,n,r,i){for(let t=e.length-1;t>=0;t--){let a=e[t];if(a.kind!==`activity`){if(a.stepIndex!==n)break;continue}if(a.stepIndex!==n)break;if(a.values.action===r&&a.values.target===i){a.values.repeats=Number(a.values.repeats??1)+1;return}}e.push({seq:t,kind:`activity`,code:r===`intent`?i:i?`activity.${r}`:`activity.${r}Bare`,values:{action:r,target:i,repeats:1},stepIndex:n,tone:`neutral`})}var bt=3;function xt(e,t,n,r,i){for(let t=e.length-1;t>=0;t--){let a=e[t];if(a.stepIndex!==n)break;if(a.kind!==`activity`||a.values.action!==r||a.values.fileGroup!==1)continue;let o=String(a.values.allNames??``).split(`\0`).filter(Boolean),s=!!i&&!o.includes(i);s&&o.push(i),a.values.allNames=o.join(`\0`),a.values.files=o.length;let c=String(a.values.names??``).split(`, `).filter(Boolean);s&&c.length<bt&&(c.push(i),a.values.names=c.join(`, `)),a.code=o.length>1?`activity.${r}Files`:i?`activity.${r}`:`activity.${r}Bare`,a.values.repeats=o.length>1?1:Number(a.values.repeats??1)+1;return}e.push({seq:t,kind:`activity`,code:i?`activity.${r}`:`activity.${r}Bare`,values:{action:r,target:i,names:i,allNames:i,files:+!!i,fileGroup:1,repeats:1},stepIndex:n,tone:`neutral`})}function St({events:e,settled:t}){let n=[],r=new Map,i=null,a=!1;for(let t of e){if(t.event_type===`loop_graph`){a=!0;continue}if(t.event_type===`loop_step`){let e=pt(t.payload),o=Z(e.index);if(o===null)continue;a=!0;let s=Q(e.kind)??`ai-step`,c={index:o,title:ht(Q(e.title)??``),roleCode:mt(Q(e.nodeId),s),kind:s,iteration:Z(e.iteration),ended:!1};r.set(o,c),i=o;let l=Z(e.attempt);n.push({seq:t.seq,kind:`step-start`,code:l!==null&&l>1?`step.startResume`:c.iteration&&c.iteration>1?`step.startRetry`:`step.start`,values:{step:o,title:c.title,iteration:c.iteration??1,...l!==null&&l>1?{attempt:l}:{},...c.roleCode?{roleCode:c.roleCode}:{}},stepIndex:o,tone:`neutral`});continue}if(t.event_type===`loop_step_end`){let e=pt(t.payload),i=Z(e.index);if(i===null)continue;let a=i===null?void 0:r.get(i);a&&(a.ended=!0);let o=Q(e.status),s=Z(e.durationMs),c=Z(e.exitCode),l=Z(e.idleMs),u=o===`stalled`,d=o===`failed`||u,f=o===`failed`&&Q(e.reason)===`provider_limit`;n.push({seq:t.seq,kind:`step-end`,code:u?`step.stalled`:f?`step.providerLimit`:d?`step.failed`:s===null?`step.done`:s>=9e4?`step.doneTimedMin`:`step.doneTimed`,values:{step:i,title:a?.title??``,seconds:s===null?0:Math.max(1,Math.round(s/1e3)),minutes:s===null?0:Math.max(1,Math.round(s/6e4)),...u?{idleMinutes:l===null?0:Math.max(1,Math.round(l/6e4))}:{},...a?.roleCode?{roleCode:a.roleCode}:{},...c===null?{}:{exitCode:c}},stepIndex:i,tone:d?`bad`:`good`});let p=Q(e.decision);(p===`continue`||p===`stop`)&&n.push({seq:t.seq,kind:`decision`,code:p===`continue`?`decision.another`:`decision.satisfied`,values:{step:i},stepIndex:i,tone:p===`continue`?`neutral`:`good`});continue}let e=z(t);if(!(!e.step||!e.actionKey)&&!gt.has(e.actionKey)){if(e.actionKey===`running`){let r=I(t),a=r?ft(r):{kind:`named`,tool:e.actionArg??``};if(a.kind===`plumbing`){$(n,t.seq,i,`exploring`,``);continue}if(a.kind===`intent`){$(n,t.seq,i,`intent`,a.code);continue}$(n,t.seq,i,`running`,a.tool);continue}if(yt.has(e.actionKey)){let r=e.actionArg??``;if(_t.test(r)){$(n,t.seq,i,`intent`,`activity.bookkeeping`);continue}if(vt.test(r)){$(n,t.seq,i,`intent`,`activity.writingSpec`);continue}xt(n,t.seq,i,e.actionKey,r);continue}$(n,t.seq,i,e.actionKey,e.actionArg??``)}}if(t)for(let e of r.values())e.ended||n.push({seq:2**53-1-(1e3-e.index),kind:`step-interrupted`,code:`step.interrupted`,values:{step:e.index,title:e.title},stepIndex:e.index,tone:`bad`});return{milestones:n,stepCount:r.size,plainJob:!a}}var Ct={"step-start":le,"step-end":m,"step-interrupted":w,decision:ae,activity:le},wt={neutral:`text-muted-foreground`,good:`text-accent-success`,bad:`text-accent-warning`};function Tt({events:e,settled:t,durationRange:n,elapsedMs:r,variant:i=`page`}){let{t:a}=l(`narration`),o=(0,U.useMemo)(()=>St({events:e,settled:t}),[e,t]),s=(0,U.useMemo)(()=>[...o.milestones].sort((e,t)=>e.seq-t.seq),[o.milestones]);return(0,H.jsxs)(`div`,{className:i===`glass`?`flex h-full flex-col overflow-hidden`:`flex flex-col`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 border-b border-border/50 px-3 py-2 text-[11px] text-muted-foreground`,children:[typeof r==`number`&&r>0?(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,H.jsx)(ue,{className:`size-3`,"aria-hidden":!0}),a(`waiting.elapsed`,{minutes:Math.max(1,Math.round(r/6e4))})]}):null,n?(0,H.jsx)(`span`,{"data-testid":`narration-range`,children:a(`waiting.range`,{low:Math.max(1,Math.round(n.p25Ms/6e4)),high:Math.max(1,Math.round(n.p75Ms/6e4)),count:n.sampleCount})}):null,(0,H.jsx)(`span`,{className:`ml-auto italic opacity-70`,children:a(`aiNote`)})]}),(0,H.jsx)(`ol`,{className:`flex-1 space-y-1 px-3 py-2 ${i===`glass`?`overflow-y-auto`:``}`,"data-testid":`narration-list`,children:s.length===0?(0,H.jsx)(`li`,{className:`py-6 text-center text-xs text-muted-foreground`,children:a(t?`emptySettled`:`emptyLive`)}):s.map((e,t)=>{let n=Ct[e.kind],r=e.kind===`step-start`||e.kind===`step-end`||e.kind===`step-interrupted`,i=Number(e.values.files??0)>1?1:Number(e.values.repeats??1);return(0,H.jsxs)(`li`,{className:`flex items-start gap-2 text-sm ${r?`font-medium text-foreground`:`text-muted-foreground`} ${e.kind===`step-start`&&t>0?`pt-2`:``}`,children:[(0,H.jsx)(n,{className:`mt-0.5 size-3.5 shrink-0 ${wt[e.tone]}`,"aria-hidden":!0}),(0,H.jsxs)(`span`,{children:[e.kind===`step-start`&&typeof e.values.roleCode==`string`?a(e.code,{...e.values,title:a(e.values.roleCode),defaultValue:e.code}):a(e.code,{...e.values,defaultValue:e.code}),i>1?(0,H.jsx)(`span`,{className:`ml-1.5 text-[11px] opacity-70`,children:a(`repeats`,{count:i})}):null]})]},`${e.seq}-${e.code}-${t}`)})})]})}var Et=`specrails-desktop:job-log-mode`;function Dt(){try{let e=localStorage.getItem(Et);return e===`log`||e===`narrated`?e:`narrated`}catch{return`narrated`}}function Ot(e){try{localStorage.setItem(Et,e)}catch{}}function kt(e,t){switch(t.type){case`turn-user`:return{...e,streaming:!0,accepting:!0,queued:t.queued?e.queued+1:e.queued};case`turn-done`:{let n=Math.max(0,e.queued-1);return{...e,totals:t.totals,queued:n,streaming:e.queued>0}}case`finalized`:return{...e,streaming:!1,finalizing:!1,accepting:!1,queued:0,totals:t.totals??e.totals};case`accepting`:return t.accepting?{...e,accepting:!0}:{...e,accepting:!1,streaming:!1,queued:0};case`finalize-request`:return{...e,finalizing:!0};case`finalize-reject`:return{...e,finalizing:!1};case`blocked`:return{...e,accepting:!1,streaming:!1};default:return e}}function At(){try{return c()}catch{return null}}function jt({jobId:e,projectId:t,settleMode:n,initialAcceptingTurns:r,kind:i=`job`,variant:a=`page`,onFinalized:o}){let{t:c}=l(`jobs`),u=n??`finalize`,f=()=>t?`${s}/api/projects/${t}`:d(),[m,h]=(0,U.useReducer)(kt,{streaming:!1,queued:0,totals:null,accepting:r??!0,finalizing:!1}),[g,_]=(0,U.useState)(``),[v,y]=(0,U.useState)(!1),x=(0,U.useRef)(null);(0,U.useEffect)(()=>{r!==void 0&&h({type:`accepting`,accepting:r})},[r]);let S=(0,U.useRef)(o);S.current=o;let C=At(),w=(0,U.useId)();(0,U.useEffect)(()=>{if(!C)return;let t=`interactive-composer-${e}-${w}`;return C.registerHandler(t,t=>{let n=t;n.jobId===e&&(n.type===`job.turn_user`?h({type:`turn-user`,queued:!!n.queued}):n.type===`job.turn_done`?h({type:`turn-done`,totals:n.totals}):n.type===`job.finalized`?(h({type:`finalized`,totals:n.totals??null}),S.current?.()):n.type===`job.interactive`&&h({type:`accepting`,accepting:!!n.acceptingTurns}))}),()=>C.unregisterHandler(t)},[C,e,w]);let T=i===`loop-step`&&!m.accepting;async function D(){let t=g.trim();if(!(!t||v||T)){y(!0);try{let n=await fetch(`${f()}/jobs/${e}/messages`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({text:t})});if(n.ok)_(``),requestAnimationFrame(()=>x.current?.focus());else if(n.status===409&&i===`loop-step`)h({type:`blocked`});else{let e=await n.json().catch(()=>({}));p.error(c(`detail.toast.sendFailed`),{description:e.error})}}catch{p.error(c(`detail.toast.networkError`))}finally{y(!1)}}}async function O(){if(!m.finalizing){h({type:`finalize-request`});try{let t=await fetch(`${f()}/jobs/${e}/finalize`,{method:`POST`});if(t.ok)p.success(c(u===`finalize`?`detail.toast.finalizeScheduled`:i===`loop-step`?`detail.toast.wrapUpStepScheduled`:`detail.toast.wrapUpScheduled`));else if(t.status===409&&i===`loop-step`)h({type:`blocked`}),h({type:`finalize-reject`});else{let e=await t.json().catch(()=>({}));p.error(c(`detail.toast.finalizeFailed`),{description:e.error}),h({type:`finalize-reject`})}}catch{p.error(c(`detail.toast.networkError`)),h({type:`finalize-reject`})}}}let A=v||T||!g.trim(),j=c(`detail.interactive.working`);return(0,H.jsxs)(`div`,{"data-testid":`interactive-job-composer`,className:E(`shrink-0 border-t px-3 py-2 space-y-1.5`,`motion-safe:animate-in motion-safe:fade-in motion-safe:slide-in-from-bottom-2 motion-safe:duration-300`,a===`glass`?`border-border/30 bg-surface/30`:`border-border/40 bg-surface/40`),children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-[11px] text-muted-foreground`,children:[(0,H.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[T?(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,H.jsx)(de,{className:`h-3 w-3 motion-safe:animate-pulse`}),c(`detail.interactive.waitingForStepShort`)]}):m.streaming?(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,H.jsx)(b,{className:`h-3 w-3 animate-spin text-accent-primary`}),(0,H.jsxs)(`span`,{className:`relative`,children:[j,(0,H.jsx)(`span`,{"aria-hidden":!0,className:`title-shimmer pointer-events-none absolute inset-0`,children:j})]})]}):(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,H.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-accent-success motion-safe:animate-pulse`}),c(`detail.interactive.ready`)]}),m.queued>0&&(0,H.jsx)(`span`,{className:`rounded-full border border-accent-info/30 bg-accent-info/10 px-1.5 py-px text-[10px] tabular-nums text-accent-info motion-safe:animate-in motion-safe:fade-in`,children:c(`detail.interactive.queued`,{count:m.queued})})]}),(0,H.jsxs)(`span`,{className:`flex shrink-0 items-center gap-3`,children:[m.totals&&(0,H.jsx)(`span`,{className:`tabular-nums`,children:c(`detail.interactive.liveTotals`,{turns:m.totals.num_turns,cost:m.totals.total_cost_usd.toFixed(4)})}),u===`finalize`?(0,H.jsxs)(P,{children:[(0,H.jsx)(F,{asChild:!0,children:(0,H.jsxs)(k,{variant:`outline`,size:`sm`,onClick:()=>void O(),disabled:m.finalizing,className:`h-7 border-accent-success/40 text-accent-success hover:bg-accent-success/10`,children:[(0,H.jsx)(L,{className:`mr-1.5 h-3.5 w-3.5`}),m.finalizing?c(`detail.finalizing`):c(`detail.finalizeJob`)]})}),(0,H.jsx)(V,{children:c(`detail.finalizeJobTooltip`)})]}):(0,H.jsxs)(P,{children:[(0,H.jsx)(F,{asChild:!0,children:(0,H.jsx)(`button`,{type:`button`,onClick:()=>void O(),disabled:m.finalizing||T,className:E(`text-[11px] underline-offset-2 transition-colors`,T?`cursor-not-allowed text-muted-foreground/40`:`text-muted-foreground hover:text-accent-success hover:underline`),children:m.finalizing?c(`detail.interactive.wrappingUp`):c(i===`loop-step`?`detail.interactive.wrapUpStep`:`detail.interactive.wrapUp`)})}),(0,H.jsx)(V,{children:c(i===`loop-step`?`detail.interactive.wrapUpStepTooltip`:`detail.interactive.wrapUpTooltip`)})]})]})]}),u===`auto`&&(0,H.jsx)(`p`,{className:`text-[11px] leading-snug text-muted-foreground/60`,children:c(T?`detail.interactive.waitingForStep`:`detail.interactive.autoHint`)}),(0,H.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,H.jsx)(`textarea`,{ref:x,value:g,onChange:e=>_(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(!e.shiftKey||e.metaKey||e.ctrlKey)&&(e.preventDefault(),D())},rows:2,placeholder:c(T?`detail.interactive.waitingForStepShort`:`detail.interactive.placeholder`),"aria-label":c(`detail.interactive.placeholder`),disabled:T,className:E(`flex-1 resize-none rounded-md border border-border/50 bg-background px-2.5 py-1.5 text-sm transition-opacity focus:outline-none focus:ring-2 focus:ring-ring`,T&&`opacity-60`)}),(0,H.jsxs)(P,{children:[(0,H.jsx)(F,{asChild:!0,children:(0,H.jsx)(`span`,{className:`shrink-0`,children:(0,H.jsxs)(k,{size:`sm`,onClick:()=>void D(),disabled:A,className:`h-9`,children:[(0,H.jsx)(re,{className:`mr-1.5 h-3.5 w-3.5`}),c(`detail.interactive.send`)]})})}),A&&!v&&(0,H.jsx)(V,{children:c(T?`detail.interactive.sendDisabledWaiting`:`detail.interactive.sendDisabledEmpty`)})]})]})]})}export{rt as a,ue as c,Tt as i,Dt as n,Oe as o,Ot as r,fe as s,jt as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-CNC7AqOf.js";var t=e({activeJob:()=>f,comparison:()=>u,default:()=>h,detail:()=>o,logViewer:()=>m,loopExplorer:()=>p,modal:()=>l,page:()=>a,recent:()=>d,statusLabel:()=>n,statusName:()=>i,statusPanel:()=>s,statusTooltip:()=>r,ticketHeader:()=>c}),n={running:`running`,completed:`completed`,done:`done`,failed:`failed`,canceled:`canceled`,queued:`queued`,zombie:`zombie`,skipped:`skipped`},r={running:`Job is actively executing`,completed:`Job completed successfully`,failed:`Job exited with a non-zero exit code`,canceled:`Job was manually canceled`,queued:`Job is waiting in the queue`,queuedToRun:`Job is waiting to run`,zombie:`Job was auto-terminated after prolonged inactivity`,skipped:`Job was skipped because a parent job in the pipeline failed`},i={running:`running`,completed:`completed`,failed:`failed`,canceled:`canceled`,zombie_terminated:`zombie`,queued:`queued`,skipped:`skipped`},a={title:`Jobs`,exportJobs:`Export Jobs`,proposalDeleted:`Proposal deleted`,proposal:{title:`Proposal`,noContent:`No proposal content yet.`,githubIssue:`GitHub Issue:`,status:{input:`Awaiting input`,exploring:`Exploring`,review:`Ready for review`,refining:`Refining`,creatingIssue:`Creating issue`,created:`Created`,cancelled:`Cancelled`,unknown:`Unknown status: {{status}}`}}},o={breadcrumbDashboard:`Dashboard`,breadcrumbJob:`Job #{{id}}`,notFound:`Job not found`,notFoundDescription:`The job ID "{{id}}" doesn't exist`,backToDashboard:`Back to Dashboard`,startedAgo:`Started {{timeAgo}}`,queuedWaiting:`Queued — waiting to start`,exportDiagnostic:`Export diagnostic`,exportDiagnosticAria:`Export diagnostic bundle`,exportDiagnosticTooltip:`Download ZIP with telemetry, logs, and summary for this job`,reExecute:`Re-execute`,reExecuteTooltip:`Spawn a new job with the same command`,cancelJob:`Cancel Job`,cancelJobTooltip:`Send SIGTERM to the running process. The job will be marked as canceled.`,cancelInteractive:`Discard`,finalizeJob:`Finalize Job`,finalizing:`Finalizing…`,finalizeJobTooltip:`End this interactive session and roll every turn's tokens and cost into the job total.`,interactive:{ready:`Ready — send a prompt`,working:`Agent working…`,placeholder:`Send a message to the running job…`,send:`Send`,liveTotals:"{{turns}} turns · ${{cost}}",autoHint:`This job follows its plan and finishes on its own — messages are optional steering.`,wrapUp:`Wrap up now`,wrapUpTooltip:`End the session now — the job completes with the work produced so far, every turn's tokens and cost rolled into the total.`,wrapUpStep:`Settle this step`,wrapUpStepTooltip:`End the current step now — the loop advances with what the step has produced so far.`,wrappingUp:`Wrapping up…`,queued_one:`{{count}} queued message`,queued_other:`{{count}} queued messages`,waitingForStep:`Between steps — the loop is deciding what runs next. You can send a message when the next AI step starts.`,waitingForStepShort:`Waiting for the next step…`,sendDisabledEmpty:`Type a message first`,sendDisabledWaiting:`No active step session right now`},toast:{jobDeleted:`Job deleted`,cancelSignalSent:`Cancel signal sent`,cancelSignalSentDescription:`Job will stop at the next safe point`,failed:`Failed`,networkError:`Network error`,exportFailed:`Export failed`,exportFailedHttp:`Export failed (HTTP {{status}})`,jobRequeued:`Job re-queued`,spawnFailed:`Failed to spawn job`,finalizeScheduled:`Finalizing interactive job…`,finalizeFailed:`Failed to finalize job`,sendFailed:`Failed to send message`,wrapUpScheduled:`Wrapping up the job…`,wrapUpStepScheduled:`Settling the step — the loop advances with what it produced`}},s={inProgress:`Job in progress`,completed:`Job completed`,failed:`Job failed`,duration:`Duration`,cost:`Cost`,turns:`Turns`,tokens:`Tokens`,filesCount_one:`{{count}} file`,filesCount_other:`{{count}} files`,pipelineTotal:`Pipeline total ({{count}} phases)`,totalCost:`Total cost`,totalTokens:`Total tokens`,filesModified:`Files modified`,zoneInProgress:`In progress`,zoneFinal:`Final summary`,zoneFinalPending:`Final summary — calculated when finished`,pendingCaption:`Calculated when finished`,pendingTooltip:`This is the provider's real figure; it appears when the job finishes.`,costTooltip:`The real cost is billed by the provider when the job closes.`,liveTooltip:`Live`,explainer:`Cost, turns and tokens are the provider's real figures and appear when the job finishes.`,notAvailable:`Not available`,steps_one:`{{count}} step`,steps_other:`{{count}} steps`,activity:{editing:`Editing {{arg}}`,writing:`Writing {{arg}}`,reading:`Reading {{arg}}`,searching:`Searching “{{arg}}”`,running:`Running: {{arg}}`,thinking:`Thinking…`,reasoning:`Reasoning…`,working:`Working…`,connecting:`Connecting to the agent…`,starting:`Starting…`},pipelinePartial:`≥ shown — {{count}} phase(s) have no recorded cost yet`,pipelinePartialTooltip:`Some phases did not report cost, so this total is a lower bound.`,pipelineCostUnavailable:`Cost telemetry is unavailable for every phase.`,pipelineUsageUnavailable:`Token telemetry is unavailable for every phase.`,pipelineUsagePartial:`≥ shown — {{count}} phase(s) have no token telemetry`,pipelineUsageTooltip:`Providers may complete phases without exposing token telemetry; only known usage is included.`},c={showMore:`+ {{count}} more`,showLess:`Show less`,deletedTicket:`#{{id}} (deleted)`,deletedTooltip:`Ticket no longer exists`},l={notFound:`Job not found`,cancelConfirmTitle:`Cancel job?`,cancelConfirmDescription:`The job will stop at the next safe point. This action cannot be undone.`,keepRunning:`Keep running`,cancelJob:`Cancel job`,stopRun:`Stop run`,stopRunConfirmTitle:`Stop this run?`,stopRunConfirmDescription:`The loop run will stop at the next step boundary. This action cannot be undone.`,toast:{cancelSignalSent:`Cancel signal sent`,cancelSignalSentDescription:`Job will stop at the next safe point`,stopSignalSent:`Stop signal sent`,stopSignalSentDescription:`The run will stop at the next step boundary`,cancelFailed:`Failed to cancel`,networkError:`Network error`}},u={title:`Job Comparison`,jobN:`Job {{n}}`,loadFailed:`Failed to load comparison: {{error}}`,duration:`Duration`,cost:`Cost`,tokensOut:`Tokens out`,tokensIn:`Tokens in`,cacheRead:`Cache read`,model:`Model`,phasesDone:`Phases done`,betterValueHint:`Green highlights indicate better value`},d={emptyTitle:`No jobs yet`,emptyDescription:`Run a command above to see your job history here`,loadFailed:`Failed to load jobs`,filterAll:`All ({{count}})`,filterStatus:`{{status}} ({{count}})`,fromDate:`From date`,toDate:`To date`,clear:`Clear`,exitCompareMode:`Exit compare mode`,compareTwoJobs:`Compare 2 jobs`,clearJobs:`Clear jobs`,selectTwoToCompare:`Select 2 jobs to compare`,selectOneMore:`Select 1 more job`,readyToCompare:`Ready — click compare`,compareAction:`Compare →`,colStatus:`Status`,colCommand:`Command`,colDuration:`Duration`,colTokens:`Tokens`,colCost:`Cost`,colStarted:`Started`,profileTooltip:`Profile: {{name}}`,pipelinePart:`Part of a pipeline`,pipelineDependsOn:`(depends on previous step)`,deleteProposal:`Delete proposal`,loadMore:`Load more ({{count}} remaining)`,priority:{critical:`critical`,high:`high`,normal:`normal`,low:`low`},clearModal:{title:`Clear Jobs`,jobsInHistory_one:`{{count}} job in history`,jobsInHistory_other:`{{count}} jobs in history`,clearAll_one:`Clear all {{count}} job`,clearAll_other:`Clear all {{count}} jobs`,orByRange:`Or clear by date range:`,fromPlaceholder:`From`,toPlaceholder:`To`,clearInRange_one:`Clear {{count}} job in range`,clearInRange_other:`Clear {{count}} jobs in range`,clearRange:`Clear range`},deleteProposalConfirm:{title:`Delete proposal?`,description:`This will permanently delete 1 proposal. This action cannot be undone.`},toast:{cleared_one:`Cleared {{count}} job`,cleared_other:`Cleared {{count}} jobs`,clearFailed:`Failed to clear jobs`,networkError:`Network error`}},f={none:`No active job`,noneHint:`Select a command below to start a job`,exitCode:`exit {{code}}`,cancelTooltip:`Send SIGTERM to the running claude process`,viewLogs:`View Logs`,toast:{cancelRequested:`Job cancellation requested`,cancelRequestedDescription:`Sending SIGTERM to the process`,cancelFailed:`Failed to cancel job`,networkError:`Network error canceling job`}},p={setup:`Setup`,iteration:`Iteration {{current}}/{{limit}}`,iterationBadge:`iter {{count}}`,follow:`Following live`,resumeFollow:`Resume follow`,expandAll:`Expand all`,collapseAll:`Collapse all`,copyStep:`Copy step`,copied:`Step copied to clipboard`,stepDetail:`Step details`,stepDetailTemplate:`Template`,stepDetailCommand:`Command`,copyCommand:`Copy`,interrupted:`Interrupted`,waiting:`Waiting for the next step…`,stepMapAria:`Loop step map`,stalled:`Stalled`,stalledIdle_one:`No provider output for {{count}} minute — the app stopped this attempt`,stalledIdle_other:`No provider output for {{count}} minutes — the app stopped this attempt`,providerLimit:`Provider limit`,providerLimitHint:`The provider answered with a usage or rate-limit notice, so the app stopped the run instead of cycling.`},m={loading:`Loading logs...`,empty:`No log output yet`,filterPlaceholder:`Filter logs...`,copySuccess:`Log copied to clipboard`,copyFailed:`Failed to copy log`,lineCount:`{{filtered}} / {{total}} lines`,jumpToBottom:`Jump to bottom`,phaseLines_one:`{{count}} line`,phaseLines_other:`{{count}} lines`,noMatchingLines:`No matching lines`,noOutput:`No output`,completed:`Completed`,turns_one:`{{count}} turn`,turns_other:`{{count}} turns`},h={statusLabel:n,statusTooltip:r,statusName:i,page:a,detail:o,statusPanel:s,ticketHeader:c,modal:l,comparison:u,recent:d,activeJob:f,loopExplorer:p,logViewer:m};export{t};
|