Dashboard › cli › Distillation
ce546650-1ac1-47df-ba21-8d9053808555["lore_tm_v1_aLyL7uUfuJ7DhMW-i6ugIW38w3ScbG6JZq3m9UWkRHI","lore_tm_v1_iVI-wbUT0LF14Hxs575bzCLcgmq5Osj9DFUaK76rzL8","lore_tm_v1_IxJS7YRKXlVKIxD9UPxL7Zvd6xwfEm_Ka66cyW6g04k","lore_tm_v1_JDhSkG2nIW9St8Uo89oaodvj_54dz6cvspEvBvOClRM","lore_tm_v1_64yTcrR33DLiLF6eakVRi2EQ-SBqi9BmPsGjMmWWCiI","lore_tm_v1_03ZZu6THxStq8NgWbqf_nUgJgS4JBF4atWsrNzt16nQ","lore_tm_v1_w7flBAdEPh0o__HTBFrOl9RmyUFQPT6I7zVgy8ycerI","lore_tm_v1_adzZ4h8X6VUrfA7OObW2R4j_Lf2atFQ-k-xUlgfTT48","lore_tm_v1_sHwlgsN5Sj05iPG4DcCHEyK3VI3wdLA-d_aET914XtU"]
org=".." normalizes the pathname to /api/0/agents/conversations/conv/, with search ?per_page=1000 and an empty hash.org="acme?x=y" truncates the pathname to /api/0/organizations/acme and interprets ?x=y/agents/conversations/conv/?per_page=1000 as the search string, with an empty hash.org="acme#frag" truncates the pathname to /api/0/organizations/acme and interprets #frag/agents/conversations/conv/?per_page=1000 as the hash, with an empty search string.packages/cli/src/lib/formatters/markdown.ts function renderTableToken(table: Tokens.Table) renders headers and rows via renderInline(cell.tokens), maps table alignment values to "right", "center", or default "left", and delegates to renderTextTable(headers, rows, { alignments }).renderMarkdown(md) in packages/cli/src/lib/formatters/markdown.ts uses marked.lexer(md ?? "") and renderBlocks(tokens) in both output modes. Plain mode applies stripAnsi(...).trimEnd() to preserve structural formatting such as headings, aligned tables, blockquote indentation, and lists without raw CommonMark or ANSI; rendered mode applies .trimEnd() without stripping ANSI.renderInlineMarkdown(md) uses marked.lexer(md ?? ""), flattens tokens through tokens.flatMap(flattenInline), renders them with renderInline(), and conditionally returns stripAnsi(rendered) when isPlainOutput() is true.flattenInline(token) unwraps tokens containing nested tokens, except token types "strong", "em", and "link"; otherwise it returns the original token in a one-element array.renderCodespan(token) returns unpadded token.text in plain mode so table widths are not inflated; in TTY mode it renders ` ${token.text} ` with chalk.bgHex(COLORS.codeBg).hex(COLORS.codeFg).renderOneInline(token) behavior in packages/cli/src/lib/formatters/markdown.ts: "strong" uses chalk.bold; "em" uses chalk.italic; "codespan" delegates to renderCodespan; "del" uses chalk.dim.gray.strikethrough; "br" returns "\n"; "escape" returns token text; nested "text" tokens recurse through renderInline; "html" delegates to renderHtmlToken; and the default returns token.raw ?? ""./\\([_*[]<>\])/gfrom both text and href for GFM raw autolinks beginning withhttp://orhttps://, colors the text with COLORS.blue, and uses terminalLink(styled, href)` when an href exists.renderInline(tokens) buffers separate marked HTML tokens for paired color tags such as <red>…</red>, then applies the matching color function; supported inline forms include strong, emphasis, code span, link, text, line break, deletion, and escape./home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/lib/api/conversations.test.ts and /home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/lib/formatters/conversation.test.ts.packages/cli/test/lib/formatters/conversation.test.ts includes assertions covering list titles such as "Refund a duplicate charge", extracted user/assistant content, "[Filtered]", null content, conversation headings and title tables, fallback assistant text, JSON-stringified assistant results, plain-string and text-field user input, multipart assistant content, and request-derived user content.packages/cli/src/lib/formatters/plain-detect.ts was extracted to prevent a circular dependency between markdown.ts, which imports from colors.ts, and colors.ts, which needs isPlainOutput() to gate terminal hyperlinks.SENTRY_PLAIN_OUTPUT=1 → plain; 2. SENTRY_PLAIN_OUTPUT=0 → rendered even when piped; 3. non-empty NO_COLOR → plain; 4. FORCE_COLOR=0 → plain only when stdout is a TTY; 5. FORCE_COLOR=1 on a TTY → rendered; 6. !process.stdout.isTTY → plain; 7. default TTY with no overrides → rendered.FORCE_COLOR is ignored when stdout is not a TTY so commands such as cmd | less contain no ANSI codes; users who explicitly need color in pipes can set SENTRY_PLAIN_OUTPUT=0.isTruthyEnv(val) lowercases and trims the value; "0", "false", and "" are false, while values such as "1", "true", and "yes" are true.isPlainOutput() is evaluated afresh on every call so tests can mutate environment variables and process.stdout.isTTY between assertions. SENTRY_PLAIN_OUTPUT uses custom truthiness where "0", "false", and "" force rendered output; NO_COLOR follows no-color.org semantics where any non-empty value, including "0" or "false", disables color; non-empty FORCE_COLOR is honored only on a TTY and returns plain mode exactly when its value is "0"; otherwise the function returns !process.stdout.isTTY.stripAnsi(text) in packages/cli/src/lib/formatters/plain-detect.ts removes four terminal escape families in order: CSI (\x1b[), OSC (\x1b] terminated by BEL or ST), DCS (\x1bP terminated by ST), and two-character C1/Fs ESC sequences such as \x1bc.packages/cli/src/lib/formatters/local.ts imports stripAnsi from ./plain-detect.js and defines terminal-safety handling for untrusted envelope fields.JSON_UNSAFE_RE is /[\x80-\x9f\u200e\u200f\u202a-\u202e\u2066-\u2069]/g, covering C1 controls and Unicode bidirectional override/isolate characters that JSON.stringify leaves unescaped; BIDI_RE is /[\u200e\u200f\u202a-\u202e\u2066-\u2069]/g.stripBidi(text) removes characters matched by JSON_UNSAFE_RE from JSON-bound terminal output.sanitize(text) first runs stripAnsi(text), collapses CR, LF, and NEL (U+0085) runs to a space, removes remaining C0 controls except already-collapsed line controls plus DEL and C1 controls using /[\x00-\x08\x0b\x0c\x0e-\x1f\x7f\x80-\x9f]/g, then removes Unicode bidirectional override/isolate characters with BIDI_RE.SENTRY_CONTENT_TYPE = "application/x-sentry-envelope", FORMAT_VALUES = ["human", "json"] as const, LOCAL_EVENT_SCHEMA_VERSION = 1, and FILTER_VALUES = ["error", "transaction", "log", "ai"] as const.formatTime(timestamp?: number | string) uses the current date when no timestamp is supplied, parses strings with new Date(timestamp), converts numeric Sentry timestamps from seconds via new Date(timestamp * 1000), and returns "??:??:??" for an invalid date.