diff --git a/NucleicRemote/NucleicRemote/Models/RemoteStore.swift b/NucleicRemote/NucleicRemote/Models/RemoteStore.swift index 6ceabc8..d237e58 100644 --- a/NucleicRemote/NucleicRemote/Models/RemoteStore.swift +++ b/NucleicRemote/NucleicRemote/Models/RemoteStore.swift @@ -627,6 +627,9 @@ final class RemoteStore: ObservableObject { // A realistic `git commit` (heredoc message) so the transcript's structured commit card // is exercisable offline: expand the Bash call to see the subject + Markdown body. let demoCommitCommand = "git commit -F - <<'EOF'\nfix: harden auth middleware\n\nRequire a Bearer token and reject a missing or blank one.\n\n- extract `requireSession`\n- add a `Bearer` prefix check\nEOF" + // A multi-step, destructive shell pipeline so the transcript's step list (with the delete + // flagged in red) is exercisable offline: expand the Bash call to see the breakdown. + let demoCleanupCommand = "cd ~/code/nucleic && rm -rf .worktrees/auth-old && git worktree prune && git branch -D nucleic/auth-old" openEvents = [ event(1, .sessionStarted(SessionStarted( backendSessionID: "demo", model: "claude-opus-4-8[1m]", cwd: "~/code/nucleic", toolNames: []))), @@ -645,8 +648,11 @@ final class RemoteStore: ObservableObject { event(14, .toolCallStarted(ToolCall(toolCallID: "t4", name: "Bash", input: ["command": .string(demoCommitCommand)]))), event(15, .toolCallCompleted(ToolCall(toolCallID: "t4", name: "Bash", input: ["command": .string(demoCommitCommand)]))), event(16, .toolResult(ToolResult(toolCallID: "t4", content: "[nucleic/auth-refactor 1a2b3c4] fix: harden auth middleware\n 2 files changed, 312 insertions(+), 40 deletions(-)", isError: false))), - event(17, .usage(Usage(inputTokens: 84_300, outputTokens: 2_140, costUSD: 0.0421, contextInputTokens: 84_300))), - event(18, .runFinished(RunFinished(outcome: .completed, finalText: "Done."))), + event(17, .toolCallStarted(ToolCall(toolCallID: "t5", name: "Bash", input: ["command": .string(demoCleanupCommand)]))), + event(18, .toolCallCompleted(ToolCall(toolCallID: "t5", name: "Bash", input: ["command": .string(demoCleanupCommand)]))), + event(19, .toolResult(ToolResult(toolCallID: "t5", content: "Removed 1 worktree; deleted branch nucleic/auth-old.", isError: false))), + event(20, .usage(Usage(inputTokens: 84_300, outputTokens: 2_140, costUSD: 0.0421, contextInputTokens: 84_300))), + event(21, .runFinished(RunFinished(outcome: .completed, finalText: "Done."))), ] // If this session is blocked on a human, surface a real approval card so the // Allow/Deny loop is exercisable in the demo (the seeded `a1` session). diff --git a/NucleicRemote/NucleicRemote/Views/ApprovalCardView.swift b/NucleicRemote/NucleicRemote/Views/ApprovalCardView.swift index b8a09bb..8bdbad9 100644 --- a/NucleicRemote/NucleicRemote/Views/ApprovalCardView.swift +++ b/NucleicRemote/NucleicRemote/Views/ApprovalCardView.swift @@ -40,9 +40,10 @@ struct ApprovalCardView: View { if let command = approval.input["command"]?.stringValue, let commit = GitCommitSummary.parse(command) { GitCommitCard(commit: commit, rawCommand: command) - } else if approval.toolName == HostCommandSummary.hostExecToolName, - let command = approval.input["command"]?.stringValue, - let parsed = HostCommandSummary.summary(for: command) { + } else if let command = approval.input["command"]?.stringValue, + let parsed = HostCommandSummary.summary(for: command), + approval.toolName == HostCommandSummary.hostExecToolName + || parsed.invocations.count > 1 || parsed.isDestructive { HostCommandBreakdown(summary: parsed) Text("Exact command").font(.caption2.weight(.semibold)).foregroundStyle(.secondary) ApprovalDetailBox(text: command) diff --git a/NucleicRemote/NucleicRemote/Views/Transcript/ToolGroupRow.swift b/NucleicRemote/NucleicRemote/Views/Transcript/ToolGroupRow.swift index f097150..3eda77d 100644 --- a/NucleicRemote/NucleicRemote/Views/Transcript/ToolGroupRow.swift +++ b/NucleicRemote/NucleicRemote/Views/Transcript/ToolGroupRow.swift @@ -49,10 +49,16 @@ struct ToolCallCard: View { @ViewBuilder private var details: some View { let input = group.input.approvalDetail - // A git commit reads as a structured commit card (subject + Markdown body), like the Mac — - // the raw command stays one tap away under "Show command". + // A git commit reads as a structured commit card (subject + Markdown body); a multi-step or + // destructive shell pipeline reads as a compact step list (deletes flagged in red) — both + // like the Mac, with the literal command one tap away under "Show command". Everything else + // keeps the plain input block. if isShellTool, let commit = GitCommitSummary.parse(input) { GitCommitCard(commit: commit, rawCommand: input) + } else if isShellTool, let summary = HostCommandSummary.summary(for: input), + summary.invocations.count > 1 || summary.isDestructive { + HostCommandBreakdown(summary: summary, showPurpose: false) + CommandDisclosure(command: input, accent: Palette.accent) } else if !input.isEmpty { ToolBlock(label: "Input", text: input, mono: true) }