Dashboard › cli › Distillation
d15234d3-ad7b-43dc-adce-5cbc85e26e9b["lore_tm_v1_wqIcptVGYlfqje0oFU0NA12rdVlgTN-cL_ty_6GCjH8","lore_tm_v1_gtDJtVo4WvB0xg8-qIHD1-W3op8TI_bzlutFB6faydE","lore_tm_v1_FgWZaDiPLGOpzZCZ5hLKk2uoCSPrsHrtwGK1vejZUQ8","lore_tm_v1_BuNtVCgOumwqz4uAp1aonzc6sFBZ0yf8GLZsUGb18WY"]
β (\u2502).packages/cli/src/lib/formatters/markdown.ts is a custom marked-token Markdown-to-terminal renderer using chalk; it replaces marked-terminal to eliminate its approximately 970KB dependency chain (cli-highlight, node-emoji, cli-table3, parse5) and delegates tables to text-table.js for OpenTUI-inspired column fitting and Unicode box-drawing borders.packages/cli/src/lib/formatters/markdown.ts preserves pre-rendered ANSI escape codes because string-width treats them as zero-width, imports isPlainOutput and stripAnsi from ./plain-detect.js, and re-exports isPlainOutput for compatibility with existing importers.escapeMarkdownCell() in packages/cli/src/lib/formatters/markdown.ts collapses newlines to spaces, escapes backslashes and pipes, and backslash-escapes < and > so content such as Expected <string> is not parsed as HTML and silently dropped by renderHtmlToken.escapeMarkdownInline() escapes backslashes plus CommonMark-sensitive *, _, backticks, [, ], <, and >; angle-bracket escaping protects content such as Expected <string> got <number> from becoming dropped HTML tokens.safeCodeSpan() wraps content in backticks, replaces embedded backticks with Λ (\u02CB), replaces literal pipes with β (\u2502), and collapses newlines to spaces.mdTableHeader() treats column names ending in : as right-aligned, strips the trailing colon from the displayed name, and emits ---: for those separators versus --- for other columns.mdRow() sends every cell through renderInlineMarkdown(), replaces literal | characters with β, and emits a pipe-delimited row ending in \n; rendered and plain modes use the same pipeline, with plain mode stripping ANSI.mdKvTable() optionally emits a ### ${heading} heading, then a two-column | | | / |---|---| table whose rows are | **Label** | value |; values have newlines collapsed to spaces and pipes replaced by β, while callers remain responsible for escaping content characters such as <>, \, _, *, and backticks.divider(width = 80) repeats β (\u2500) for the requested width and returns it plain when isPlainOutput() is true or through muted() otherwise.red, green, yellow, blue, magenta, cyan, muted, and bu; the first seven map through chalk.hex(COLORS.<name>), while bu applies chalk.bold.underline. COLOR_TAG_RE is compiled once at module scope, case-insensitively matches paired supported tags across newlines, and colorTag("red", "ERROR") produces <red>ERROR</red>.packages/cli/src/app.ts registers agent-conversation as conversationRoute and keeps hidden backward-compatible plural alias agent-conversations mapped directly to conversationListCommand.PLURAL_TO_SINGULAR in packages/cli/src/app.ts maps: agent-conversations β agent-conversation, dashboards β dashboard, events β event, issues β issue, orgs β org, platforms β platform, projects β project, releases β release, repos β repo, teams β team, logs β log, monitors β monitor, replays β replay, spans β span, traces β trace, and trials β trial.packages/cli/src/app.ts uses defaultCommand: "help" and documents the application as A gh-like CLI for Sentry, with a full description identifying sentry as a CLI for authentication, viewing issues, and making API calls.agent-conversations, dashboards, events, issues, orgs, platforms, projects, replays, releases, repos, teams, logs, monitors, spans, traces, trials, sourcemaps, whoami, send-event, send-envelope, and bash-hook.routesWithDefaultCommand is derived at module load from routes.getAllEntries() by selecting route maps whose getDefaultCommand?.() is truthy and collecting each entryβs name.original, avoiding a manually maintained list.detectBareRouteGroup() identifies at most one non-flag argument that belongs to routesWithDefaultCommand and emits Usage: sentry ${route} <command> [args]\nRun "sentry ${route} --help" to see available commands, applying warning() only when ANSI color is enabled.detectPluralAliasMisuse() checks the first argument against PLURAL_TO_SINGULAR and suggests sentry ${singular} ${rest}, applying warning() in ANSI mode.apps/cli-docs/src/fragments/commands/agent-conversation.md is empty (0 lines).packages/cli/test/commands/agent-conversation/view.test.ts tests sentry agent-conversation view with Vitest and mocked api-client.js, db/auth.js, polling.js, and resolve-target.js; withProgress is mocked as a spinner-free passthrough.ORG = "test-org", CONVERSATION_ID = "conv-abc-123", auth token sntrys_test with source oauth, project my-project, project ID 42, model gpt-4, total tokens "100", and two sample spans.makeSpan() fixture defaults to span ID aabb112233445566, trace 00112233445566778899aabbccddeeff, span name gen_ai.invoke_agent, status ok, timestamps 1_716_500_000β1_716_500_010, explicit operation type ai_client, user content hi, and assistant content hello; the second sample span uses ID ccdd112233445566, timestamps 1_716_500_020β1_716_500_030, user content what is 2+2?, and assistant content 4.test-org/conv-abc-123 resolves the explicit org and calls getConversationSpans("test-org", "conv-abc-123"); a bare conversation ID auto-resolves org and, in the fixture, calls getConversationSpans("auto-org", "conv-abc-123").${ORG}/${CONVERSATION_ID}/extra, ${ORG}//${CONVERSATION_ID}, ${ORG}/${CONVERSATION_ID}/, /${CONVERSATION_ID}, and ${ORG}/ to throw ValidationError with field conversation-id and usage text containing sentry agent-conversation view [<org>/]<conversation-id> before either resolveOrg or getConversationSpans is called.ContextError mentioning Conversation ID, and unresolved organization to throw ContextError mentioning organization.conversationId = "conv-abc-123", org = "test-org", spanCount = 2, and an array-valued turns; human output must contain both the conversation ID and organization.truncated field for both true and false.