@sentry/junior-dashboard 0.58.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/LICENSE +201 -0
  2. package/dist/app.d.ts +22 -0
  3. package/dist/app.js +492 -0
  4. package/dist/auth.d.ts +30 -0
  5. package/dist/client/App.d.ts +2 -0
  6. package/dist/client/api.d.ts +10 -0
  7. package/dist/client/code.d.ts +15 -0
  8. package/dist/client/components/CommandRail.d.ts +6 -0
  9. package/dist/client/components/ConversationList.d.ts +7 -0
  10. package/dist/client/components/ConversationRowStats.d.ts +6 -0
  11. package/dist/client/components/ConversationStack.d.ts +5 -0
  12. package/dist/client/components/ConversationSummary.d.ts +5 -0
  13. package/dist/client/components/EmptyTelemetry.d.ts +5 -0
  14. package/dist/client/components/FilterTabs.d.ts +6 -0
  15. package/dist/client/components/JuniorLogo.d.ts +2 -0
  16. package/dist/client/components/LoadingView.d.ts +4 -0
  17. package/dist/client/components/Section.d.ts +6 -0
  18. package/dist/client/components/SectionHeader.d.ts +6 -0
  19. package/dist/client/components/SectionTitle.d.ts +5 -0
  20. package/dist/client/components/StatusBadge.d.ts +6 -0
  21. package/dist/client/components/ToolFrame.d.ts +10 -0
  22. package/dist/client/components/Transcript.d.ts +5 -0
  23. package/dist/client/components/TranscriptHeader.d.ts +7 -0
  24. package/dist/client/components/TranscriptLoading.d.ts +2 -0
  25. package/dist/client/components/TranscriptText.d.ts +6 -0
  26. package/dist/client/components/TranscriptToolView.d.ts +9 -0
  27. package/dist/client/components/TranscriptTurn.d.ts +8 -0
  28. package/dist/client/components/TurnDurationChart.d.ts +6 -0
  29. package/dist/client/components/statusStyles.d.ts +3 -0
  30. package/dist/client/components/transcriptPreview.d.ts +4 -0
  31. package/dist/client/components/transcriptRenderModel.d.ts +30 -0
  32. package/dist/client/components/transcriptStyles.d.ts +4 -0
  33. package/dist/client/format.d.ts +64 -0
  34. package/dist/client/pages/CommandCenter.d.ts +6 -0
  35. package/dist/client/pages/ConversationPage.d.ts +5 -0
  36. package/dist/client/pages/ConversationsPage.d.ts +5 -0
  37. package/dist/client/styles.d.ts +2 -0
  38. package/dist/client/types.d.ts +153 -0
  39. package/dist/client.d.ts +7 -0
  40. package/dist/client.js +56012 -0
  41. package/dist/config.d.ts +4 -0
  42. package/dist/handler.d.ts +2 -0
  43. package/dist/handler.js +563 -0
  44. package/dist/nitro.d.ts +16 -0
  45. package/dist/nitro.js +80 -0
  46. package/dist/tailwind.css +2 -0
  47. package/package.json +60 -0
  48. package/src/app.ts +421 -0
  49. package/src/auth.ts +202 -0
  50. package/src/client/App.tsx +175 -0
  51. package/src/client/api.ts +99 -0
  52. package/src/client/code.tsx +139 -0
  53. package/src/client/components/CommandRail.tsx +74 -0
  54. package/src/client/components/ConversationList.tsx +94 -0
  55. package/src/client/components/ConversationRowStats.tsx +21 -0
  56. package/src/client/components/ConversationStack.tsx +67 -0
  57. package/src/client/components/ConversationSummary.tsx +40 -0
  58. package/src/client/components/EmptyTelemetry.tsx +11 -0
  59. package/src/client/components/FilterTabs.tsx +35 -0
  60. package/src/client/components/JuniorLogo.tsx +8 -0
  61. package/src/client/components/LoadingView.tsx +16 -0
  62. package/src/client/components/Section.tsx +17 -0
  63. package/src/client/components/SectionHeader.tsx +16 -0
  64. package/src/client/components/SectionTitle.tsx +10 -0
  65. package/src/client/components/StatusBadge.tsx +40 -0
  66. package/src/client/components/ToolFrame.tsx +52 -0
  67. package/src/client/components/Transcript.tsx +39 -0
  68. package/src/client/components/TranscriptHeader.tsx +52 -0
  69. package/src/client/components/TranscriptLoading.tsx +10 -0
  70. package/src/client/components/TranscriptText.tsx +45 -0
  71. package/src/client/components/TranscriptToolView.tsx +207 -0
  72. package/src/client/components/TranscriptTurn.tsx +487 -0
  73. package/src/client/components/TurnDurationChart.tsx +349 -0
  74. package/src/client/components/statusStyles.ts +9 -0
  75. package/src/client/components/transcriptPreview.ts +20 -0
  76. package/src/client/components/transcriptRenderModel.ts +193 -0
  77. package/src/client/components/transcriptStyles.ts +11 -0
  78. package/src/client/format.ts +628 -0
  79. package/src/client/pages/CommandCenter.tsx +37 -0
  80. package/src/client/pages/ConversationPage.tsx +145 -0
  81. package/src/client/pages/ConversationsPage.tsx +59 -0
  82. package/src/client/styles.ts +6 -0
  83. package/src/client/types.ts +153 -0
  84. package/src/client.tsx +79 -0
  85. package/src/config.ts +72 -0
  86. package/src/handler.ts +26 -0
  87. package/src/nitro.ts +110 -0
  88. package/src/tailwind.css +13 -0
  89. package/src/virtual-modules.d.ts +5 -0
@@ -0,0 +1,6 @@
1
+ /** Render transcript markdown/code blocks with structured markup expansion. */
2
+ export declare function TranscriptText(props: {
3
+ firstChildIndex: number;
4
+ lastChildIndex: number;
5
+ text: string;
6
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import type { TranscriptPart } from "../types";
2
+ /** Render a tool call/result pair in rich or raw transcript mode. */
3
+ export declare function TranscriptToolView(props: {
4
+ call?: TranscriptPart;
5
+ result?: TranscriptPart;
6
+ resultTimestamp?: number;
7
+ timestamp?: number;
8
+ view?: "raw" | "rich";
9
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import type { ConversationTurn } from "../types";
2
+ import { type TranscriptViewMode } from "./transcriptRenderModel";
3
+ /** Render one conversation turn as actor messages and tool events. */
4
+ export declare function TurnTranscript(props: {
5
+ number: number;
6
+ turn: ConversationTurn;
7
+ view: TranscriptViewMode;
8
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import type { Session } from "../types";
2
+ /** Render recent turns by start time and duration. */
3
+ export declare function TurnDurationChart(props: {
4
+ sessions: Session[];
5
+ timeZone: string;
6
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import type { VisualStatus } from "../types";
2
+ /** Map turn health to the shared left-border severity accent. */
3
+ export declare function statusBorderClass(status: VisualStatus): string;
@@ -0,0 +1,4 @@
1
+ /** Summarize a transcript payload value for closed tool/details headers. */
2
+ export declare function previewToolValue(value: unknown): string;
3
+ /** Decide whether a transcript payload has useful preview text. */
4
+ export declare function isPreviewableValue(value: unknown): boolean;
@@ -0,0 +1,30 @@
1
+ import type { TranscriptMessage, TranscriptPart } from "../types";
2
+ export type RenderedTranscriptPart = {
3
+ kind: "part";
4
+ part: TranscriptPart;
5
+ } | {
6
+ kind: "tool";
7
+ call?: TranscriptPart;
8
+ result?: TranscriptPart;
9
+ };
10
+ type RenderedTranscriptEntry = {
11
+ kind: "message";
12
+ message: TranscriptMessage;
13
+ } | RenderedToolEntry;
14
+ type RenderedToolEntry = {
15
+ call?: TranscriptPart;
16
+ kind: "tool";
17
+ result?: TranscriptPart;
18
+ resultTimestamp?: number;
19
+ timestamp?: number;
20
+ };
21
+ export type TranscriptViewMode = "raw" | "rich";
22
+ /** Group inline transcript parts so matching tool calls/results render together. */
23
+ export declare function groupTranscriptParts(parts: TranscriptPart[]): RenderedTranscriptPart[];
24
+ /** Flatten message-local tool parts into turn-level events for scan-friendly rendering. */
25
+ export declare function groupTranscriptMessages(messages: TranscriptMessage[]): RenderedTranscriptEntry[];
26
+ /** Build the plain-text clipboard/raw view for one transcript message. */
27
+ export declare function messageRawText(message: TranscriptMessage): string;
28
+ /** Count rendered rows so structured transcript expansion opens the newest node. */
29
+ export declare function countRenderedTranscriptChildren(part: RenderedTranscriptPart): number;
30
+ export {};
@@ -0,0 +1,4 @@
1
+ /** Share muted transcript metadata styling between turn and message chrome. */
2
+ export declare function mutedTranscriptMetaClass(size?: string): string;
3
+ /** Share the transcript empty/unavailable frame across top-level and turn views. */
4
+ export declare function transcriptEmptyClass(): string;
@@ -0,0 +1,64 @@
1
+ import { type BundledLanguage } from "shiki/bundle/web";
2
+ import type { CodeBlock, Conversation, ConversationTurn, MarkupNode, RequesterIdentity, Session, SessionFilter, TurnUsage, VisualStatus } from "./types";
3
+ /** Set the dashboard display timezone returned by the authenticated config API. */
4
+ export declare function setDashboardTimeZone(timeZone: string): void;
5
+ /** Identify turn summaries that should appear in failed conversation filters. */
6
+ export declare function isFailedSession(session: Session): boolean;
7
+ /** Format absolute dashboard timestamps with a stable empty fallback. */
8
+ export declare function formatTime(value: string | undefined): string;
9
+ /** Format conversation activity timestamps as human-relative recency labels. */
10
+ export declare function formatRelativeTime(value: string | undefined): string;
11
+ /** Format millisecond durations for compact transcript metadata. */
12
+ export declare function formatMs(value: number | undefined): string;
13
+ /** Format transcript event timestamps independently from turn start offsets. */
14
+ export declare function formatMessageTimestamp(value: number | undefined): string;
15
+ /** Format a transcript event as an offset from the current turn start. */
16
+ export declare function formatMessageOffset(turn: ConversationTurn, value: number | undefined): string | undefined;
17
+ /** Format byte counts in lowercase compact units for transcript metadata. */
18
+ export declare function formatBytes(value: number | undefined): string;
19
+ /** Count visible or redacted message records for a turn. */
20
+ export declare function turnMessageCount(turn: ConversationTurn): number;
21
+ /** Count tool calls from visible transcripts or safe redacted metadata. */
22
+ export declare function turnToolCallCount(turn: ConversationTurn): number;
23
+ /** Format known token counters without estimating per-message usage. */
24
+ export declare function formatTokenTotal(usage: TurnUsage | undefined): string;
25
+ /** Format known token counters with available input/output detail. */
26
+ export declare function formatUsage(usage: TurnUsage | undefined): string;
27
+ /** Format a conversation span from first turn start to latest activity. */
28
+ export declare function formatConversationDuration(conversation: Conversation): string;
29
+ /** Resolve the owning conversation id for a turn/session summary. */
30
+ export declare function conversationIdForSession(session: Session): string;
31
+ /** Choose the safe display title already prepared by the reporting API. */
32
+ export declare function conversationDisplayTitle(conversation: Conversation | undefined): string;
33
+ /** Prefer stable requester identifiers while keeping Slack ids as a last resort. */
34
+ export declare function requesterLabel(requester: RequesterIdentity | undefined, fallback: string | undefined): string | undefined;
35
+ /** Format the owner and permalink id line shared by conversation rows and headers. */
36
+ export declare function conversationIdentityMeta(conversation: Conversation | undefined, conversationId: string | undefined): string;
37
+ /** Convert Slack channel ids and names into user-facing location labels. */
38
+ export declare function slackLocationLabel(input: Pick<Session, "channel" | "channelName" | "requester" | "requesterIdentity">, options?: {
39
+ includeId?: boolean;
40
+ }): string | undefined;
41
+ /** Collapse raw turn states into the dashboard's visual status language. */
42
+ export declare function visualStatusForSession(session: Session): VisualStatus;
43
+ /** Derive conversation status from its turn summaries. */
44
+ export declare function visualStatusForConversation(conversation: Conversation): VisualStatus;
45
+ /** Explain why a transcript body is absent without exposing private content. */
46
+ export declare function unavailableTranscriptLabel(turn: ConversationTurn): string;
47
+ /** Build the canonical permalink route for a conversation id. */
48
+ export declare function conversationPath(conversationId: string): string;
49
+ /** Detect the syntax highlighter language for raw transcript blocks. */
50
+ export declare function detectLanguage(text: string): BundledLanguage;
51
+ /** Decide whether a fenced block can use the interactive markup renderer. */
52
+ export declare function canRenderStructuredMarkup(language: BundledLanguage): boolean;
53
+ /** Parse markdown into renderable code blocks while preserving plain text blocks. */
54
+ export declare function parseMarkdownBlocks(text: string): CodeBlock[];
55
+ /** Parse XML/HTML-ish fragments for the collapsible transcript renderer. */
56
+ export declare function parseMarkupNodes(code: string, language: BundledLanguage): MarkupNode[];
57
+ /** Group recent turn summaries into conversation rows. */
58
+ export declare function buildConversations(sessions: Session[]): Conversation[];
59
+ /** Apply the dashboard conversation filter to grouped conversation rows. */
60
+ export declare function filterConversations(conversations: Conversation[], filter: SessionFilter): Conversation[];
61
+ /** Normalize URL filter params to the supported dashboard filter set. */
62
+ export declare function getFilter(value: string | null): SessionFilter;
63
+ /** Serialize transcript part payloads for raw view and syntax highlighting. */
64
+ export declare function stringifyPartValue(value: unknown): string;
@@ -0,0 +1,6 @@
1
+ import type { DashboardData } from "../types";
2
+ /** Render the dashboard home view with runtime pulse and recent conversations. */
3
+ export declare function CommandCenter(props: {
4
+ data?: DashboardData;
5
+ queryError: Error | null;
6
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import type { DashboardData } from "../types";
2
+ /** Render one permalinkable conversation transcript route. */
3
+ export declare function ConversationPage(props: {
4
+ data?: DashboardData;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import type { DashboardData } from "../types";
2
+ /** Render the searchable conversation index from recent turn summaries. */
3
+ export declare function ConversationsPage(props: {
4
+ data?: DashboardData;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ /** Join component-owned Tailwind classes without pulling in a styling dependency. */
2
+ export declare function cn(...classes: Array<string | false | null | undefined>): string;
@@ -0,0 +1,153 @@
1
+ import type { BundledLanguage } from "shiki/bundle/web";
2
+ export type Health = {
3
+ service: string;
4
+ status: string;
5
+ timestamp: string;
6
+ };
7
+ export type Runtime = {
8
+ cwd: string;
9
+ descriptionText?: string;
10
+ homeDir: string;
11
+ packagedContent: {
12
+ packageNames: string[];
13
+ };
14
+ };
15
+ export type Plugin = {
16
+ name: string;
17
+ };
18
+ export type Skill = {
19
+ name: string;
20
+ pluginProvider?: string;
21
+ };
22
+ export type RequesterIdentity = {
23
+ email?: string;
24
+ fullName?: string;
25
+ slackUserId?: string;
26
+ slackUserName?: string;
27
+ };
28
+ export type TurnUsage = {
29
+ cachedInputTokens?: number;
30
+ cacheCreationTokens?: number;
31
+ inputTokens?: number;
32
+ outputTokens?: number;
33
+ totalTokens?: number;
34
+ };
35
+ export type Session = {
36
+ channel?: string;
37
+ channelName?: string;
38
+ conversationId?: string;
39
+ conversationTitle?: string;
40
+ cumulativeDurationMs?: number;
41
+ cumulativeUsage?: TurnUsage;
42
+ id: string;
43
+ lastProgressAt?: string;
44
+ lastSeenAt?: string;
45
+ requester?: string;
46
+ requesterIdentity?: RequesterIdentity;
47
+ sentryConversationUrl?: string;
48
+ sentryTraceUrl?: string;
49
+ startedAt?: string;
50
+ status: string;
51
+ surface?: string;
52
+ title?: string;
53
+ traceId?: string;
54
+ };
55
+ export type TranscriptPart = {
56
+ bytes?: number;
57
+ chars?: number;
58
+ id?: string;
59
+ input?: unknown;
60
+ inputKeys?: string[];
61
+ inputSizeBytes?: number;
62
+ inputSizeChars?: number;
63
+ inputType?: string;
64
+ name?: string;
65
+ output?: unknown;
66
+ outputKeys?: string[];
67
+ outputSizeBytes?: number;
68
+ outputSizeChars?: number;
69
+ outputType?: string;
70
+ redacted?: boolean;
71
+ text?: string;
72
+ type: string;
73
+ };
74
+ export type TranscriptMessage = {
75
+ parts: TranscriptPart[];
76
+ role: string;
77
+ timestamp?: number;
78
+ };
79
+ export type ConversationTurn = Session & {
80
+ transcript: TranscriptMessage[];
81
+ transcriptAvailable: boolean;
82
+ transcriptMetadata?: TranscriptMessage[];
83
+ transcriptMessageCount?: number;
84
+ transcriptRedacted?: boolean;
85
+ transcriptRedactionReason?: "non_public_conversation";
86
+ };
87
+ export type ConversationDetailFeed = {
88
+ conversationId: string;
89
+ generatedAt: string;
90
+ turns: ConversationTurn[];
91
+ };
92
+ export type Conversation = {
93
+ channel?: string;
94
+ channelName?: string;
95
+ conversationTitle?: string;
96
+ id: string;
97
+ lastProgressAt?: string;
98
+ lastSeenAt?: string;
99
+ requester?: string;
100
+ requesterIdentity?: RequesterIdentity;
101
+ sentryConversationUrl?: string;
102
+ sentryTraceUrl?: string;
103
+ startedAt?: string;
104
+ status: Session["status"];
105
+ surface?: string;
106
+ title: string;
107
+ traceId?: string;
108
+ turns: Session[];
109
+ };
110
+ export type SessionFeed = {
111
+ generatedAt?: string;
112
+ sessions: Session[];
113
+ source: string;
114
+ };
115
+ export type Identity = {
116
+ user: {
117
+ email?: string;
118
+ hostedDomain?: string;
119
+ };
120
+ };
121
+ export type DashboardConfig = {
122
+ allowedEmailCount: number;
123
+ allowedGoogleDomainCount: number;
124
+ authRequired: boolean;
125
+ authPath: string;
126
+ basePath: string;
127
+ sentryConversationLinks: boolean;
128
+ timeZone: string;
129
+ };
130
+ export type DashboardData = {
131
+ config: DashboardConfig;
132
+ health: Health;
133
+ me: Identity;
134
+ plugins: Plugin[];
135
+ runtime: Runtime;
136
+ sessions: SessionFeed;
137
+ skills: Skill[];
138
+ };
139
+ export type SessionFilter = "active" | "recent" | "hung" | "failed" | "all";
140
+ export type VisualStatus = "active" | "failed" | "hung" | "idle";
141
+ export type CodeBlock = {
142
+ code: string;
143
+ language: BundledLanguage;
144
+ };
145
+ export type MarkupNode = {
146
+ type: "element";
147
+ attributes: Array<[string, string]>;
148
+ children: MarkupNode[];
149
+ tagName: string;
150
+ } | {
151
+ type: "text";
152
+ text: string;
153
+ };
@@ -0,0 +1,7 @@
1
+ declare global {
2
+ interface Window {
3
+ __JUNIOR_DASHBOARD_BASE_PATH__?: string;
4
+ __JUNIOR_DASHBOARD_SHOW_ERROR__?: (error: unknown) => void;
5
+ }
6
+ }
7
+ export {};