@sentry/junior-dashboard 0.62.0 → 0.64.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.
- package/dist/app.d.ts +2 -0
- package/dist/app.js +1285 -39
- package/dist/assets.d.ts +2 -0
- package/dist/client/api.d.ts +1 -1
- package/dist/client/components/Button.d.ts +15 -0
- package/dist/client/components/Metric.d.ts +22 -0
- package/dist/client/components/StatusBadge.d.ts +2 -1
- package/dist/client/components/TelemetryMetrics.d.ts +24 -0
- package/dist/client/components/ToolFrame.d.ts +3 -1
- package/dist/client/components/Transcript.d.ts +2 -0
- package/dist/client/components/TranscriptHeader.d.ts +2 -0
- package/dist/client/components/TranscriptHeadingRow.d.ts +16 -0
- package/dist/client/components/TranscriptThinkingView.d.ts +7 -0
- package/dist/client/components/TranscriptToolRun.d.ts +9 -0
- package/dist/client/components/transcriptRenderModel.d.ts +25 -9
- package/dist/client/format.d.ts +45 -8
- package/dist/client/markdownExport.d.ts +3 -0
- package/dist/client/toolInvocations.d.ts +7 -0
- package/dist/client/types.d.ts +17 -100
- package/dist/client.js +85 -55998
- package/dist/dashboardLoader.d.ts +1 -0
- package/dist/handler.js +1288 -40
- package/dist/index.d.ts +8 -0
- package/dist/index.js +1807 -0
- package/dist/mock-conversations.d.ts +3 -0
- package/dist/mock-release-conversation.d.ts +3 -0
- package/dist/nitro.d.ts +7 -1
- package/dist/tailwind.css +1 -1
- package/dist/url.d.ts +13 -0
- package/package.json +9 -5
- package/src/app.ts +42 -18
- package/src/assets.ts +2 -0
- package/src/auth.ts +2 -35
- package/src/client/App.tsx +33 -74
- package/src/client/code.tsx +1 -1
- package/src/client/components/Button.tsx +75 -0
- package/src/client/components/ConversationRowStats.tsx +3 -2
- package/src/client/components/FilterTabs.tsx +10 -11
- package/src/client/components/LoadingView.tsx +7 -2
- package/src/client/components/Metric.tsx +159 -0
- package/src/client/components/StatusBadge.tsx +10 -1
- package/src/client/components/TelemetryMetrics.tsx +124 -0
- package/src/client/components/ToolFrame.tsx +57 -14
- package/src/client/components/Transcript.tsx +6 -2
- package/src/client/components/TranscriptHeader.tsx +18 -19
- package/src/client/components/TranscriptHeadingRow.tsx +64 -0
- package/src/client/components/TranscriptThinkingView.tsx +157 -0
- package/src/client/components/TranscriptToolRun.tsx +66 -0
- package/src/client/components/TranscriptToolView.tsx +16 -8
- package/src/client/components/TranscriptTurn.tsx +368 -132
- package/src/client/components/TurnDurationChart.tsx +236 -78
- package/src/client/components/transcriptRenderModel.ts +60 -20
- package/src/client/format.ts +329 -87
- package/src/client/markdownExport.ts +360 -0
- package/src/client/pages/CommandCenter.tsx +1 -1
- package/src/client/pages/ConversationPage.tsx +142 -45
- package/src/client/pages/ConversationsPage.tsx +1 -1
- package/src/client/toolInvocations.ts +16 -0
- package/src/client/types.ts +34 -90
- package/src/config.ts +4 -0
- package/src/dashboardLoader.ts +12 -0
- package/src/index.ts +78 -0
- package/src/mock-conversations.ts +726 -0
- package/src/mock-release-conversation.ts +605 -0
- package/src/nitro.ts +7 -1
- package/src/tailwind.css +11 -0
- package/src/url.ts +68 -0
package/src/client/types.ts
CHANGED
|
@@ -1,119 +1,59 @@
|
|
|
1
1
|
import type { BundledLanguage } from "shiki/bundle/web";
|
|
2
|
+
import type {
|
|
3
|
+
DashboardConversationReport,
|
|
4
|
+
DashboardRequesterIdentity,
|
|
5
|
+
DashboardSessionFeed,
|
|
6
|
+
DashboardSessionReport,
|
|
7
|
+
DashboardTurnReport,
|
|
8
|
+
DashboardTurnUsage,
|
|
9
|
+
HealthReport,
|
|
10
|
+
PluginReport,
|
|
11
|
+
RuntimeInfoReport,
|
|
12
|
+
SkillReport,
|
|
13
|
+
} from "@sentry/junior/reporting";
|
|
2
14
|
|
|
3
|
-
export type Health =
|
|
15
|
+
export type Health = HealthReport;
|
|
4
16
|
|
|
5
|
-
export type Runtime =
|
|
6
|
-
cwd: string;
|
|
7
|
-
descriptionText?: string;
|
|
8
|
-
homeDir: string;
|
|
9
|
-
packagedContent: { packageNames: string[] };
|
|
10
|
-
};
|
|
17
|
+
export type Runtime = RuntimeInfoReport;
|
|
11
18
|
|
|
12
|
-
export type Plugin =
|
|
19
|
+
export type Plugin = PluginReport;
|
|
13
20
|
|
|
14
|
-
export type Skill =
|
|
21
|
+
export type Skill = SkillReport;
|
|
15
22
|
|
|
16
|
-
export type RequesterIdentity =
|
|
17
|
-
email?: string;
|
|
18
|
-
fullName?: string;
|
|
19
|
-
slackUserId?: string;
|
|
20
|
-
slackUserName?: string;
|
|
21
|
-
};
|
|
23
|
+
export type RequesterIdentity = DashboardRequesterIdentity;
|
|
22
24
|
|
|
23
|
-
export type TurnUsage =
|
|
24
|
-
cachedInputTokens?: number;
|
|
25
|
-
cacheCreationTokens?: number;
|
|
26
|
-
inputTokens?: number;
|
|
27
|
-
outputTokens?: number;
|
|
28
|
-
totalTokens?: number;
|
|
29
|
-
};
|
|
25
|
+
export type TurnUsage = DashboardTurnUsage;
|
|
30
26
|
|
|
31
|
-
export type Session =
|
|
32
|
-
channel?: string;
|
|
33
|
-
channelName?: string;
|
|
34
|
-
conversationId?: string;
|
|
35
|
-
conversationTitle?: string;
|
|
36
|
-
cumulativeDurationMs?: number;
|
|
37
|
-
cumulativeUsage?: TurnUsage;
|
|
38
|
-
id: string;
|
|
39
|
-
lastProgressAt?: string;
|
|
40
|
-
lastSeenAt?: string;
|
|
41
|
-
requester?: string;
|
|
42
|
-
requesterIdentity?: RequesterIdentity;
|
|
43
|
-
sentryConversationUrl?: string;
|
|
44
|
-
sentryTraceUrl?: string;
|
|
45
|
-
startedAt?: string;
|
|
46
|
-
status: string;
|
|
47
|
-
surface?: string;
|
|
48
|
-
title?: string;
|
|
49
|
-
traceId?: string;
|
|
50
|
-
};
|
|
27
|
+
export type Session = DashboardSessionReport;
|
|
51
28
|
|
|
52
|
-
export type TranscriptPart =
|
|
53
|
-
|
|
54
|
-
chars?: number;
|
|
55
|
-
id?: string;
|
|
56
|
-
input?: unknown;
|
|
57
|
-
inputKeys?: string[];
|
|
58
|
-
inputSizeBytes?: number;
|
|
59
|
-
inputSizeChars?: number;
|
|
60
|
-
inputType?: string;
|
|
61
|
-
name?: string;
|
|
62
|
-
output?: unknown;
|
|
63
|
-
outputKeys?: string[];
|
|
64
|
-
outputSizeBytes?: number;
|
|
65
|
-
outputSizeChars?: number;
|
|
66
|
-
outputType?: string;
|
|
67
|
-
redacted?: boolean;
|
|
68
|
-
text?: string;
|
|
69
|
-
type: string;
|
|
70
|
-
};
|
|
29
|
+
export type TranscriptPart =
|
|
30
|
+
DashboardTurnReport["transcript"][number]["parts"][number];
|
|
71
31
|
|
|
72
|
-
export type TranscriptMessage =
|
|
73
|
-
parts: TranscriptPart[];
|
|
74
|
-
role: string;
|
|
75
|
-
timestamp?: number;
|
|
76
|
-
};
|
|
32
|
+
export type TranscriptMessage = DashboardTurnReport["transcript"][number];
|
|
77
33
|
|
|
78
|
-
export type ConversationTurn =
|
|
79
|
-
transcript: TranscriptMessage[];
|
|
80
|
-
transcriptAvailable: boolean;
|
|
81
|
-
transcriptMetadata?: TranscriptMessage[];
|
|
82
|
-
transcriptMessageCount?: number;
|
|
83
|
-
transcriptRedacted?: boolean;
|
|
84
|
-
transcriptRedactionReason?: "non_public_conversation";
|
|
85
|
-
};
|
|
34
|
+
export type ConversationTurn = DashboardTurnReport;
|
|
86
35
|
|
|
87
|
-
export type ConversationDetailFeed =
|
|
88
|
-
conversationId: string;
|
|
89
|
-
generatedAt: string;
|
|
90
|
-
turns: ConversationTurn[];
|
|
91
|
-
};
|
|
36
|
+
export type ConversationDetailFeed = DashboardConversationReport;
|
|
92
37
|
|
|
93
38
|
export type Conversation = {
|
|
94
39
|
channel?: string;
|
|
95
40
|
channelName?: string;
|
|
96
41
|
conversationTitle?: string;
|
|
97
42
|
id: string;
|
|
98
|
-
lastProgressAt
|
|
99
|
-
lastSeenAt
|
|
100
|
-
requester?: string;
|
|
43
|
+
lastProgressAt: string;
|
|
44
|
+
lastSeenAt: string;
|
|
101
45
|
requesterIdentity?: RequesterIdentity;
|
|
102
46
|
sentryConversationUrl?: string;
|
|
103
47
|
sentryTraceUrl?: string;
|
|
104
|
-
startedAt
|
|
48
|
+
startedAt: string;
|
|
105
49
|
status: Session["status"];
|
|
106
|
-
surface
|
|
50
|
+
surface: Session["surface"];
|
|
107
51
|
title: string;
|
|
108
52
|
traceId?: string;
|
|
109
53
|
turns: Session[];
|
|
110
54
|
};
|
|
111
55
|
|
|
112
|
-
export type SessionFeed =
|
|
113
|
-
generatedAt?: string;
|
|
114
|
-
sessions: Session[];
|
|
115
|
-
source: string;
|
|
116
|
-
};
|
|
56
|
+
export type SessionFeed = DashboardSessionFeed;
|
|
117
57
|
|
|
118
58
|
export type Identity = { user: { email?: string; hostedDomain?: string } };
|
|
119
59
|
|
|
@@ -141,7 +81,11 @@ export type SessionFilter = "active" | "recent" | "hung" | "failed" | "all";
|
|
|
141
81
|
|
|
142
82
|
export type VisualStatus = "active" | "failed" | "hung" | "idle";
|
|
143
83
|
|
|
144
|
-
export type CodeBlock = {
|
|
84
|
+
export type CodeBlock = {
|
|
85
|
+
code: string;
|
|
86
|
+
fenced?: boolean;
|
|
87
|
+
language: BundledLanguage;
|
|
88
|
+
};
|
|
145
89
|
|
|
146
90
|
export type MarkupNode =
|
|
147
91
|
| {
|
package/src/config.ts
CHANGED
|
@@ -20,11 +20,15 @@ export async function resolveDashboardConfig(): Promise<JuniorDashboardRuntimeCo
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
function readEnvConfig(): JuniorDashboardRuntimeConfig {
|
|
23
|
+
const mockConversations =
|
|
24
|
+
process.env.JUNIOR_DASHBOARD_MOCK_CONVERSATIONS === "true";
|
|
25
|
+
|
|
23
26
|
return {
|
|
24
27
|
authRequired: process.env.JUNIOR_DASHBOARD_AUTH_REQUIRED !== "false",
|
|
25
28
|
allowedGoogleDomains: readListEnv("JUNIOR_DASHBOARD_GOOGLE_DOMAINS"),
|
|
26
29
|
allowedEmails: readListEnv("JUNIOR_DASHBOARD_ALLOWED_EMAILS"),
|
|
27
30
|
trustedOrigins: readListEnv("JUNIOR_DASHBOARD_TRUSTED_ORIGINS"),
|
|
31
|
+
...(mockConversations ? { mockConversations } : {}),
|
|
28
32
|
};
|
|
29
33
|
}
|
|
30
34
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const dashboardRainbowProgressClass = [
|
|
2
|
+
"relative",
|
|
3
|
+
"overflow-hidden",
|
|
4
|
+
"bg-white/15",
|
|
5
|
+
"before:absolute",
|
|
6
|
+
"before:inset-0",
|
|
7
|
+
"before:content-['']",
|
|
8
|
+
"before:bg-[linear-gradient(90deg,#ff4d6d,#ffb703,#56f39a,#4cc9f0,#9b5de5,#ff4d6d)]",
|
|
9
|
+
"before:bg-[length:200%_100%]",
|
|
10
|
+
"before:animate-[junior-rainbow-flow_1.2s_linear_infinite]",
|
|
11
|
+
"motion-reduce:before:animate-none",
|
|
12
|
+
].join(" ");
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type AgentPluginRoute,
|
|
3
|
+
defineJuniorPlugin,
|
|
4
|
+
type JuniorPluginRegistration,
|
|
5
|
+
} from "@sentry/junior-plugin-api";
|
|
6
|
+
import { buildDashboardConversationURL, normalizeDashboardPath } from "./url";
|
|
7
|
+
import { createDashboardApp, type JuniorDashboardOptions } from "./app";
|
|
8
|
+
|
|
9
|
+
export { createDashboardApp, type JuniorDashboardOptions } from "./app";
|
|
10
|
+
|
|
11
|
+
export interface JuniorDashboardPluginOptions extends JuniorDashboardOptions {
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function dashboardRoutePaths(options: JuniorDashboardPluginOptions): string[] {
|
|
16
|
+
const basePath = normalizeDashboardPath(options.basePath, "/");
|
|
17
|
+
const authPath = normalizeDashboardPath(options.authPath, "/api/auth");
|
|
18
|
+
const pagePaths =
|
|
19
|
+
basePath === "/"
|
|
20
|
+
? ["/", "/conversations", "/conversations/*", "/sessions", "/sessions/*"]
|
|
21
|
+
: [basePath, `${basePath}/*`];
|
|
22
|
+
|
|
23
|
+
return [
|
|
24
|
+
...pagePaths,
|
|
25
|
+
"/favicon.ico",
|
|
26
|
+
"/api/dashboard/*",
|
|
27
|
+
authPath,
|
|
28
|
+
`${authPath}/*`,
|
|
29
|
+
];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function dashboardRoutes(
|
|
33
|
+
options: JuniorDashboardPluginOptions,
|
|
34
|
+
): AgentPluginRoute[] {
|
|
35
|
+
let app: ReturnType<typeof createDashboardApp> | undefined;
|
|
36
|
+
const fetch = (request: Request) => {
|
|
37
|
+
app ??= createDashboardApp(options);
|
|
38
|
+
return app.fetch(request);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
return dashboardRoutePaths(options).map((path) => ({
|
|
42
|
+
handler: fetch,
|
|
43
|
+
path,
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Register dashboard routes and Slack footer links through trusted plugin hooks. */
|
|
48
|
+
export function juniorDashboardPlugin(
|
|
49
|
+
options: JuniorDashboardPluginOptions = {},
|
|
50
|
+
): JuniorPluginRegistration {
|
|
51
|
+
return defineJuniorPlugin({
|
|
52
|
+
name: "dashboard",
|
|
53
|
+
manifest: {
|
|
54
|
+
name: "dashboard",
|
|
55
|
+
description: "Junior dashboard routes and Slack footer links",
|
|
56
|
+
},
|
|
57
|
+
hooks: {
|
|
58
|
+
routes() {
|
|
59
|
+
if (options.disabled) {
|
|
60
|
+
return [];
|
|
61
|
+
}
|
|
62
|
+
return dashboardRoutes(options);
|
|
63
|
+
},
|
|
64
|
+
slackConversationLink(ctx) {
|
|
65
|
+
if (options.disabled) {
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
url: buildDashboardConversationURL({
|
|
70
|
+
basePath: options.basePath,
|
|
71
|
+
baseURL: options.baseURL,
|
|
72
|
+
conversationId: ctx.conversationId,
|
|
73
|
+
}),
|
|
74
|
+
};
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
}
|