Dashboard › cli › Session 1AEODz37b3gy
1AEODz37b3gyXt8PgPerform an independent, adversarial, READ-ONLY security and abuse-case review of the exact current worktree in /home/byk/Code/getsentry/cli-pr-1558 for getsentry/cli PR #1558. Do not edit files, mutate Git state, commit, stage, checkout, or push. The immutable review target is committed HEAD bbaa7b3b722b87f1bccfe84063269cbbcabe2741 plus the entire unstaged worktree diff whose SHA-256 from git diff | sha256sum is 092bd817573c1e0ea81e71472a9da2f38251dd6736331152b8325526527c3479. Verify that hash before reviewing and again before returning; if it differs, report BLOCKED with the observed hash.
Inspect every changed file and relevant surrounding code. Focus on command/example metadata trust boundaries, terminal/control-character and Markdown fence injection, JSON output integrity, native help rendering, generated embedded skill escaping, shell-command example safety, filesystem writes, fragment validation bypasses, malformed agent-conversation target handling, path/URL injection, organization scoping, authentication or privacy regressions, denial-of-service risk, static metadata versus user/API/plugin input, and whether widening CommandDocumentation can alter runtime command behavior. Explicit grammar contract: view targets contain zero or exactly one /; malformed supplied values must be rejected before org resolution or API access. Ensure fielded ValidationError grouping and ContextError behavior do not leak or merge unsafe data.
Validation already run on this exact tree: focused 6 files/155 tests passed; typecheck/generation passed; full rerun passed 452 files, 9,479 tests with 16 skipped; Biome passed 1,028 files; dependency check passed; fragment validation passed with one unrelated existing ProGuard warning. Analyze code independently rather than trusting this summary.
Return a substantive structured report. ...
bbaa7b3b722b87f1bccfe84063269cbbcabe2741 092bd817573c1e0ea81e71472a9da2f38251dd6736331152b8325526527c3479 -
<path>/home/byk/Code/getsentry/cli-pr-1558</path> <type>directory</type> <entries> .craft.yml .git .github/ .gitignore .lore.md .nojekyll .npmrc AGENTS.md apps/ CHANGELOG.md codemods/ LICENSE.md node_modules/ package.json packages/ pnpm-lock.yaml pnpm-workspace.yaml README.md (18 entries) </entries>
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/AGENTS.md /home/byk/Code/getsentry/cli-pr-1558/AGENTS.md
<path>/home/byk/Code/getsentry/cli-pr-1558/AGENTS.md</path> <type>file</type> <content> 1: # Jared (Outpost agent) 2: 3: Autonomous GitHub coding agent. Work in `/workspace/repo`. 4: 5: ## Model tiers 6: 7: The primary model is chosen per event (see `src/agents/models.ts`): heavy for 8: code-producing situations, cheaper for lightweight ones. 9: 10: | Role | Subagent | Model | 11: | --- | --- | --- | 12: | Triage / plan / review (heavy) | (primary Jared) | Claude Opus 4.8 | 13: | Triage / plan / review (light) | (primary Jared) | xAI Grok 4.3 | 14: | Explore | `explore` | OpenAI gpt-5-mini | 15: | Implement | `implement` | Moonshot kimi-k2.7-code | 16: | Ship (commit/push/PR) | `ship` | xAI Grok (`grok-build-0.1`) | 17: 18: Pipeline: triage → explore → plan → implement → review → ship. 19: (`worker` is a deprecated alias of `implement`.) 20: 21: Operators also talk to Jared directly from the Outpost dashboard. ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/AGENTS.md</path> <type>file</type> <content> 1: # AGENTS.md 2: 3: Guidelines for AI agents working in this codebase. 4: 5: ## Project Overview 6: 7: **Sentry CLI** is a command-line interface for [Sentry](https://sentry.io), built with Node.js, [pnpm](https://pnpm.io), and [Stricli](https://bloomberg.github.io/stricli/). It lives in `packages/cli` of a pnpm workspace; the docs site lives in `apps/cli-docs`. 8: 9: ### Goals 10: 11: - **Zero-config experience** - Auto-detect project context from DSNs in source code and env files 12: - **AI-powered debugging** - Integrate Seer AI for root cause analysis and fix plans 13: - **Developer-friendly** - Follow `gh` CLI conventions for intuitive UX 14: - **Agent-friendly** - JSON output and predictable behavior for AI coding agents 15: - **Fast** - Native binaries via Node SEA (fossilize), SQLite caching for API responses 16: 17: ### Key Features 18: 19: - **DSN Auto-Detection** - ...
...output truncated... Full output saved to: /home/byk/.local/share/opencode/tool-output/tool_08681bfde001eWku8mdB5hfMyJ fix/issue-identifier-hash-fragment 0a33512885187348c84548c6ecbf79786d683b07 [gone] fix(issue): validate org/project prefix in parseWithHash slash path fix/issue-list-error-propagation 027bf80ce73481f97a66684fbaa71a98c84eee17 [gone] fix(issue-list): propagate ApiError instead of plain Error on fetch failures fix/issue-list-org-redirect 6e860fd9ee4837f7d75cc6b25298efdb66ff42eb [ahead 580, behind 565] fix(issue): auto-redirect bare org slug to org-all mode in issue list fix/issue-list-project-id fe84993e9b81ca16fb65a678096bd68bcc08bd85 [gone] ref: upgrade @sentry/api to 0.21.0, remove raw HTTP pagination workarounds fix/issue-list-query-auto-correct 89017a5785ba46770278c3a61c648a0d25179595 [gone] fix: ...
<path>/home/byk/.local/share/opencode/tool-output/tool_08681bfde001eWku8mdB5hfMyJ</path> <type>file</type> <content> 1: ## fix/agent-conversation-reference-root-cause...origin/pr-1558 [gone] 2: M apps/cli-docs/src/fragments/commands/agent-conversation.md 3: M packages/cli/plugins/sentry-cli/skills/sentry-cli/SKILL.md 4: M packages/cli/plugins/sentry-cli/skills/sentry-cli/references/alert.md 5: M packages/cli/plugins/sentry-cli/skills/sentry-cli/references/cli.md 6: M packages/cli/plugins/sentry-cli/skills/sentry-cli/references/explore.md 7: M packages/cli/plugins/sentry-cli/skills/sentry-cli/references/feedback.md 8: M packages/cli/plugins/sentry-cli/skills/sentry-cli/references/init.md 9: M packages/cli/plugins/sentry-cli/skills/sentry-cli/references/issue.md 10: M packages/cli/plugins/sentry-cli/skills/sentry-cli/references/monitor.md 11: M packages/cli/plugins/sentry-cli/skills/sentry-cli/references/org.md 12: M ...
M apps/cli-docs/src/fragments/commands/agent-conversation.md M packages/cli/plugins/sentry-cli/skills/sentry-cli/SKILL.md M packages/cli/plugins/sentry-cli/skills/sentry-cli/references/agent-conversation.md M packages/cli/src/commands/agent-conversation/list.ts M packages/cli/src/commands/agent-conversation/view.ts M packages/cli/test/script/generate-skill-markdown.test.ts .../src/fragments/commands/agent-conversation.md | 9 +++++--- .../plugins/sentry-cli/skills/sentry-cli/SKILL.md | 4 ++-- .../sentry-cli/references/agent-conversation.md | 13 +++++++---- .../cli/src/commands/agent-conversation/list.ts | 1 + .../cli/src/commands/agent-conversation/view.ts | 1 + .../test/script/generate-skill-markdown.test.ts | 27 ++++++++++++++++++++++ 6 files changed, 45 insertions(+), 10 ...
bbaa7b3b722b87f1bccfe84063269cbbcabe2741 9d0901b10a154ae79220a9f99f463a024908ceb5 HEAD -> fix/agent-conversation-reference-root-cause fix(docs): correct agent conversation argument syntax 9d0901b10a154ae79220a9f99f463a024908ceb5
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/.cursor/rules/ultracite.mdc</path>
<type>file</type>
<content>
1: ---
2: description: Ultracite Rules - AI-Ready Formatter and Linter
3: globs: "**/*.{ts,tsx,js,jsx,json,jsonc,html,vue,svelte,astro,css,yaml,yml,graphql,gql,md,mdx,grit}"
4: alwaysApply: false
5: ---
6:
7: # Ultracite Code Standards
8:
9: This project uses **Ultracite**, a zero-config Biome preset that enforces strict code quality standards through automated formatting and linting.
10:
11: ## Quick Reference
12:
13: - **Format code**: `npx ultracite fix`
14: - **Check for issues**: `npx ultracite check`
15: - **Diagnose setup**: `npx ultracite doctor`
16:
17: Biome (the underlying engine) provides extremely fast Rust-based linting and formatting. Most issues are automatically fixable.
18:
19: ---
20:
21: ## Core Principles
22:
23: Write code that is **accessible, performant, type-safe, and maintainable**. Focus on clarity and explicit intent over brevity. ...
No files found
diff --git a/apps/cli-docs/src/fragments/commands/agent-conversation.md b/apps/cli-docs/src/fragments/commands/agent-conversation.md index ca9b2b2e3..e69de29bb 100644 --- a/apps/cli-docs/src/fragments/commands/agent-conversation.md +++ b/apps/cli-docs/src/fragments/commands/agent-conversation.md @@ -1,33 +0,0 @@ - - - -## Examples - -### List conversations - -```bash -# List recent agent conversations -sentry agent-conversation list - -# Explicit organization -sentry agent-conversation list my-org - -# Show more, last 24 hours -sentry agent-conversation list --limit 50 --period 24h - -# Filter conversations -sentry agent-conversation list -q "has:errors" - -# Paginate through results -sentry agent-conversation list my-org -c next -``` - -### View a conversation transcript - -```bash -# View full transcript -sentry agent-conversation view my-org conv-123 - -# JSON output -sentry agent-conversation view my-org conv-123 --json -``` diff --git ...
Found 28 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/generate-skill.ts:
Line 28: formatCommandExamples,
Line 598: const examples = formatCommandExamples(cmd.examples);
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/generate-skill-markdown.ts:
Line 40: export function formatCommandExamples(examples: readonly string[]): string {
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/generate-command-docs.ts:
Line 28: import { formatCommandExamples } from "./generate-skill-markdown.js";
Line 212: const examples = formatCommandExamples(cmd.examples);
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/script/generate-skill-markdown.test.ts:
Line 7: formatCommandExamples,
Line 55: expect(formatCommandExamples(view.examples)).toBe(
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/mutate-command.ts:
Line 22: import { buildCommand, type CommandDocumentation } from "./command.js";
Line 335: readonly ...
Found 13 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/errors.ts:
Line 9: * react to failure categories without parsing stderr. Codes are grouped
Line 407: export class ContextError extends CliError {
Line 511: * predictable shape. Always pass `field` when constructing the error — unfielded
Line 512: * validation errors collapse into one Sentry fingerprint.
Line 538: * {@link ValidationError} with the given field name.
Line 540: export function validationError(
Line 543: field?: string,
Line 548: field
Line 556: * @param field - Name of the invalid field
Line 558: export class ValidationError extends CliError {
Line 559: readonly field?: string;
Line 561: constructor(message: string, field?: string) {
Line 564: this.field = field;
Found 9 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/api/conversations.ts:
Line 42: * Internal helper used by {@link listConversations} for both single-page and
Line 101: export async function listConversations(
Line 119: export async function getConversationSpans(
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/api-client.ts:
Line 42: getConversationSpans,
Line 43: listConversations,
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/agent-conversation/view.ts:
Line 8: import { getConversationSpans } from "../../lib/api-client.js";
Line 135: () => getConversationSpans(org, conversationId)
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/agent-conversation/list.ts:
Line 8: import { listConversations } from "../../lib/api-client.js";
Line 195: listConversations(org, {
Found 9 matches /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/help.ts: Line 7: * - `sentry help --json`: Emits full command tree as structured JSON Line 8: * - `sentry help --json <command>`: Emits specific command/group metadata as JSON Line 17: introspectAllCommands, Line 18: introspectCommand, Line 28: "Use --json for machine-readable output suitable for AI agents.", Line 49: // formatHelpHuman (human output only), so `--json` never triggers the Line 51: return yield new CommandOutput(introspectAllCommands()); Line 55: // This ensures --json mode always gets structured output. Line 56: const result = introspectCommand(commandPath);
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/agent-conversation/view.ts</path>
<type>file</type>
<content>
1: /**
2: * sentry agent-conversation view
3: *
4: * View the transcript of a specific agent conversation.
5: */
6:
7: import type { SentryContext } from "../../context.js";
8: import { getConversationSpans } from "../../lib/api-client.js";
9: import { buildCommand } from "../../lib/command.js";
10: import { ContextError, validationError } from "../../lib/errors.js";
11: import {
12: buildTranscriptResult,
13: formatTranscriptResult,
14: type TranscriptResult,
15: } from "../../lib/formatters/conversation.js";
16: import { CommandOutput } from "../../lib/formatters/output.js";
17: import {
18: applyFreshFlag,
19: FRESH_ALIASES,
20: FRESH_FLAG,
21: } from "../../lib/list-command.js";
22: import { withProgress } from "../../lib/polling.js";
23: import { resolveOrg } from "../../lib/resolve-target.js";
24:
25: type ViewFlags = {
26: ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/agent-conversation/list.ts</path>
<type>file</type>
<content>
1: /**
2: * sentry agent-conversation list
3: *
4: * List recent agent conversations from Sentry projects.
5: */
6:
7: import type { SentryContext } from "../../context.js";
8: import { listConversations } from "../../lib/api-client.js";
9: import { validateLimit } from "../../lib/arg-parsing.js";
10: import {
11: advancePaginationState,
12: buildPaginationContextKey,
13: hasPreviousPage,
14: resolveCursor,
15: } from "../../lib/db/pagination.js";
16: import { ContextError } from "../../lib/errors.js";
17: import { formatConversationTable } from "../../lib/formatters/conversation.js";
18: import { filterFields } from "../../lib/formatters/json.js";
19: import { CommandOutput } from "../../lib/formatters/output.js";
20: import { getPositionalString } from "../../lib/introspect.js";
21: import {
22: buildListCommand,
23: ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/command.ts</path> <type>file</type> <content> 1: /** 2: * Command builder with telemetry, global flag injection, and output modes. 3: * 4: * Provides `buildCommand` — the standard command builder for all Sentry CLI 5: * commands. It wraps Stricli's `buildCommand` with: 6: * 7: * 1. **Automatic flag/arg telemetry** — captures flag values and positional 8: * arguments as Sentry span context for observability. 9: * 10: * 2. **Hidden global logging flags** — injects `--log-level` and `--verbose` 11: * into every command's parameters. These are intercepted before the original 12: * `func` runs: the logger level is set, and the injected flags are stripped 13: * so the original function never sees them. If a command already defines its 14: * own `--verbose` flag (e.g. `api` uses it for HTTP output), the injected 15: * one is skipped and the command's own value is used for both purposes. ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/command.ts</path>
<type>file</type>
<content>
380: * is skipped. The command's own `verbose` value is still used for log-level
381: * side-effects, and it is **not** stripped — the original func receives it as usual.
382: *
383: * Similarly, when a command already defines its own `json` flag (e.g. for
384: * custom brief text), the injected `JSON_FLAG` is skipped. `--fields` is
385: * always injected when `output: { human: ... }` regardless.
386: *
387: * Flag keys use kebab-case because Stricli uses the literal object key as
388: * the CLI flag name (e.g. `"log-level"` → `--log-level`). ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/command.ts</path>
<type>file</type>
<content>
600: renderer?: HumanRenderer<any>
601: ): void {
602: // ClearScreen token: defer until next render to avoid flash
603: if (value instanceof ClearScreen) {
604: if (!(isPlainOutput() || flags.json)) {
605: pendingClear = true;
606: }
607: return;
608: }
609:
610: if (!(outputConfig && renderer && value instanceof CommandOutput)) {
611: return;
612: }
613:
614: renderCommandOutput(stdout, value.data, outputConfig, renderer, {
615: json: Boolean(flags.json),
616: fields: flags.fields as string[] | undefined,
617: clearPrefix: pendingClear ? "\x1b[H\x1b[J" : undefined,
618: });
619: pendingClear = false;
620: }
621:
622: /**
623: * Strip injected flags from the raw Stricli-parsed flags object. ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/introspect.ts</path>
<type>file</type>
<content>
1: /**
2: * Route Tree Introspection
3: *
4: * Shared module for extracting structured metadata from Stricli's route tree.
5: * Used at runtime by `sentry help --json` and at build time by `generate-skill.ts`.
6: *
7: * While @stricli/core exports RouteMap and Command types, they require complex
8: * generic parameters (CommandContext) and don't export internal types like
9: * RouteMapEntry or FlagParameter. These simplified types are purpose-built
10: * for introspection and documentation generation.
11: */
12:
13: import type { CommandExample } from "./command.js";
14: import {
15: extractSchemaFields,
16: type SchemaFieldInfo,
17: } from "./formatters/output.js";
18: import { fuzzyMatch } from "./fuzzy.js";
19:
20: // ---------------------------------------------------------------------------
21: // Stricli Runtime Types (simplified for introspection)
22: ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/generate-command-docs.ts</path>
<type>file</type>
<content>
1: #!/usr/bin/env tsx
2: /**
3: * Generate Command Reference & Configuration Documentation
4: *
5: * Introspects the CLI's route tree and env var registry to generate
6: * accurate reference pages for the documentation website. Flags, arguments,
7: * aliases, and environment variables are extracted directly from source code,
8: * preventing documentation drift.
9: *
10: * Each generated page combines:
11: * 1. Auto-generated reference and examples from CLI metadata or env registry
12: * 2. Hand-written guides and tips from docs/src/fragments/
13: *
14: * The generated output is gitignored. Fragment files are the committed
15: * source of truth for content that cannot live in command definitions.
16: *
17: * Usage:
18: * tsx script/generate-command-docs.ts
19: *
20: * Output:
21: * docs/src/content/docs/commands/{route}.md (one per ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/generate-command-docs.ts</path>
<type>file</type>
<content>
341: lines.push(
342: "description: Environment variables, config files, and configuration options for the Sentry CLI"
343: );
344: lines.push("---");
345: lines.push("");
346:
347: // Intro
348: lines.push(
349: "The Sentry CLI can be configured through config files, environment variables, and a local database. Most users don't need to set any of these — the CLI auto-detects your project from your codebase and stores credentials locally after `sentry auth login`."
350: );
351: lines.push("");
352:
353: // Environment Variables section
354: lines.push("## Environment Variables");
355: lines.push("");
356:
357: for (const entry of registry) {
358: lines.push(generateEnvVarSection(entry));
359: lines.push("");
360: }
361:
362: // End marker
363: lines.push(GENERATED_END_MARKER);
364:
365: return ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/check-fragments.ts</path>
<type>file</type>
<content>
1: #!/usr/bin/env tsx
2: /**
3: * Validate doc fragment files.
4: *
5: * Ensures fragment files stay consistent with the CLI route tree:
6: * 1. Every route has a corresponding fragment file (+ index.md)
7: * 2. Every fragment file corresponds to an existing route (or is index.md)
8: * 3. Fragment files don't accidentally contain frontmatter or the generated marker
9: * 4. Top-level fragments (e.g., configuration.md) exist
10: * 5. Fragment content covers all subcommands in a route (warnings only)
11: *
12: * Usage:
13: * tsx script/check-fragments.ts # Warnings for missing subcommands
14: * tsx script/check-fragments.ts --strict # Errors for missing subcommands
15: */
16:
17: import { mkdirSync, readdirSync } from "node:fs";
18: import { access, readFile, writeFile } from "node:fs/promises";
19: import type { RouteInfo, RouteMap ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/generate-skill-markdown.ts</path>
<type>file</type>
<content>
1: /**
2: * Markdown parsing helpers shared by the skill generator and its tests.
3: */
4:
5: /** Matches a generated command heading and stops before positional usage. */
6: const COMMAND_HEADING_RE =
7: /^`sentry\s+([^<[`\s]+(?:\s+[^<[`\s]+)*)(?:\s*(?:<|\[)[^`]*)?`$/;
8:
9: /** Extract the literal command path from a generated command heading. */
10: export function extractCommandPathFromHeading(
11: heading: string
12: ): string | undefined {
13: const match = COMMAND_HEADING_RE.exec(heading);
14: return match?.[1] ? `sentry ${match[1]}` : undefined;
15: }
16:
17: /** Find the command whose literal path appears in a loose example block. */
18: export function matchExampleToCommand(
19: code: string,
20: commandPaths: readonly string[],
21: groupFallback: string,
22: defaultCommandPath?: string
23: ): string | undefined {
24: // Prefer ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/generate-skill.ts</path>
<type>file</type>
<content>
1: #!/usr/bin/env tsx
2: /**
3: * Generate Skill Files from Stricli Command Metadata and Docs
4: *
5: * Introspects the CLI's route tree and merges with documentation
6: * to generate structured documentation for AI agents.
7: *
8: * Produces:
9: * - SKILL.md: compact index with agent guidance + command summaries
10: * - references/*.md: full per-route command documentation
11: * - index.json: skill discovery manifest for .well-known
12: *
13: * Usage:
14: * tsx script/generate-skill.ts
15: *
16: * Output:
17: * plugins/sentry-cli/skills/sentry-cli/SKILL.md
18: * plugins/sentry-cli/skills/sentry-cli/references/*.md
19: * docs/public/.well-known/skills/index.json
20: */
21:
22: import { existsSync, mkdirSync, rmSync, writeFileSync } from "node:fs";
23: import { access, readFile, writeFile } from "node:fs/promises";
24: import type { Token ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/generate-skill.ts</path>
<type>file</type>
<content>
207: // Documentation Loading
208: // ---------------------------------------------------------------------------
209:
210: /** Load and parse a documentation file */
211: async function loadDoc(relativePath: string): Promise<string | null> {
212: const fullPath = `${DOCS_PATH}/${relativePath}`;
213: const exists = await access(fullPath).then(
214: () => true,
215: () => false
216: );
217: if (!exists) {
218: return null;
219: }
220: const content = await readFile(fullPath, "utf-8");
221: return stripMdxComponents(stripFrontmatter(content));
222: }
223:
224: /** Extract npm command from PackageManagerCode Astro component */
225: function extractPackageManagerCommand(rawContent: string): string | null {
226: const match = rawContent.match(PACKAGE_MANAGER_REGEX);
227: return match ? ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/generate-skill.ts</path>
<type>file</type>
<content>
470: // Route Introspection (with async doc loading)
471: // ---------------------------------------------------------------------------
472:
473: /**
474: * Walk the route tree and extract command information with doc examples.
475: * This is the async version that loads documentation examples from disk.
476: */
477: async function extractRoutes(routeMap: RouteMap): Promise<RouteInfo[]> {
478: const result: RouteInfo[] = [];
479: for (const entry of routeMap.getAllEntries()) {
480: if (entry.hidden) {
481: continue;
482: }
483: const routeName = entry.name.original;
484: const target = entry.target;
485: const defaultCommandName = isRouteMap(target)
486: ? ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/script/generate-skill.ts</path>
<type>file</type>
<content>
765: // Multi-File Generation
766: // ---------------------------------------------------------------------------
767:
768: /** Result of generating all skill files */
769: type GeneratedFiles = Map<string, string>;
770:
771: /**
772: * Map each route to its own reference file (1:1 mapping).
773: *
774: * Every visible route produces its own reference file, matching the
775: * strategy used by generate-command-docs.ts. This eliminates the
776: * need for manual route-to-reference mappings that can go stale.
777: */
778: function groupRoutesByReference(
779: routeInfos: RouteInfo[]
780: ): Map<string, RouteInfo[]> {
781: const groups = new Map<string, RouteInfo[]>();
782: for (const route of routeInfos) {
783: if (route.name === "help") {
784: continue;
785: }
786: groups.set(route.name, [route]);
787: }
788: return groups;
789: }
790: ...
Found 12 matches /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/generated/skill-content.ts: Line 21: ### \`sentry agent-conversation list [<org>]\` Line 58: sentry agent-conversation list Line 61: sentry agent-conversation list my-org Line 64: sentry agent-conversation list --limit 50 --period 24h Line 67: sentry agent-conversation list -q "has:errors" Line 70: sentry agent-conversation list my-org -c next Line 73: ### \`sentry agent-conversation view [<org>/]<conversation-id>\` Line 84: sentry agent-conversation view conv-123 Line 87: sentry agent-conversation view my-org/conv-123 Line 90: sentry agent-conversation view my-org/conv-123 --json Line 3949: - \`sentry agent-conversation list [<org>]\` — List recent agent conversations Line 3950: - \`sentry agent-conversation view [<org>/]<conversation-id>\` — View an agent conversation transcript
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/generated/skill-content.ts</path> <type>file</type> <content> 1: /** 2: * Embedded skill file contents for agent skill installation. 3: * Auto-generated by script/generate-skill.ts — do not edit manually. 4: */ 5: 6: /** Map of relative path → file content for all skill files */ 7: export const SKILL_FILES: ReadonlyMap<string, string> = new Map([ 8: ["references/agent-conversation.md", `--- 9: name: sentry-cli-agent-conversation 10: version: 0.45.0-dev.0 11: description: List and view agent conversations 12: requires: 13: bins: ["sentry"] 14: auth: true 15: --- 16: 17: # Agent-conversation Commands 18: 19: List and view agent conversations 20: 21: ### \`sentry agent-conversation list [<org>]\` 22: 23: List recent agent conversations 24: 25: **Flags:** 26: - \`-n, --limit <value> - Number of conversations (1-1000) - (default: "25")\` 27: - \`-q, --query <value> - Search query\` 28: - \`-t, --period <value> - ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/errors.ts</path>
<type>file</type>
<content>
360: /**
361: * Build the formatted resolution error message for entities that could not be found or resolved.
362: *
363: * @param resource - The entity that could not be resolved (e.g., "Issue 99124558")
364: * @param headline - Describes the failure (e.g., "not found", "is ambiguous", "could not be resolved")
365: * @param hint - Primary usage example or suggestion
366: * @param suggestions - Additional help bullets shown under "Or:"
367: * @returns Formatted multi-line error message
368: */
369: function buildResolutionMessage(
370: resource: string,
371: headline: string,
372: hint: string,
373: suggestions: string[]
374: ): string {
375: const lines = [`${resource} ${headline}.`, "", "Try:", ` ${hint}`];
376: if (suggestions.length > 0) {
377: lines.push("", "Or:");
378: for (const s of suggestions) {
379: lines.push(` - ${s}`);
380: ...
Found 100 matches (more matches available)
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/types/dashboard.ts:
Line 29: import { ValidationError } from "../lib/errors.js";
Line 195: * Throws ValidationError with actionable messages listing valid values.
Line 216: throw new ValidationError(
Line 402: * Throws a ValidationError listing valid functions if any are invalid.
Line 420: throw new ValidationError(
Line 448: throw new ValidationError(
Line 728: throw new ValidationError(
Line 734: throw new ValidationError(
Line 776: throw new ValidationError(
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/trace-target.ts:
Line 20: import { ContextError, ValidationError } from "./errors.js";
Line 114: * @throws {ValidationError} If the trace ID format is invalid
Line 264: throw new ValidationError(`Unexpected target: ${_exhaustive}`);
Line 313: * or recovered trace ID, or throws the original {@link ...
Found 19 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/api.ts:
Line 177: throw new ValidationError(`Invalid field key format: ${key}`, "field");
Line 416: * @throws {ValidationError} When field format is invalid
Line 506: throw new ValidationError(`Invalid field key format: ${key}`, "field");
Line 531: * @throws {ValidationError} When field doesn't contain "=" or key is empty
Line 782: * JSON fields are ambiguous and produce a {@link ValidationError}.
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/trace-target.ts:
Line 329: if (!(err instanceof ValidationError)) {
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/alert/mutation-utils.ts:
Line 141: throw new ValidationError(`${field} entries must be JSON objects.`, field);
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/span/view.ts:
Line 210: if (!(err instanceof ValidationError)) ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/error-reporting.ts</path>
<type>file</type>
<content>
200: * `"not found in neurio/installer-app"` → `"not found"`
201: */
202: export function extractResourceKind(resource: string): string {
203: return (
204: resource
205: .replace(/'[^']*'/g, "")
206: .replace(/"[^"]*"/g, "")
207: .replace(/\b[0-9a-f]{16,32}\b/gi, "")
208: .replace(/\bin\s+[\w-]+(?:\/[\w-]+)*/g, "")
209: // Strip hyphenated slugs after known entity names (e.g., "Organization my-company").
210: // Requires at least one hyphen to avoid stripping English words ("Project not found").
211: // Safe for current callers: resource values with slugs use quotes (stripped above),
212: // and headline values don't start with entity names.
213: .replace(
214: /\b(Organization|Dashboard|Dashboards|Project|Team)\s+[\w][\w-]*-[\w-]*/gi,
215: "$1"
216: )
217: .replace(/\b\d+\b/g, ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/api/conversations.ts</path>
<type>file</type>
<content>
1: /**
2: * Agent conversations API functions
3: *
4: * Functions for listing and retrieving agent conversation data from the Sentry
5: * Explore agent conversations endpoints.
6: *
7: * The `/organizations/{org}/agents/conversations/` endpoints are PRIVATE and not
8: * yet in `@sentry/api` (getsentry/sentry-api-schema). Call them via
9: * `apiRequestToRegion` with local Valibot schemas (same pattern as `logs.ts` /
10: * `traces.ts`). Details response shape is documented on
11: * `AgentConversationDetailsSchema`. Pagination uses `parseLinkHeader`. Revisit
12: * once these endpoints land in `@sentry/api`.
13: */
14:
15: import { array } from "valibot";
16:
17: import {
18: type AgentConversationDetails,
19: AgentConversationDetailsSchema,
20: type AgentConversationSpan,
21: type ConversationListItem,
22: ConversationListItemSchema,
23: } from ...
Found 9 matches /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/resolve-target.ts: Line 264: export async function resolveOrgFromDsn( Line 1298: export async function resolveOrgAndProject( Line 1653: export async function resolveOrgProjectOrGuide( Line 1673: export async function resolveOrg( Line 1877: export async function resolveOrgsForListing( Line 1951: export async function resolveOrgProjectTarget( Line 2086: export function resolveOrgProjectFromArg( Line 2385: export async function resolveOrgOptionalProjectTarget( Line 2424: export function resolveOrgOptionalProjectFromArg(
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/resolve-target.ts</path>
<type>file</type>
<content>
1640: }
1641: throw new ContextError("Organization and project", usageHint);
1642: }
1643:
1644: /**
1645: * Resolve an org/project target, guiding the user when auto-detection fails.
1646: *
1647: * Drop-in replacement for the `resolveOrgAndProject(...)` + "throw
1648: * `ContextError` on null" pattern, combining {@link resolveOrgAndProject} with
1649: * {@link guideOrgProjectFailure}.
1650: *
1651: * @throws {ContextError} When the target cannot be resolved or chosen.
1652: */
1653: export async function resolveOrgProjectOrGuide(
1654: options: ResolveOptions
1655: ): Promise<ResolvedTarget> {
1656: const resolved = await resolveOrgAndProject(options);
1657: return resolved ?? (await guideOrgProjectFailure(options));
1658: }
1659:
1660: /**
1661: * Resolve organization only from multiple sources.
1662: *
1663: * Resolution priority:
1664: * 1. ...
Found 4 matches /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/api/projects.ts: Line 212: const url = new URL(dsn); /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/api/preprod-artifacts.ts: Line 126: return new URL(url).origin === new URL(regionUrl).origin; /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/api/infrastructure.ts: Line 489: export async function apiRequestToRegion<T>( Line 646: export async function apiRequestToRegionNoContent(
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/api/infrastructure.ts</path>
<type>file</type>
<content>
430: // Overshot — trim and drop nextCursor (cursor would skip items)
431: if (allRows.length > limit) {
432: return { data: allRows.slice(0, limit) };
433: }
434: return { data: allRows, nextCursor: result.nextCursor };
435: }
436:
437: cursor = result.nextCursor;
438: }
439:
440: // Safety limit reached — warn and return what we have, no nextCursor
441: logger.warn(
442: `Pagination limit reached (${MAX_PAGINATION_PAGES} pages, ${allRows.length} items). ` +
443: "Results may be incomplete."
444: );
445: return { data: allRows.slice(0, limit) };
446: }
447:
448: /**
449: * Wire a single-page fetcher into a limit-bounded, auto-paginating list call. ...
No files found
No files found
No files found
<path>/home/byk/Code/getsentry/cli-pr-1558/node_modules</path> <type>directory</type> <entries> .modules.yaml .pnpm-workspace-state.json .pnpm/ (3 entries) </entries>
No files found
<path>/home/byk/Code/getsentry/cli-pr-1558/node_modules/.pnpm</path> <type>directory</type> <entries> @a2a-js+sdk@0.3.14_express@5.2.1/ @ai-sdk+provider-utils@2.2.8_zod@4.4.3/ @ai-sdk+provider-utils@3.0.30_zod@4.4.3/ @ai-sdk+provider-utils@4.0.40_zod@4.4.3/ @ai-sdk+provider-utils@5.0.13_zod@4.4.3/ @ai-sdk+provider@1.1.3/ @ai-sdk+provider@2.0.3/ @ai-sdk+provider@3.0.14/ @ai-sdk+provider@4.0.4/ @ai-sdk+ui-utils@1.2.11_zod@4.4.3/ @alcalzone+ansi-tokenize@0.3.0/ @anthropic-ai+sdk@0.39.0/ @apm-js-collab+code-transformer-bundler-plugins@0.5.0/ @apm-js-collab+code-transformer-bundler-plugins@0.7.3/ @apm-js-collab+code-transformer@0.15.0/ @apm-js-collab+code-transformer@0.18.1/ @apm-js-collab+tracing-hooks@0.10.1/ @apm-js-collab+tracing-hooks@0.13.0/ @astrojs+compiler-binding-linux-x64-gnu@0.3.2/ @astrojs+compiler-binding-linux-x64-musl@0.3.2/ @astrojs+compiler-binding@0.3.2_@emnapi+core@1.10.0_@emnapi+runtime@1.10.0/ @astrojs+compiler-rs@0.3.2_@emnapi+core@1.10.0_@emnapi+runtime@1.10.0/ @astr...
/home/byk/Code/getsentry/cli-pr-1558/node_modules/.pnpm/@stricli+core@1.2.8_patch_hash=892258f886d48063b409e0ac6141260023c396d1ed4f915231701f6a34edffcc/node_modules/@stricli/core/README.md /home/byk/Code/getsentry/cli-pr-1558/node_modules/.pnpm/@stricli+core@1.2.8_patch_hash=892258f886d48063b409e0ac6141260023c396d1ed4f915231701f6a34edffcc/node_modules/@stricli/core/package.json /home/byk/Code/getsentry/cli-pr-1558/node_modules/.pnpm/@stricli+core@1.2.8_patch_hash=892258f886d48063b409e0ac6141260023c396d1ed4f915231701f6a34edffcc/node_modules/@stricli/core/dist/index.d.ts /home/byk/Code/getsentry/cli-pr-1558/node_modules/.pnpm/@stricli+core@1.2.8_patch_hash=892258f886d48063b409e0ac6141260023c396d1ed4f915231701f6a34edffcc/node_modules/@stricli/core/dist/index.js /home/byk/Code/getsentry/cli-pr-1558/node_modules/.pnpm/@stricli+core@1.2.8_patch_hash=892258f886d48063b409e0ac6141260023c396d1ed4f915231701f6a34edffcc/node_modules/@stricli/core/dist/index.d.cts /home/byk/Code/getsentry/cli-pr-155...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/package.json</path>
<type>file</type>
<content>
1: {
2: "name": "sentry",
3: "version": "0.45.0-dev.0",
4: "description": "Sentry CLI - A command-line interface for using Sentry built by robots and humans for robots and humans",
5: "repository": {
6: "type": "git",
7: "url": "git+https://github.com/getsentry/cli.git"
8: },
9: "main": "./dist/index.cjs",
10: "type": "module",
11: "types": "./dist/index.d.cts",
12: "exports": {
13: ".": {
14: "import": {
15: "types": "./dist/index.d.mts",
16: "default": "./dist/index.mjs"
17: },
18: "require": {
19: "types": "./dist/index.d.cts",
20: "default": "./dist/index.cjs"
21: }
22: }
23: },
24: "bin": {
25: "sentry": "./dist/bin.cjs"
26: },
27: "files": [
28: "dist/bin.cjs",
29: "dist/index.cjs",
30: "dist/index.mjs",
31: "dist/index.d.cts",
32: "dist/index.d.mts",
33: ...
Found 9 matches /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/introspect.ts: Line 111: examples: string[]; Line 289: examples: string[] = [] Line 304: examples: cmd.__examples?.length /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/formatters/local.ts: Line 270: * Output examples: /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/errors.ts: Line 520: examples: string[], Line 542: examples: string[], /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/agent-conversation/view.ts: Line 80: examples: [ /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/agent-conversation/list.ts: Line 117: examples: [ /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/dashboard/widget/index.ts: Line 47: "Row-filling examples:\n" +
No files found
Found 42 matches
/home/byk/Code/getsentry/cli-pr-1558/node_modules/.pnpm/@stricli+core@1.2.8_patch_hash=892258f886d48063b409e0ac6141260023c396d1ed4f915231701f6a34edffcc/node_modules/@stricli/core/dist/index.js:
Line 910: brief: flag[1].brief
Line 942: brief: namedFlag[1].brief
Line 959: brief: flag[1].brief
Line 970: brief: text.briefs.argumentEscapeSequence
Line 987: brief: param.brief
Line 1005: brief: positional.parameter.brief
Line 1020: brief: nextPositional.brief
Line 1048: brief: flag.brief
Line 1080: briefs: {
Line 1687: const brief = entry.target.brief;
Line 1691: brief
Line 1700: brief
Line 1856: const { keywords, briefs } = args.text;
Line 1907: brief: flag.brief,
Line 1915: brief: briefs.help
Line 1922: brief: briefs.helpAll,
Line 1930: brief: ...
<path>/home/byk/Code/getsentry/cli-pr-1558/node_modules/.pnpm/@stricli+core@1.2.8_patch_hash=892258f886d48063b409e0ac6141260023c396d1ed4f915231701f6a34edffcc/node_modules/@stricli/core/dist/index.js</path>
<type>file</type>
<content>
1980: if (def.optional) {
1981: name = `[${name}]`;
1982: } else if (atLeastOneOptional) {
1983: name = ` ${name}`;
1984: }
1985: if (def.default) {
1986: const defaultKeyword = args.ansiColor ? `\x1B[2m${keywords.default}\x1B[22m` : keywords.default;
1987: suffix = `[${defaultKeyword} ${def.default}]`;
1988: }
1989: return [
1990: args.ansiColor ? `\x1B[1m${name}\x1B[22m` : name,
1991: args.ansiColor ? `\x1B[3m${def.brief}\x1B[23m` : def.brief,
1992: suffix ?? ""
1993: ];
1994: }),
1995: [" ", " "]
1996: );
1997: }
1998:
1999: // src/routing/command/documentation.ts
2000: function* generateCommandHelpLines(parameters, docs, args) {
2001: const ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/help.ts</path>
<type>file</type>
<content>
1: /**
2: * Help Command
3: *
4: * Provides help information for the CLI.
5: * - `sentry help` or `sentry` (no args): Shows branded help with banner
6: * - `sentry help <command>`: Shows detailed help for that command
7: * - `sentry help --json`: Emits full command tree as structured JSON
8: * - `sentry help --json <command>`: Emits specific command/group metadata as JSON
9: */
10:
11: import type { SentryContext } from "../context.js";
12: import { buildCommand } from "../lib/command.js";
13: import { OutputError } from "../lib/errors.js";
14: import { CommandOutput } from "../lib/formatters/output.js";
15: import {
16: formatHelpHuman,
17: introspectAllCommands,
18: introspectCommand,
19: } from "../lib/help.js";
20:
21: export const helpCommand = buildCommand({
22: auth: false,
23: docs: {
24: brief: "Display help for a command",
25: ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/help.ts</path>
<type>file</type>
<content>
1: /**
2: * Custom Help Output
3: *
4: * Provides a branded, styled help output for the CLI.
5: * Shows custom formatting when running `sentry` with no arguments.
6: * Commands are auto-generated from Stricli's route structure.
7: */
8:
9: import { routes } from "../app.js";
10: import { formatBanner } from "./banner.js";
11: import { isAuthenticated } from "./db/auth.js";
12: import { TOP_LEVEL_ENV_VARS } from "./env-registry.js";
13: import { cyan, magenta, muted } from "./formatters/colors.js";
14: import {
15: filterFields,
16: formatJson,
17: parseFieldsList,
18: } from "./formatters/json.js";
19: import { GLOBAL_FLAGS } from "./global-flags.js";
20: import {
21: type CommandInfo,
22: extractAllRoutes,
23: getPositionalString,
24: isCommand,
25: isRouteMap,
26: type RouteInfo,
27: type RouteMap,
28: type RouteMapEntry,
29: ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/help.ts</path> <type>file</type> <content> 380: return resolved.info; 381: } 382: 383: /** 384: * Render structured JSON help for `--help --json` requests, or `undefined` when 385: * the request is a plain text help request. 386: * 387: * Wired into Stricli's `documentation.renderHelp` hook (see `app.ts`). Stricli 388: * calls this whenever it is about to print help — for `--help`/`--helpAll` or a 389: * bare route group — passing the resolved route `prefix` (leading with the app 390: * name) and the `unprocessedInputs` that survived route resolution (which 391: * include forwarded top-level flags such as `--json`/`--fields`). ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/formatters/conversation.ts</path>
<type>file</type>
<content>
1: /**
2: * Agent conversations formatters
3: *
4: * Human-readable formatting for conversation list and detail views.
5: * Transcript parsing logic ported from sentry-mcp get-ai-conversation-details.
6: */
7:
8: import type {
9: AgentConversationSpan,
10: ConversationListItem,
11: } from "../../types/conversation.js";
12: import {
13: colorTag,
14: escapeMarkdownCell,
15: escapeMarkdownInline,
16: mdKvTable,
17: renderMarkdown,
18: safeCodeSpan,
19: } from "./markdown.js";
20: import { type Column, formatTable } from "./table.js";
21:
22: // ---------------------------------------------------------------------------
23: // List formatter
24: // ---------------------------------------------------------------------------
25:
26: function truncate(value: string, max = 60): string {
27: if (value.length <= max) {
28: return value;
29: ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/formatters/conversation.ts</path>
<type>file</type>
<content>
359: // ---------------------------------------------------------------------------
360: // Human formatter for transcript view
361: // ---------------------------------------------------------------------------
362:
363: function formatDuration(ms: number): string {
364: if (ms < 1000) {
365: return `${ms}ms`;
366: }
367: return `${(ms / 1000).toFixed(ms % 1000 === 0 ? 0 : 1)}s`;
368: }
369:
370: function formatEpoch(ts: number): string {
371: if (!Number.isFinite(ts) || ts === 0) {
372: return "—";
373: }
374: return new Date(ts * 1000).toISOString();
375: }
376:
377: function appendContentBlock(
378: lines: string[],
379: label: string,
380: content: string
381: ): void {
382: lines.push(`**${label}**`);
383: lines.push("");
384: for (const line of truncate(content, 600).split("\n")) {
385: ...
Found 2 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/formatters/markdown.ts:
Line 7: * parse5) while giving us full control over table rendering.
Line 59: export function escapeMarkdownInline(value: string): string {
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/formatters/markdown.ts</path>
<type>file</type>
<content>
1: /**
2: * Markdown-to-Terminal Renderer
3: *
4: * Custom renderer that walks `marked` tokens and produces ANSI-styled
5: * terminal output using `chalk`. Replaces `marked-terminal` to eliminate
6: * its ~970KB dependency chain (cli-highlight, node-emoji, cli-table3,
7: * parse5) while giving us full control over table rendering.
8: *
9: * Table rendering delegates to the text-table module which uses
10: * OpenTUI-inspired column fitting algorithms and Unicode box-drawing
11: * borders.
12: *
13: * Pre-rendered ANSI escape codes embedded in markdown source are preserved
14: * — `string-width` correctly treats them as zero-width.
15: *
16: * ## Output mode resolution
17: *
18: * See {@link isPlainOutput} in `plain-detect.ts` for the full priority chain. ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/app.ts</path>
<type>file</type>
<content>
1: import {
2: type ApplicationText,
3: buildApplication,
4: text_en,
5: UnexpectedPositionalError,
6: UnsatisfiedPositionalError,
7: } from "@stricli/core";
8: import { conversationRoute } from "./commands/agent-conversation/index.js";
9: import { listCommand as conversationListCommand } from "./commands/agent-conversation/list.js";
10: import { alertRoute } from "./commands/alert/index.js";
11: import { apiCommand } from "./commands/api.js";
12: import { authRoute } from "./commands/auth/index.js";
13: import { whoamiCommand } from "./commands/auth/whoami.js";
14: import { bashHookCommand } from "./commands/bash-hook.js";
15: import { buildRoute } from "./commands/build/index.js";
16: import { cliRoute } from "./commands/cli/index.js";
17: import { codeMappingsRoute } from "./commands/code-mappings/index.js";
18: import { dartSymbolMapRoute } from ...
<path>/home/byk/Code/getsentry/cli-pr-1558/apps/cli-docs/src/fragments/commands/agent-conversation.md</path> <type>file</type> <content> (End of file - total 0 lines) </content>
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/commands/agent-conversation/view.test.ts</path>
<type>file</type>
<content>
1: /**
2: * Conversation View Command Tests
3: *
4: * Tests for the `sentry agent-conversation view` command func() body, covering:
5: * - Resolving org + conversationId from a single `<org>/<conversation-id>` arg
6: * - Resolving org via resolveOrg when only the conversation-id is given
7: * - Throwing error when no args provided
8: * - Throwing ContextError when org cannot be resolved
9: * - Yielding CommandOutput with transcript result
10: * - Setting truncated flag from API response
11: *
12: * Uses spyOn mocking to avoid real HTTP calls or database access.
13: */
14:
15: import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
16: import { viewCommand } from "../../../src/commands/agent-conversation/view.js";
17:
18: vi.mock("../../../src/lib/api-client.js", async (importOriginal) => {
19: const actual =
20: ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/commands/agent-conversation/view.test.ts</path>
<type>file</type>
<content>
381: // When truncated is false, buildTranscriptResult does not set it,
382: // and the command sets result.truncated = false
383: expect(parsed.truncated).toBeFalsy();
384: });
385:
386: test("shows truncation warning in human output", async () => {
387: getConversationSpansSpy.mockResolvedValue({
388: spans: sampleSpans,
389: truncated: true,
390: title: null,
391: });
392:
393: const { context, stdoutWrite } = createMockContext();
394: const func = await viewCommand.loader();
395: await func.call(context, HUMAN_FLAGS, `${ORG}/${CONVERSATION_ID}`);
396:
397: const output = stdoutWrite.mock.calls.map((c) => c[0]).join("");
398: expect(output).toContain("truncated");
399: });
400:
401: test("handles empty spans", async () => {
402: ...
Found 100 matches (more matches available) /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/wrangler.ts: Line 92: // biome-ignore lint/complexity/noExcessiveCognitiveComplexity: this is a single-pass shell lexer; splitting its quote/escape/substitution state would obscure the transitions /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/version-check.ts: Line 297: // attributes rather than captureException — these are transient /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/upgrade.ts: Line 147: // existsSync also returns false on EACCES / a transiently-unmounted parent, Line 833: * Polling with exponential backoff lets the transient visibility race Line 872: "This is usually transient — rerun `sentry cli upgrade` to retry." Line 951: // exponential backoff so a transient filesystem-visibility race /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/arg-parsing.ts: Line 290: * Shell expansion of `~/foo` ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/input-validation.ts</path>
<type>file</type>
<content>
1: /**
2: * Input Validation for Agent Hallucination Hardening
3: *
4: * Reusable validators that defend against malformed inputs from AI agents.
5: * Agents hallucinate differently than humans typo — they embed query params
6: * in resource IDs, double-encode URLs, and inject path traversals.
7: *
8: * These validators are applied at the CLI argument parsing layer so all
9: * commands benefit automatically. The Sentry API handles most of these
10: * server-side (404, 400), but client-side validation provides:
11: * - Better error messages with actionable suggestions
12: * - Faster failure without a network round-trip
13: * - Defense-in-depth against unexpected URL manipulation
14: *
15: * @see https://github.com/getsentry/cli/issues/350
16: */
17:
18: import { ValidationError } from "./errors.js";
19:
20: /**
21: * Characters that are never valid in ...
Found 14 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/input-validation.ts:
Line 149: export function validateResourceId(input: string, label: string): void {
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/arg-parsing.ts:
Line 705: validateResourceId(np.slug, "project slug");
Line 714: validateResourceId(no.slug, "organization slug");
Line 740: validateResourceId(np.slug, "project slug");
Line 801: validateResourceId(np.slug, "project slug");
Line 1153: validateResourceId(fragment, "issue identifier");
Line 1164: validateResourceId(prefix.replace(/\//g, ""), "issue identifier");
Line 1170: validateResourceId(prefix, "project slug");
Line 1267: validateResourceId(id, idLabel);
Line 1321: validateResourceId(org, "organization slug");
Line 1340: validateResourceId(input.replace(/\//g, ""), "issue identifier");
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/init.ts:
Line ...
Found 11 matches
/home/byk/Code/getsentry/cli-pr-1558/node_modules/.pnpm/@stricli+core@1.2.8_patch_hash=892258f886d48063b409e0ac6141260023c396d1ed4f915231701f6a34edffcc/node_modules/@stricli/core/dist/index.d.ts:
Line 1411: interface CommandDocumentation {
Line 1423: readonly customUsage?: readonly (string | CustomUsage)[];
Line 1426: type BaseCommandBuilderArguments<FLAGS extends BaseFlags, ARGS extends BaseArgs, CONTEXT extends CommandContext> = {
Line 1434: readonly docs: CommandDocumentation;
Line 1436: type LazyCommandBuilderArguments<FLAGS extends BaseFlags, ARGS extends BaseArgs, CONTEXT extends CommandContext> = {
Line 1441: } & NoInfer<BaseCommandBuilderArguments<FLAGS, ARGS, CONTEXT>>;
Line 1442: type LocalCommandBuilderArguments<FLAGS extends BaseFlags, ARGS extends BaseArgs, CONTEXT extends CommandContext> = {
Line 1447: } & NoInfer<BaseCommandBuilderArguments<FLAGS, ARGS, CONTEXT>>;
Line 1448: type CommandBuilderArguments<FLAGS extends ...
<path>/home/byk/Code/getsentry/cli-pr-1558/node_modules/.pnpm/@stricli+core@1.2.8_patch_hash=892258f886d48063b409e0ac6141260023c396d1ed4f915231701f6a34edffcc/node_modules/@stricli/core/dist/index.d.ts</path> <type>file</type> <content> 1390: * - `false`: `"false"`, `"f"`, `"no"`, `"n"`, `"off"`, `"0"` 1391: * 1392: * Parsers are only executed when an input is provided, 1393: * so the empty string is treated as a truthy value (i.e. a flag that is present but has no value is treated as `true`). 1394: */ 1395: declare const looseBooleanParser: (input: string) => boolean; 1396: 1397: /** 1398: * Creates an input parser that checks if the input string is found in a list of choices. 1399: */ 1400: declare function buildChoiceParser<T extends string>(choices: readonly T[]): InputParser<T>; 1401: 1402: /** 1403: * Parses input strings as numbers. ...
Found 1 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/lib/command.test.ts:
Line 222: expect((command as unknown as { __examples?: unknown }).__examples).toEqual(
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/app.ts</path>
<type>file</type>
<content>
260: return;
261: }
262:
263: /**
264: * Format a CliError with a synonym suggestion when the user typed a known
265: * synonym that was consumed as a positional arg by `defaultCommand: "view"`.
266: *
267: * Returns the formatted error string if a synonym match is found,
268: * undefined otherwise. Skips Sentry capture for these known user mistakes.
269: */
270: function formatSynonymError(
271: exc: unknown,
272: ansiColor: boolean
273: ): string | undefined {
274: if (!(exc instanceof CliError)) {
275: return;
276: }
277: const synonymHint = getSynonymSuggestionFromArgv();
278: if (!synonymHint) {
279: return;
280: }
281: const prefix = ansiColor ? errorColor("Error:") : "Error:";
282: const tip = ansiColor
283: ? warning(`Tip: ${synonymHint}`)
284: : `Tip: ${synonymHint}`;
285: return `${prefix} ${exc.format()}\n${tip}`;
286: }
287: ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/list-command.ts</path>
<type>file</type>
<content>
500: * are async generators — non-streaming commands yield once and return.
501: */
502: type ListCommandFunction<
503: FLAGS extends BaseFlags,
504: ARGS extends BaseArgs,
505: CONTEXT extends CommandContext,
506: > = (
507: this: CONTEXT,
508: flags: FLAGS,
509: ...args: ARGS
510: // biome-ignore lint/suspicious/noConfusingVoidType: void is required here — generators that don't return a value have implicit void return, which is distinct from undefined in TypeScript's type system
511: ) => AsyncGenerator<unknown, CommandReturn | void, undefined>;
512:
513: /**
514: * Options for controlling which flags {@link buildListCommand} auto-injects.
515: *
516: * By default, `buildListCommand` adds `--fresh`, `--cursor`, and their aliases
517: * (`-f`, `-c`). Use these options to opt out when a command has conflicts. ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/mutate-command.ts</path> <type>file</type> <content> 280: /** Skip injecting `--dry-run` flag and `-n` alias. */ 281: noDryRunFlag?: boolean; 282: /** Skip the non-interactive safety guard pre-hook. */ 283: noNonInteractiveGuard?: boolean; 284: }; 285: 286: /** 287: * Build a Stricli command for a destructive operation with automatic safety 288: * flag injection and a non-interactive guard. 289: * 290: * This is a drop-in replacement for `buildCommand` that: 291: * 1. Auto-injects `--yes`, `--force`, and `--dry-run` flags (unless already 292: * defined, controlled by `options`) 293: * 2. Auto-injects `-y`, `-f`, `-n` aliases (skips if key already taken) 294: * 3. ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/lib/command.test.ts</path>
<type>file</type>
<content>
1: /**
2: * Command Builder Tests
3: *
4: * Tests for the buildCommand wrapper that adds automatic flag telemetry.
5: * Uses Stricli's run() to invoke commands end-to-end, verifying the wrapper
6: * captures flags/args and calls the original function.
7: */
8:
9: import { setTimeout as sleep } from "node:timers/promises";
10: // biome-ignore lint/performance/noNamespaceImport: needed for spyOn mocking
11: import * as Sentry from "@sentry/node-core/light";
12: import {
13: buildApplication,
14: type CommandContext,
15: run,
16: text_en,
17: } from "@stricli/core";
18: import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
19: import {
20: applyLoggingFlags,
21: applyOrgProjectFlags,
22: buildCommand,
23: FIELDS_FLAG,
24: JSON_FLAG,
25: LOG_LEVEL_FLAG,
26: numberParser,
27: VERBOSE_FLAG,
28: } from ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/script/generate-skill-markdown.test.ts</path>
<type>file</type>
<content>
1: /** Tests for generated command-heading and example association parsing. */
2:
3: import { readFile } from "node:fs/promises";
4: import { describe, expect, test } from "vitest";
5: import {
6: extractCommandPathFromHeading,
7: formatCommandExamples,
8: matchExampleToCommand,
9: } from "../../script/generate-skill-markdown.js";
10: import { listCommand } from "../../src/commands/agent-conversation/list.js";
11: import { viewCommand } from "../../src/commands/agent-conversation/view.js";
12: import { buildCommandInfo } from "../../src/lib/introspect.js";
13:
14: describe("extractCommandPathFromHeading", () => {
15: test.each([
16: ["`sentry issue view <issue-id>`", "sentry issue view"],
17: [
18: "`sentry project create [<org>/]<name>:<platform>...`",
19: "sentry project create",
20: ],
21: ["`sentry auth ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/lib/introspect.property.test.ts</path>
<type>file</type>
<content>
1: /**
2: * Property-Based Tests for Route Tree Introspection
3: *
4: * Uses fast-check to verify invariants that should hold for any valid
5: * route tree structure.
6: */
7:
8: import {
9: array,
10: boolean,
11: constantFrom,
12: assert as fcAssert,
13: oneof,
14: property,
15: record,
16: string,
17: tuple,
18: } from "fast-check";
19: import { describe, expect, test } from "vitest";
20: import type {
21: Command,
22: FlagDef,
23: RouteMap,
24: RouteMapEntry,
25: } from "../../src/lib/introspect.js";
26: import {
27: extractAllRoutes,
28: extractFlags,
29: getPositionalString,
30: resolveCommandPath,
31: } from "../../src/lib/introspect.js";
32: import { DEFAULT_NUM_RUNS } from "../model-based/helpers.js";
33:
34: // ---------------------------------------------------------------------------
35: // Arbitraries
36: ...
Found 22 matches /home/byk/Code/getsentry/cli-pr-1558/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/repo.md: Line 14: ### `sentry repo list [<org/project>]` /home/byk/Code/getsentry/cli-pr-1558/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/release.md: Line 14: ### `sentry release list [<org/project>]` Line 77: ### `sentry release deploy <org/version> <environment> [<name>]` Line 88: ### `sentry release deploys <org/version>` /home/byk/Code/getsentry/cli-pr-1558/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/replay.md: Line 14: ### `sentry replay list [<org/project>]` /home/byk/Code/getsentry/cli-pr-1558/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/project.md: Line 58: ### `sentry project list [<org/project>]` Line 68: ### `sentry project view [<org/project>]` /home/byk/Code/getsentry/cli-pr-1558/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/org.md: Line 22: ### `sentry org view ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/error-reporting.ts</path> <type>file</type> <content> 1: /** 2: * Central error reporting for CLI command failures. 3: * 4: * Provides two things: 5: * 6: * 1. **Silencing rules** — `OutputError`, network failures (offline/DNS/proxy), 7: * `AuthError` (expected auth states the user must act on), 401–499 `ApiError`, 8: * and 400 `ApiError`s that report an unparseable user search query are not 9: * sent to Sentry as issues. A `cli.error.silenced` metric preserves volume + 10: * user/org context. 11: * 12: * `ContextError` (a required value the user omitted) is deliberately NOT 13: * silenced: its volume is the signal driving auto-detection/UX improvements 14: * (e.g. single-org auto-select, the interactive picker), so it must stay 15: * visible (CLI-3B). 16: * 17: * 2. **Grouping tags** — enriches every error event with `cli_error.*` tags 18: * that Sentry's server-side ...
Found 1 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/telemetry.ts:
Line 899: export function setArgsContext(args: readonly unknown[]): void {
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/telemetry.ts</path>
<type>file</type>
<content>
850: * setFlagContext(flags);
851: * // ... command implementation
852: * }
853: * ```
854: */
855: export function setFlagContext(flags: Record<string, unknown>): void {
856: for (const [key, value] of Object.entries(flags)) {
857: // Skip undefined/null values
858: if (value === undefined || value === null) {
859: continue;
860: }
861:
862: // Skip false booleans (default state)
863: if (value === false) {
864: continue;
865: }
866:
867: // Skip empty strings
868: if (value === "") {
869: continue;
870: }
871:
872: // Skip empty arrays
873: if (Array.isArray(value) && value.length === 0) {
874: continue;
875: }
876:
877: // Convert camelCase to kebab-case for consistency with CLI flag names
878: const kebabKey = key.replace(/([A-Z])/g, "-$1").toLowerCase();
879:
880: // ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/agent-skills.ts</path>
<type>file</type>
<content>
1: /**
2: * Agent skill installation for AI coding assistants.
3: *
4: * Detects supported AI coding agents (currently Claude Code and agents that
5: * use the shared `~/.agents` root) and installs the Sentry CLI skill files
6: * so the agent can use CLI commands effectively.
7: *
8: * Skill file contents are embedded at build time (via a generated module
9: * produced by script/generate-skill.ts), so no network fetch is needed.
10: */
11:
12: import { accessSync, constants, existsSync, mkdirSync } from "node:fs";
13: import { rename, rm, writeFile } from "node:fs/promises";
14: import { basename, dirname, join } from "node:path";
15: import { captureException } from "@sentry/node-core/light";
16: import { SKILL_FILES } from "../generated/skill-content.js";
17:
18: /** Where skills are installed */
19: export type AgentSkillLocation = {
20: /** Path where the ...
Found 5 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/list-command.ts:
Line 253: * const nav = paginationHint({
Line 262: export function paginationHint(opts: {
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/org-list.ts:
Line 54: import { paginationHint } from "./list-command.js";
Line 491: const navHint = paginationHint({
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/formatters/output.ts:
Line 556: export function writeFooter(stdout: Writer, text: string): void {
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/list-command.ts</path>
<type>file</type>
<content>
220: `'${value}' is not a valid cursor. Cursors look like "1735689600:0:0". Use "next" / "prev" to navigate pages.`
221: );
222: }
223: return value;
224: }
225:
226: /**
227: * The `--cursor` / `-c` flag shared by all list commands.
228: *
229: * Accepts navigation keywords (`next`, `prev`, `first`, `last`) or an
230: * opaque cursor string for power users. Only meaningful in `<org>/`
231: * (org-all) mode by default.
232: */
233: export const LIST_CURSOR_FLAG = {
234: kind: "parsed" as const,
235: parse: parseCursorFlag,
236: brief: 'Navigate pages: "next", "prev", "first" (or raw cursor string)',
237: optional: true as const,
238: };
239:
240: /**
241: * Build a bidirectional pagination hint string from next/prev command hints. ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/formatters/output.ts</path>
<type>file</type>
<content>
520: }
521: return;
522: }
523:
524: /**
525: * Format schema fields as a help text block for `--help` output.
526: *
527: * Produces a compact field list like:
528: * ```
529: * JSON fields (use --json --fields to select):
530: * id (string) — Numeric issue ID
531: * count (string, optional) — Total event count
532: * ```
533: */
534: export function formatSchemaForHelp(fields: SchemaFieldInfo[]): string {
535: if (fields.length === 0) {
536: return "";
537: }
538: const lines = ["JSON fields (use --json --fields to select):"];
539: for (const field of fields) {
540: const optStr = field.optional ? ", optional" : "";
541: const desc = field.description ? ` — ${field.description}` : "";
542: lines.push(` ${field.name} (${field.type}${optStr})${desc}`);
543: }
544: return lines.join("\n");
545: }
546:
547: /** Format ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/plugins/sentry-cli/skills/sentry-cli/references/agent-conversation.md</path> <type>file</type> <content> 1: --- 2: name: sentry-cli-agent-conversation 3: version: 0.45.0-dev.0 4: description: List and view agent conversations 5: requires: 6: bins: ["sentry"] 7: auth: true 8: --- 9: 10: # Agent-conversation Commands 11: 12: List and view agent conversations 13: 14: ### `sentry agent-conversation list [<org>]` 15: 16: List recent agent conversations 17: 18: **Flags:** 19: - `-n, --limit <value> - Number of conversations (1-1000) - (default: "25")` 20: - `-q, --query <value> - Search query` 21: - `-t, --period <value> - Time range: "7d", "2026-08-01..2026-09-01", ">=2026-08-01" - (default: "7d")` 22: - `-f, --fresh - Bypass cache, re-detect projects, and fetch fresh data` 23: - `-c, --cursor <value> - Navigate pages: "next", "prev", "first" (or raw cursor string)` 24: 25: **JSON Fields** (use `--json --fields` to select ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/plugins/sentry-cli/skills/sentry-cli/SKILL.md</path> <type>file</type> <content> 340: 341: Authenticate with Sentry 342: 343: - `sentry auth login` — Authenticate with Sentry 344: - `sentry auth logout` — Log out of Sentry 345: - `sentry auth refresh` — Refresh your OAuth access token 346: - `sentry auth status` — View authentication status 347: - `sentry auth token` — Print the stored authentication token 348: - `sentry auth whoami` — Show the currently authenticated identity 349: 350: → Full flags and examples: `references/auth.md` 351: 352: ### Org 353: 354: Work with Sentry organizations 355: 356: - `sentry org list` — List organizations 357: - `sentry org view [<org>]` — View details of an organization 358: 359: → Full flags and examples: `references/org.md` 360: 361: ### Project 362: 363: Work with Sentry projects 364: 365: - `sentry project create [<org>/]<name>:<platform>...` — Create one or more projects 366: - ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/commands/agent-conversation/index.ts</path>
<type>file</type>
<content>
1: /**
2: * sentry agent-conversation
3: *
4: * List and view agent conversations from Sentry Explore.
5: */
6:
7: import { buildRouteMap } from "../../lib/route-map.js";
8: import { listCommand } from "./list.js";
9: import { viewCommand } from "./view.js";
10:
11: export const conversationRoute = buildRouteMap({
12: routes: {
13: list: listCommand,
14: view: viewCommand,
15: },
16: defaultCommand: "list",
17: docs: {
18: brief: "List and view agent conversations",
19: fullDescription:
20: "List and view agent conversations from Sentry Explore.\n\n" +
21: "Commands:\n" +
22: " list List recent agent conversations\n" +
23: " view View a conversation transcript\n",
24: hideRoute: {},
25: },
26: });
(End of file - total 26 lines)
</content>
Found 1 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/formatters/json.ts:
Line 169: export function formatJson<T>(data: T): string {
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/formatters/json.ts</path>
<type>file</type>
<content>
145: *
146: * Handles whitespace around commas and filters out empty segments:
147: * ```ts
148: * parseFieldsList("id, title , status") // → ["id", "title", "status"]
149: * parseFieldsList("id,,title") // → ["id", "title"]
150: * ```
151: *
152: * @param input - Raw `--fields` flag value
153: * @returns Parsed field path list (may be empty if input is all whitespace/commas)
154: */
155: export function parseFieldsList(input: string): string[] {
156: return [
157: ...new Set(
158: input
159: .split(",")
160: .map((f) => f.trim())
161: .filter(Boolean)
162: ),
163: ];
164: }
165:
166: /**
167: * Format data as pretty-printed JSON
168: */
169: export function formatJson<T>(data: T): string {
170: return JSON.stringify(data, null, 2);
171: }
172:
173: /**
174: * Output JSON to a write stream. ...
Found 24 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/formatters/output.ts:
Line 4: * Handles the common pattern of JSON vs human-readable output
Line 18: * The same data object is serialized to JSON and passed to the human
Line 74: export function resolveRenderer<T>(human: HumanOutput<T>): HumanRenderer<T> {
Line 100: * and serialized as-is to JSON)
Line 112: * Top-level keys to strip from JSON output.
Line 116: * in the JSON contract.
Line 119: * responsible for shaping the final JSON output.
Line 123: * Custom JSON serialization transform.
Line 125: * When set, replaces the default JSON output path entirely.
Line 137: * Zod schema describing the shape of JSON output (after transform/exclude). ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/formatters/output.ts</path>
<type>file</type>
<content>
240: for (const key of excludeKeys) {
241: delete copy[key];
242: }
243: return copy;
244: });
245: }
246: const copy = { ...data } as Record<string, unknown>;
247: for (const key of excludeKeys) {
248: delete copy[key];
249: }
250: return copy;
251: }
252:
253: /**
254: * Write a final JSON object to stdout.
255: *
256: * When the writer supports zero-copy capture (library mode), the object
257: * is handed off directly without serialization. Otherwise it is
258: * JSON-stringified and written as a single line.
259: */
260: function emitJsonObject(stdout: Writer, obj: unknown): void {
261: if (stdout.captureObject) {
262: stdout.captureObject(obj);
263: return;
264: }
265: stdout.write(`${formatJson(obj)}\n`);
266: }
267:
268: /**
269: * Render a single yielded `CommandOutput<T>` chunk. ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/arg-parsing.ts</path>
<type>file</type>
<content>
620: // Short ID with dash (e.g., /issues/CLI-G/ or /issues/SPOTLIGHT-ELECTRON-4Y/)
621: const dashIdx = issueId.lastIndexOf("-");
622: if (dashIdx > 0) {
623: const project = issueId.slice(0, dashIdx);
624: const suffix = issueId.slice(dashIdx + 1).toUpperCase();
625: if (project && suffix) {
626: // Lowercase project slug — Sentry slugs are always lowercase.
627: return {
628: type: "explicit",
629: org,
630: project: project.toLowerCase(),
631: suffix,
632: };
633: }
634: }
635:
636: // No dash — treat as suffix-only with org context
637: return {
638: type: "explicit-org-suffix",
639: org,
640: suffix: issueId.toUpperCase(),
641: };
642: }
643:
644: /**
645: * Reject `@`-prefixed values in org/project positions. ...
Found 1 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/arg-parsing.ts:
Line 36: export function normalizeSlug(slug: string): {
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/arg-parsing.ts</path>
<type>file</type>
<content>
1: /**
2: * Shared Argument Parsing Utilities
3: *
4: * Common parsing logic for CLI positional arguments that follow the
5: * `<org>/<target>` pattern. Used by both listing commands (issue list,
6: * project list) and single-item commands (issue view, explain, plan).
7: */
8:
9: import type { LogSortDirection } from "./api/logs.js";
10: import { ContextError, ValidationError, validationError } from "./errors.js";
11: import { validateResourceId } from "./input-validation.js";
12:
13: import type { ParsedSentryUrl } from "./sentry-url-parser.js";
14: import { applySentryUrlContext, parseSentryUrl } from "./sentry-url-parser.js";
15: import { isAllDigits } from "./utils.js";
16:
17: // ---------------------------------------------------------------------------
18: // Slug normalization
19: // ...
Found 2 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/region.ts:
Line 46: export function resolveOrgRegion(orgSlug: string): Promise<string> {
Line 65: async function resolveOrgRegionUncached(orgSlug: string): Promise<string> {
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/region.ts</path>
<type>file</type>
<content>
1: /**
2: * Region resolution for multi-region Sentry support.
3: *
4: * Provides utilities to resolve the correct region URL for an organization,
5: * using cached data when available or fetching from the API when needed.
6: */
7:
8: import { getOrganization } from "@sentry/api";
9: import { getConfiguredSentryUrl } from "./constants.js";
10: import { getOrgByNumericId, getOrgRegion, setOrgRegion } from "./db/regions.js";
11: import { stripDsnOrgPrefix } from "./dsn/index.js";
12: import { withAuthGuard } from "./errors.js";
13: import { getSdkConfig } from "./sentry-client.js";
14: import { getSentryBaseUrl, isSentrySaasUrl } from "./sentry-urls.js";
15:
16: /**
17: * Promise cache for org region resolution, keyed by orgSlug.
18: *
19: * When multiple DSNs share an orgId, concurrent calls to resolveOrgRegion
20: * deduplicate into a single HTTP request. ...
{"org":"..","raw":"https://us.sentry.io/api/0/organizations/../agents/conversations/conv/?per_page=1000","requestUrl":"https://us.sentry.io/api/0/agents/conversations/conv/?per_page=1000"}
{"org":"acme?x=y","raw":"https://us.sentry.io/api/0/organizations/acme?x=y/agents/conversations/conv/?per_page=1000","requestUrl":"https://us.sentry.io/api/0/organizations/acme?x=y/agents/conversations/conv/?per_page=1000"}
{"org":"acme#frag","raw":"https://us.sentry.io/api/0/organizations/acme#frag/agents/conversations/conv/?per_page=1000","requestUrl":"https://us.sentry.io/api/0/organizations/acme#frag/agents/conversations/conv/?per_page=1000"}
{"org":"..","pathname":"/api/0/agents/conversations/conv/","search":"?per_page=1000","hash":""}
{"org":"acme?x=y","pathname":"/api/0/organizations/acme","search":"?x=y/agents/conversations/conv/?per_page=1000","hash":""}
{"org":"acme#frag","pathname":"/api/0/organizations/acme","search":"","hash":"#frag/agents/conversations/conv/?per_page=1000"}
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/formatters/markdown.ts</path>
<type>file</type>
<content>
500:
501: lines.push(`${indent}${bullet} ${body}`);
502: }
503:
504: return lines.join("\n");
505: }
506:
507: /**
508: * Render a markdown table token using the text-table renderer.
509: *
510: * Converts marked's `Tokens.Table` into headers + rows + alignments and
511: * delegates to `renderTextTable()` for column fitting and box drawing.
512: */
513: function renderTableToken(table: Tokens.Table): string {
514: const headers = table.header.map((cell) => renderInline(cell.tokens));
515: const rows = table.rows.map((row) =>
516: row.map((cell) => renderInline(cell.tokens))
517: );
518:
519: const alignments: Alignment[] = table.align.map((a) => {
520: if (a === "right") {
521: return "right";
522: }
523: if (a === "center") {
524: return "center";
525: }
526: return "left";
527: });
528:
529: return ...
Found 3 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/formatters/markdown.ts:
Line 274: return token.text;
Line 276: return chalk.bgHex(COLORS.codeBg).hex(COLORS.codeFg)(` ${token.text} `);
Line 314: case "text":
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/formatters/markdown.ts</path>
<type>file</type>
<content>
240: // biome-ignore lint/plugin: grandfathered silent catch — see #1531; drain by adding log.debug()/log.warn() or re-throwing.
241: try {
242: return cliHighlight(code, { language, ignoreIllegals: true });
243: } catch {
244: return chalk.hex(COLORS.yellow)(code);
245: }
246: }
247:
248: /**
249: * Flatten a top-level token's inline content. Paragraphs and other block
250: * tokens that wrap inline tokens are unwrapped; bare inline tokens pass
251: * through as-is.
252: */
253: function flattenInline(token: Token): Token[] {
254: if (
255: "tokens" in token &&
256: token.tokens &&
257: token.type !== "strong" &&
258: token.type !== "em" &&
259: token.type !== "link"
260: ) {
261: return token.tokens;
262: }
263: return [token];
264: }
265:
266: /**
267: * Render a code span token. ...
No files found
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/lib/api/conversations.test.ts /home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/lib/formatters/conversation.test.ts
Found 26 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/lib/formatters/conversation.test.ts:
Line 23: firstInput: "Hello world",
Line 70: const items = [makeListItem({ title: "Refund a duplicate charge" })];
Line 87: const items = [makeListItem({ title: "Refund a duplicate charge" })];
Line 111: const items = [makeListItem({ user: undefined, firstInput: undefined })];
Line 143: expect(turns[0].userContent).toBe("hi");
Line 144: expect(turns[0].assistantContent).toBe("hello");
Line 193: expect(turns[0].userContent).toBe("[Filtered]");
Line 194: expect(turns[0].assistantContent).toBe("[Filtered]");
Line 204: expect(turns[0].userContent).toBeNull();
Line 221: test("includes title when provided", () => {
Line 228: expect(result.title).toBe("Refund a duplicate charge");
Line 254: title: null,
Line 267: test("includes title in empty-span message when present", () => {
Line 271: ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/formatters/plain-detect.ts</path>
<type>file</type>
<content>
1: /**
2: * Plain-output detection and ANSI stripping utilities.
3: *
4: * Extracted to its own module to avoid circular dependencies between
5: * `markdown.ts` (which imports from `colors.ts`) and `colors.ts`
6: * (which needs `isPlainOutput()` to gate terminal hyperlinks).
7: *
8: * ## Output mode resolution (highest → lowest priority)
9: *
10: * 1. `SENTRY_PLAIN_OUTPUT=1` → plain
11: * 2. `SENTRY_PLAIN_OUTPUT=0` → rendered (force rich, even when piped)
12: * 3. `NO_COLOR` (any non-empty value) → plain
13: * 4. `FORCE_COLOR=0` → plain (only when stdout is a TTY)
14: * 5. `FORCE_COLOR=1` on a TTY → rendered
15: * 6. `!process.stdout.isTTY` → plain
16: * 7. default (TTY, no overrides) → rendered
17: */
18:
19: import { getEnv } from "../env.js";
20:
21: /**
22: * Returns true if an env var value should be treated as "truthy" for
23: * ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/formatters/local.ts</path>
<type>file</type>
<content>
1: /** Tail formatters for the local dev server. */
2:
3: import { logger } from "../logger.js";
4: import { blue, bold, cyan, green, muted, red, yellow } from "./colors.js";
5: import { stripAnsi } from "./plain-detect.js";
6: import type { AttributeSource } from "./semantic-display.js";
7: import {
8: collectSpanAttributes,
9: formatSemanticSpanDisplay,
10: hasAiAttributes,
11: inferSemanticOp,
12: mergeTransactionAttributes,
13: } from "./semantic-display.js";
14:
15: const log = logger.withTag("local-formatter");
16:
17: /**
18: * Characters unsafe for JSON terminal display: C1 control characters
19: * (U+0080–U+009F, e.g. CSI=U+009B) and Unicode bidirectional overrides.
20: * `JSON.stringify` only escapes C0 (U+0000–U+001F) per RFC 8259;
21: * C1 and BiDi pass through unescaped. ...
Found 34 matches /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/utils.ts: Line 30: * separators (npm scopes, monorepo path segments) become hyphens instead of /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/dif/scan.ts: Line 39: * Nil debug id (hyphenated UUID form). An object whose debug id starts with Line 124: * suffix. A standard UUID has 5 hyphen-separated groups; PE/PDB ids append a /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/sentry-url-parser.ts: Line 18: const FEEDBACK_SLUG_RE = /^([a-z0-9][a-z0-9_-]*):(\d+)$/i; Line 246: const match = feedbackSlug?.match(FEEDBACK_SLUG_RE); /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/arg-parsing.ts: Line 26: * is effectively a no-op — valid slug characters pass through unchanged. Line 45: * Display names contain spaces, which are never valid in slugs. Line 289: * false positives on slugs that happen to start with tilde (valid in Sentry slugs). ...
diff --git a/packages/cli/plugins/sentry-cli/skills/sentry-cli/SKILL.md b/packages/cli/plugins/sentry-cli/skills/sentry-cli/SKILL.md index 4b8b785ba..66569f927 100644 --- a/packages/cli/plugins/sentry-cli/skills/sentry-cli/SKILL.md +++ b/packages/cli/plugins/sentry-cli/skills/sentry-cli/SKILL.md @@ -354,7 +354,7 @@ Authenticate with Sentry Work with Sentry organizations - `sentry org list` — List organizations -- `sentry org view <org>` — View details of an organization +- `sentry org view [<org>]` — View details of an organization → Full flags and examples: `references/org.md` @@ -364,8 +364,8 @@ Work with Sentry projects - `sentry project create [<org>/]<name>:<platform>...` — Create one or more projects - `sentry project delete <org/project>` — Delete a project -- `sentry project list <org/project>` — List projects -- `sentry project view <org/project>` — View details of a project +- `sentry project list [<org/project>]` — List projects +- `sentry project view ...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/error-reporting.ts</path>
<type>file</type>
<content>
300: /**
301: * Set `cli_error.*` tags on a Sentry scope for an error that will be
302: * captured. These tags are matched by server-side fingerprint rules to
303: * achieve stable grouping without SDK-side fingerprint logic.
304: *
305: * Tags set:
306: * - `cli_error.class` — error class name (e.g. `"ContextError"`)
307: * - `cli_error.kind` — stable grouping key derived from structured fields
308: * - `cli_error.api_status` — HTTP status (ApiError only)
309: * - `cli_error.api_endpoint` — normalized API path (ApiError only)
310: */
311: function setGroupingTags(scope: Sentry.Scope, error: unknown): void {
312: if (!(error instanceof Error)) {
313: return;
314: }
315:
316: scope.setTag("cli_error.class", error.name);
317:
318: const kind = deriveErrorKind(error);
319: if (kind !== undefined) {
320: scope.setTag("cli_error.kind", ...
Found 6 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/telemetry.ts:
Line 652: beforeSendTransaction: (event) => {
Line 658: beforeSend: (event) => {
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/init/verify-setup.ts:
Line 69: /** Key=value pattern for redaction (env vars and --flag=value args). */
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/errors.ts:
Line 896: * rationale as dropping EPIPE/EBADF OS noise in `beforeSend`.
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/error-reporting.ts:
Line 73: // EPIPE/EBADF OS noise in `beforeSend`. Note: TLS cert errors are wrapped as
Line 389: * Called from `beforeSend` to catch events that bypass {@link reportCliError}
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/telemetry.ts</path>
<type>file</type>
<content>
560: for (const frame of exc.stacktrace?.frames ?? []) {
561: if (frame.abs_path) {
562: frame.abs_path = ensureAbsolute(frame.abs_path);
563: }
564: if (frame.filename) {
565: frame.filename = ensureAbsolute(frame.filename);
566: }
567: }
568: }
569: }
570:
571: function normalizeDebugImages(event: Sentry.ErrorEvent): void {
572: for (const img of event.debug_meta?.images ?? []) {
573: if ("code_file" in img && typeof img.code_file === "string") {
574: img.code_file = ensureAbsolute(img.code_file);
575: }
576: }
577: }
578:
579: function normalizeFramePaths(event: Sentry.ErrorEvent): void {
580: normalizeExceptionFrames(event);
581: normalizeDebugImages(event);
582: }
583:
584: // Close the previous client to clean up its internal timers and beforeExit
585: ...
Found 24 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/lib/error-reporting.test.ts:
Line 339: "cli_error.kind": "Organization",
Line 342: expect(result.tags?.["cli_error.kind"]).toBe("Organization");
Line 359: test("sets cli_error.kind from exception value", () => {
Line 364: expect(result.tags?.["cli_error.kind"]).toBe("Cannot read properties of");
Line 367: test("sets cli_error.kind for fetch failed TypeError", () => {
Line 371: expect(result.tags?.["cli_error.kind"]).toBe("fetch failed");
Line 374: test("sets cli_error.kind for Error with variable project count", () => {
Line 383: expect(result1.tags?.["cli_error.kind"]).toBe(
Line 384: result2.tags?.["cli_error.kind"]
Line 388: test("does not set cli_error.kind when value is missing", () => {
Line 394: expect(result.tags?.["cli_error.kind"]).toBeUndefined();
Line 400: "cli_error.kind": "Organization",
Line 404: ...
0 33 apps/cli-docs/src/fragments/commands/agent-conversation.md 23 23 packages/cli/plugins/sentry-cli/skills/sentry-cli/SKILL.md 8 5 packages/cli/plugins/sentry-cli/skills/sentry-cli/references/agent-conversation.md 3 3 packages/cli/plugins/sentry-cli/skills/sentry-cli/references/alert.md 2 2 packages/cli/plugins/sentry-cli/skills/sentry-cli/references/cli.md 1 1 packages/cli/plugins/sentry-cli/skills/sentry-cli/references/explore.md 1 1 packages/cli/plugins/sentry-cli/skills/sentry-cli/references/feedback.md 1 1 packages/cli/plugins/sentry-cli/skills/sentry-cli/references/init.md 1 1 packages/cli/plugins/sentry-cli/skills/sentry-cli/references/issue.md 1 1 packages/cli/plugins/sentry-cli/skills/sentry-cli/references/monitor.md 1 1 packages/cli/plugins/sentry-cli/skills/sentry-cli/references/org.md 2 2 packages/cli/plugins/sentry-cli/skills/sentry-cli/references/project.md 2 2 packages/cli/plugins/sentry-cli/skills/sentry-cli/references/release.md 1 1 packages/cli/plugins/sentry-cli/sk...
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/test/lib/api/conversations.test.ts</path>
<type>file</type>
<content>
1: /**
2: * Conversations API Tests
3: *
4: * Tests for `listConversations` and `getConversationSpans` in
5: * src/lib/api/conversations.ts, covering:
6: * - listConversations sends correct params
7: * - listConversations parses link header for pagination
8: * - getConversationSpans parses the details envelope and extracts spans
9: * - getConversationSpans paginates through multiple pages
10: * - getConversationSpans returns truncated=true when pagination limit reached
11: * - getConversationSpans returns truncated=false when all pages fetched
12: *
13: * Mocks fetch at the global level like other API test files (traces, replays).
14: */
15:
16: import { afterEach, beforeEach, describe, expect, test } from "vitest";
17: import {
18: getConversationSpans,
19: listConversations,
20: } from "../../../src/lib/api/conversations.js";
21: import { ...
[{"type":"heading","text":"Agent Conversation: abc\u001b\\[2Jdef","raw":"# Agent Conversation: abc\u001b\\[2Jdef"}]
[{"type":"heading","text":"Agent Conversation: abc2Jdef","raw":"# Agent Conversation: abc2Jdef"}]
[{"type":"heading","text":"Agent Conversation: abcdef","raw":"# Agent Conversation: abcdef"}]
[{"type":"heading","text":"Agent Conversation: abc","raw":"# Agent Conversation: abc\n"},{"type":"paragraph","text":"\\`\\`\\`bash\necho pwn\n\\`\\`\\`","raw":"\\`\\`\\`bash\necho pwn\n\\`\\`\\`"}]
{"escaped":"\u001b\\[2J","rendered":"Agent Conversation: \u001b[2J\n━━━━━━━━━━━━━━━━━━━━","hasCsi":true}
{"out":"No spans found for conversation conv\u001b\\[2Jpwn in the last 30 days.","hasCsi":false}
{"out":"Agent Conversation: conv\n━━━━━━━━━━━━━━━━━━━━━━━━\n\n╭──────────┬──────────────────────────╮\n│ Org │ org │\n│ Projects │ p │\n│ Started │ 1970-01-01T00:00:01.000Z │\n│ Ended │ 1970-01-01T00:00:02.000Z │\n│ Turns │ 1 │\n│ Spans │ 1 │\n│ Tokens │ 0 │\n╰──────────┴──────────────────────────╯\n\nTurn 1 — 1970-01-01T00:00:01.000Z\n\n1s\n\nuser\n\nhello\u001b[2Jforged","hasCsi":true}
Found 100 matches (more matches available) /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/types/sentry.ts: Line 718: description: optional(nullable(string())), Line 1149: description: optional( /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/types/seer.ts: Line 90: description: string(), Line 162: description: string(), Line 300: one_line_description: string; Line 325: description: agentData.one_line_description, Line 511: description: item.code_snippet_and_analysis ?? "", /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/types/oauth.ts: Line 53: error_description: optional(string()), /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/api-schema.ts: Line 20: description: string; /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/which.ts: Line 28: command: string, /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/upgrade.ts: Line 199: command: ...
{"attack":"conv\u001bcreset","out":"No spans found for conversation conv\u001bcreset in the last 30 days.","hasEsc":true,"hasC1":false,"hasBidi":false}
{"attack":"conv\u001b]52;c;YQ==\u0007clip","out":"No spans found for conversation conv\u001b\\]52;c;YQ==\u0007clip in the last 30 days.","hasEsc":true,"hasC1":false,"hasBidi":false}
{"attack":"conv2Jc1","out":"No spans found for conversation conv2Jc1 in the last 30 days.","hasEsc":false,"hasC1":true,"hasBidi":false}
{"attack":"convspoof","out":"No spans found for conversation convspoof in the last 30 days.","hasEsc":false,"hasC1":false,"hasBidi":true}
{"out":"╭─────────┬───────┬───────────────────────┬────────┬─────────────╮\n│ ID │ Title │ Started │ Tokens │ First Input │\n├─────────┼───────┼───────────────────────┼────────┼─────────────┤\n│ conv\u001b[2Jpwn │ t\u001b]52;c;YQ==\u0007 │ 1/1/1970, 12:00:01 AM │ 0 │ x2Jy │\n╰─────────┴───────┴───────────────────────┴────────┴─────────────╯\n","hasEsc":true,"hasC1":true,"hasBidi":false}
bbaa7b3b722b87f1bccfe84063269cbbcabe2741 092bd817573c1e0ea81e71472a9da2f38251dd6736331152b8325526527c3479 -
Found 6 matches
/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/api/infrastructure.ts:
Line 360: * covers even the largest organizations. Override with SENTRY_MAX_PAGINATION_PAGES
Line 363: export const MAX_PAGINATION_PAGES = Math.max(
Line 365: Number(getEnv().SENTRY_MAX_PAGINATION_PAGES) || 50
Line 400: * exhausted. Caps at {@link MAX_PAGINATION_PAGES} to prevent runaway loops.
Line 425: for (let page = 0; page < MAX_PAGINATION_PAGES; page += 1) {
Line 442: `Pagination limit reached (${MAX_PAGINATION_PAGES} pages, ${allRows.length} items). ` +
<path>/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/api/infrastructure.ts</path>
<type>file</type>
<content>
345:
346: /**
347: * Get SDK config for an organization's region.
348: * Resolves the org's region URL and returns the config.
349: */
350: export async function getOrgSdkConfig(orgSlug: string) {
351: const regionUrl = await resolveOrgRegion(orgSlug);
352: return getSdkConfig(regionUrl);
353: }
354:
355: /**
356: * Maximum number of pages to follow when auto-paginating.
357: *
358: * Safety limit to prevent runaway pagination when the API returns an unexpectedly
359: * large number of pages. At API_MAX_PER_PAGE items/page this allows up to 5,000 items, which
360: * covers even the largest organizations. Override with SENTRY_MAX_PAGINATION_PAGES
361: * env var for edge cases.
362: */
363: export const MAX_PAGINATION_PAGES = Math.max(
364: 1,
365: Number(getEnv().SENTRY_MAX_PAGINATION_PAGES) || 50
366: );
367:
368: /**
369: * Sentry API's ...
{"org":".","raw":"https://us.sentry.io/api/0/organizations/./agents/conversations/conv/?per_page=1000","pathname":"/api/0/organizations/agents/conversations/conv/","search":"?per_page=1000","hash":""}
{"org":"..","raw":"https://us.sentry.io/api/0/organizations/../agents/conversations/conv/?per_page=1000","pathname":"/api/0/agents/conversations/conv/","search":"?per_page=1000","hash":""}
{"org":"\\..\\admin","raw":"https://us.sentry.io/api/0/organizations/\\..\\admin/agents/conversations/conv/?per_page=1000","pathname":"/api/0/organizations/admin/agents/conversations/conv/","search":"?per_page=1000","hash":""}
{"org":"%2e%2e","raw":"https://us.sentry.io/api/0/organizations/%2e%2e/agents/conversations/conv/?per_page=1000","pathname":"/api/0/agents/conversations/conv/","search":"?per_page=1000","hash":""}
{"org":"acme\\..\\admin","raw":"https://us.sentry.io/api/0/organizations/acme\\..\\admin/agents/conversations/conv/?per_page=1000","pathname":"/api/0/organizations/admin/agents/conversat...
e6ad3a876fc6ffdcf55fb53a4d53564a5bfe033d9b09662309ce04fe63ef5d3e - 1ac3a1ad4001aad050ad57f1d2c9451a7b3a4e577faf89d8981af88cff058f70 - 38260ba502e999a6e4f10927a6b807e383b02085b5193ca7b31a6cc480af5030 -
91e7780bc22774cf246ce54be43d0beefc6ddd8b8d01356b9ccf66eab8af329c packages/cli/src/commands/agent-conversation/view.ts cece8d62d12b1b64cd674611396cd836c875076397cebde53b1b4cf3ce95e716 packages/cli/src/commands/agent-conversation/list.ts 38260ba502e999a6e4f10927a6b807e383b02085b5193ca7b31a6cc480af5030 packages/cli/src/lib/api/conversations.ts 6ea9cd8131d0d780dee1564a0d44efafff4654e254a3cf3442a2deec5cd09993 packages/cli/src/lib/formatters/conversation.ts 6ea9cd8131d0d780dee1564a0d44efafff4654e254a3cf3442a2deec5cd09993 -
Found 3 matches /home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/arg-parsing.ts: Line 712: rejectAtSelector(rawOrg, "organization slug"); Line 714: validateResourceId(no.slug, "organization slug"); Line 1321: validateResourceId(org, "organization slug");
Date: Sep 9, 2026 * 🔴 (15:42) User-provided tool result found 3 matches in `/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/arg-parsing.ts`: line 712 `rejectAtSelector(rawOrg, "organization slug");`, line 714 `validateResourceId(no.slug, "organization slug");`, and line 1321 `validateResourceId(org, "organization slug");`.
🔴 (15:41) User-provided tool result mapped SHA-256-like hash `91e7780bc22774cf246ce54be43d0beefc6ddd8b8d01356b9ccf66eab8af329c` to `packages/cli/src/commands/agent-conversation/view.ts`. 🔴 (15:41) User-provided tool result mapped SHA-256-like hash `cece8d62d12b1b64cd674611396cd836c875076397cebde53b1b4cf3ce95e716` to `packages/cli/src/commands/agent-conversation/list.ts`. 🔴 (15:41) User-provide…
🔴 (15:36) User-provided tool result listed 3 hashes, each followed by `-`: `e6ad3a876fc6ffdcf55fb53a4d53564a5bfe033d9b09662309ce04fe63ef5d3e`, `1ac3a1ad4001aad050ad57f1d2c9451a7b3a4e577faf89d8981af88cff058f70`, and `38260ba502e999a6e4f10927a6b807e383b02085b5193ca7b31a6cc480af5030`.
* 🔴 (15:36) User-provided URL test results showed organization slug path normalization in `https://us.sentry.io/api/0/organizations/{org}/agents/conversations/conv/?per_page=1000`: `"."` normalized pathname to `/api/0/organizations/agents/conversations/conv/`; `".."` and `"%2e%2e"` normalized to `/api/0/agents/conversations/conv/`; `"\\..\\admin"` and `"acme\\..\\admin"` normalized to `/api/0/or…
* 🔴 (15:33) User-provided file content showed `getOrgSdkConfig(orgSlug: string)` in `/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/api/infrastructure.ts`: it awaits `resolveOrgRegion(orgSlug)` and returns `getSdkConfig(regionUrl)`. * 🔴 (15:33) User-provided file content defined `API_MAX_PER_PAGE = 100`; the Sentry API silently caps larger per-page requests server-side, and the pagin…
* 🔴 (15:23) User-provided tool output contained hash `bbaa7b3b722b87f1bccfe84063269cbbcabe2741`. * 🔴 (15:23) User-provided tool output contained checksum line `092bd817573c1e0ea81e71472a9da2f38251dd6736331152b8325526527c3479 -`. * 🔴 (15:30) User-provided search found 6 matches in `/home/byk/Code/getsentry/cli-pr-1558/packages/cli/src/lib/api/infrastructure.ts` for pagination-limit code: line …
* 🔴 (15:01) User-provided `packages/cli/src/lib/error-reporting.ts:311-329` defines `setGroupingTags(scope, error)`: for `Error` instances it sets `cli_error.class`, derives `cli_error.kind` via `deriveErrorKind(error)`, and for `ApiError` sets `cli_error.api_status` plus normalized `cli_error.api_endpoint`. * 🔴 (15:01) User-provided `packages/cli/src/lib/error-reporting.ts:336-360` defines `se…
* 🔴 (14:43) User-provided search found 34 matches across the CLI codebase for hyphen/slug-related text, including `packages/cli/src/lib/utils.ts`, `packages/cli/src/lib/dif/scan.ts`, `packages/cli/src/lib/sentry-url-parser.ts`, `packages/cli/src/lib/arg-parsing.ts`, `packages/cli/src/lib/custom-headers.ts`, `packages/cli/src/lib/completions.ts`, `packages/cli/src/lib/proguard.ts`, `packages/cli/…
* 🔴 (14:37) User-provided URL parsing confirmed that `org=".."` normalizes the pathname to `/api/0/agents/conversations/conv/`, with search `?per_page=1000` and an empty hash. * 🔴 (14:37) User-provided URL parsing confirmed that `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 empt…
* 🔴 (14:35) User-provided `packages/cli/src/lib/region.ts` defines process-local `regionCache` as `new Map<string, Promise<string>>()`, keyed by `orgSlug`; it deduplicates concurrent region lookups and retains resolved promises as a warm in-memory cache. * 🔴 (14:35) User-provided `resolveOrgRegion(orgSlug)` first returns any existing promise from `regionCache`; otherwise it calls `resolveOrgReg…
* 🔴 (14:29) User-provided `packages/cli/src/lib/telemetry.ts:855-889` defines `setFlagContext(flags: Record<string, unknown>): void`: skips `undefined`, `null`, `false`, empty strings, and empty arrays; converts camelCase keys to kebab-case with `key.replace(/([A-Z])/g, "-$1").toLowerCase()`; emits non-sensitive values through `Sentry.setTag(\`flag.${kebabKey}\`, flagValueToTag(value))`. * 🔴 (1…
Date: Sep 9, 2026 * 🔴 (14:27) User-provided `packages/cli/test/script/generate-skill-markdown.test.ts` has 134 lines and tests `extractCommandPathFromHeading()`, `formatCommandExamples()`, and `matchExampleToCommand()` from `packages/cli/script/generate-skill-markdown.js`. * 🔴 (14:27) User-provided `extractCommandPathFromHeading()` fixtures map `` `sentry issue view <issue-id>` `` to `sentry is…
* 🔴 (14:24) User-provided `packages/cli/test/commands/agent-conversation/view.test.ts` has 415 lines; its final tests require human output to contain `"truncated"` when `getConversationSpans()` returns `truncated: true`, and `"No spans found"` when it returns `spans: []`, `truncated: false`, and `title: null`. * 🔴 (14:24) User stated control characters are never valid in issue identifiers. * 🔴…
* 🔴 (14:22) [corrected-style] User directed table-cell handling to replace literal pipes with the Unicode box-drawing character `│` (`\u2502`). * 🔴 (14:22) User-provided `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-e…
* 🔴 (14:21) User-provided `renderJsonHelp()` in `packages/cli/src/lib/help.ts` is wired to Stricli’s `documentation.renderHelp` hook; without `--json` it returns `undefined` so Stricli retains built-in text help for `sentry --help` and `sentry <cmd> --help`. * 🔴 (14:21) User stated `--json` never calls the human formatter `formatHelpHuman()`, ensuring structured help never triggers `printCustom…
* 🔴 (14:18) User-provided `paginate<T>()` in `packages/cli/src/lib/api/infrastructure.ts` computes `limit = options.limit ?? defaultLimit` with `defaultLimit = 10`, caps `perPage` using `Math.min(limit, API_MAX_PER_PAGE)`, and calls `autoPaginate((cursor) => fetchPage(perPage, cursor), limit, options.cursor)`. * 🔴 (14:18) User-provided `autoPaginate` behavior trims overshot results to `allRows.…
* 🔴 (14:15) User stated a validation-error requirement: always pass `field` when constructing the error; unfielded `ValidationError`s collapse into one Sentry fingerprint. * 🔴 (14:15) User-provided `groupRoutesByReference(routeInfos)` in `packages/cli/script/generate-skill.ts` creates a 1:1 `Map<string, RouteInfo[]>` from each visible non-`help` route name to `[route]`, eliminating manual route…
* 🔴 (14:14) User-provided `packages/cli/script/generate-command-docs.ts` generates `docs/src/content/docs/commands/{route}.md`, `docs/src/content/docs/commands/index.md`, and `docs/src/content/docs/configuration.md` by introspecting the CLI route tree and `ENV_VAR_REGISTRY`, then appending hand-written fragments from `docs/src/fragments/`. * 🔴 (14:14) User-provided `packages/cli/script/generate…
* 🔴 (14:13) User stated the command-function convention in `packages/cli/src/lib/command.ts`: hints live exclusively on the async generator’s `CommandReturn`; never on individual yields. * 🔴 (14:13) User-provided `packages/cli/src/commands/agent-conversation/list.ts` defines `COMMAND_NAME = "agent-conversation list"`, `PAGINATION_KEY = "agent-conversation-list"`, and `DEFAULT_PERIOD = "7d"`. * …
* 🔴 (14:12) User-provided repository diff showed generated documentation now marks optional positionals with brackets for these signatures, in order shown: `sentry org view [<org>]`; `sentry project list [<org/project>]`; `sentry project view [<org/project>]`; `sentry issue list [<org/project>]`; `sentry alert issues list [<org/project>]`; `sentry alert issues create [<target>]`; `sentry alert m…
* 🔴 (14:11) User stated the project’s Ultracite async rule: “Always `await` promises in async functions - don't forget to use the return value”; prefer `async/await` over promise chains, handle async errors appropriately with try-catch, and never use async functions as Promise executors. * 🔴 (14:11) User stated to always check `package.json` for the latest scripts; commands run from `packages/c…
Date: Sep 9, 2026 * 🟡 (14:11) Repository HEAD was branch `fix/agent-conversation-reference-root-cause` at commit `bbaa7b3b722b87f1bccfe84063269cbbcabe2741` (`fix(docs): correct agent conversation argument syntax`), directly based on `9d0901b10a154ae79220a9f99f463a024908ceb5`; its tracked remote `origin/pr-1558` was marked `[gone]`. * 🟡 (14:11) One reported diff covered 6 files with 45 insertion…
Date: Sep 9, 2026 * 🔴 (14:10) User directive: replace the deprecated `macos-13` CI runner with `ubuntu-latest` for `darwin-x64`; associated branch `fix/macos-13-runner-deprecated` at `d667c53ccda1dc52af703a3f84826df28dab46c8` is marked `[gone]`. * 🔴 (14:10) User directive: replace the retry-delay array with a computed delay; associated branch `fix/upgrade-ebusy-retry` at `03a73b3177802290bb5ce1…
* 🔴 (14:10) Sentry CLI is built with Node.js, pnpm, and Stricli in `packages/cli`; its documentation site is in `apps/cli-docs`. * 🔴 (14:10) Sentry CLI goals are: zero-config project-context detection from DSNs, Seer AI-powered debugging, `gh`-style developer-friendly UX, agent-friendly JSON/predictable behavior, and fast native binaries via Node SEA (`fossilize`) with SQLite API-response cachi…
Date: Sep 9, 2026 * 🔴 (14:09) Review-target verification observed committed HEAD `bbaa7b3b722b87f1bccfe84063269cbbcabe2741` and `git diff | sha256sum` value `092bd817573c1e0ea81e71472a9da2f38251dd6736331152b8325526527c3479`, matching the expected immutable target. * 🟡 (14:09) Repository root `/home/byk/Code/getsentry/cli-pr-1558` contained 18 entries: `.craft.yml`, `.git`, `.github/`, `.gitigno…
Date: Sep 9, 2026 * 🔴 [requested-security-review] (14:08) User requested an independent, adversarial, READ-ONLY security and abuse-case review of the exact current worktree at `/home/byk/Code/getsentry/cli-pr-1558` for getsentry/cli PR #1558. * 🔴 [enforced-workflow] (14:08) User prohibited editing files, mutating Git state, committing, staging, checking out, or pushing during the review. * 🔴 (…