import 'package:pipelines_app/core/api_gateway.dart'; /// `?cli=1`: a coding exchange shaped like a CLI agent session, for design /// reviews of the transcript's tool rows: an operator request, a turn with /// thinking and several tool calls (a command with output, reads, a search, /// a failed edit and its retry) and a closing answer with a list and code. List chatCliMessages(String chat) { var minute = 0; int at() => DateTime.utc(2026, 12, 3, 8, minute += 3).millisecondsSinceEpoch; JsonMap tool( String id, String name, JsonMap input, { String output = '', String? error, int millis = 400, }) => { 'type': 'tool', 'id': '$chat-cli-$id', 'name': name, 'state': { 'status': error == null ? 'completed' : 'error', 'input': input, if (output.isNotEmpty) 'content': [ {'type': 'text', 'text': output}, ], if (error != null) 'error': {'message': error}, }, 'time': {'created': 1764750000000, 'completed': 1764750000000 + millis}, }; return [ { 'id': '$chat-cli-q', 'role': 'user', 'created_at': at(), 'parts': [ { 'type': 'text', 'text': 'The release notes job fails on Windows paths. Find the cause ' 'and fix it.', }, ], }, { 'id': '$chat-cli-a', 'role': 'assistant', 'created_at': at(), 'model': 'claude-opus', 'parts': [ { 'type': 'reasoning', 'text': 'Start from the failing job, then read the path helper.', }, tool( 'bash', 'Bash', {'command': 'go test ./internal/notes/...'}, output: '--- FAIL: TestNotesPath (0.01s)\n' ' notes_test.go:41: got "C:/repo\\\\notes.md"\n' 'FAIL', millis: 2300, ), tool('read', 'Read', { 'file_path': 'internal/notes/path.go', }, output: 'package notes\n\nimport "path"\n…'), tool( 'grep', 'Grep', {'pattern': 'path.Join'}, output: 'internal/notes/path.go:18\ninternal/notes/render.go:52', ), tool('edit1', 'Edit', { 'file_path': 'internal/notes/path.go', }, error: 'old_string not found in file'), tool('edit2', 'Edit', { 'file_path': 'internal/notes/path.go', }, output: 'Updated internal/notes/path.go (2 lines)'), tool( 'bash2', 'Bash', {'command': 'go test ./internal/notes/...'}, output: 'ok \tpipelines/internal/notes\t0.214s', millis: 1900, ), { 'type': 'text', 'text': 'Fixed. The notes job joined paths with `path.Join`, which ' 'always uses forward slashes, so a Windows checkout produced ' 'mixed separators.\n\n' '- `internal/notes/path.go` now uses `filepath.Join`\n' '- `TestNotesPath` passes on both separators\n\n' '```go\nreturn filepath.Join(root, name+".md")\n```', }, ], }, ]; }