@sentry/junior 0.90.0 → 0.92.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/{agent-hooks-MXAF7RQL.js → agent-hooks-BYSSWCNW.js} +7 -7
- package/dist/api/people/list.d.ts +3 -3
- package/dist/api/people/list.js +15 -15
- package/dist/api/people/list.query.d.ts +2 -2
- package/dist/api/people/profile.d.ts +3 -3
- package/dist/api/people/profile.js +12 -12
- package/dist/api/people/profile.query.d.ts +2 -2
- package/dist/api/people/shared.d.ts +13 -13
- package/dist/api/people/types.d.ts +12 -12
- package/dist/api-reference.d.ts +1 -1
- package/dist/app.js +406 -267
- package/dist/{catalog-runtime-DXE6NXHT.js → catalog-runtime-NZHMSMYC.js} +2 -2
- package/dist/chat/actor.d.ts +75 -0
- package/dist/chat/agent/prompt.d.ts +4 -4
- package/dist/chat/agent/request.d.ts +21 -13
- package/dist/chat/agent/resume.d.ts +5 -4
- package/dist/chat/agent/tools.d.ts +2 -2
- package/dist/chat/capabilities/jr-rpc-command.d.ts +1 -1
- package/dist/chat/conversation-privacy.d.ts +11 -0
- package/dist/chat/conversations/sql/migrations.d.ts +1 -1
- package/dist/chat/conversations/sql/schema/conversations.d.ts +2 -19
- package/dist/chat/conversations/sql/schema.d.ts +2 -19
- package/dist/chat/conversations/sql/store.d.ts +3 -3
- package/dist/chat/conversations/store.d.ts +4 -4
- package/dist/chat/credentials/context.d.ts +4 -4
- package/dist/chat/current-instruction.d.ts +5 -3
- package/dist/chat/logging.d.ts +2 -2
- package/dist/chat/no-reply.d.ts +1 -1
- package/dist/chat/oauth-authorization-message.d.ts +6 -0
- package/dist/chat/oauth-flow.d.ts +1 -1
- package/dist/chat/pi/messages.d.ts +2 -2
- package/dist/chat/pi/transcript.d.ts +15 -0
- package/dist/chat/plugins/agent-hooks.d.ts +3 -3
- package/dist/chat/plugins/credential-hooks.d.ts +2 -8
- package/dist/chat/prompt.d.ts +3 -6
- package/dist/chat/runtime/reply-executor.d.ts +1 -1
- package/dist/chat/runtime/turn-input.d.ts +1 -1
- package/dist/chat/sandbox/egress/schemas.d.ts +2 -2
- package/dist/chat/sandbox/egress/session.d.ts +1 -1
- package/dist/chat/services/context-compaction.d.ts +1 -1
- package/dist/chat/services/conversation-memory.d.ts +1 -1
- package/dist/chat/services/mcp-auth-orchestration.d.ts +1 -1
- package/dist/chat/services/message-actor-identity.d.ts +4 -4
- package/dist/chat/services/pending-auth.d.ts +2 -2
- package/dist/chat/services/plugin-auth-orchestration.d.ts +1 -1
- package/dist/chat/services/provider-default-config.d.ts +1 -1
- package/dist/chat/services/subscribed-decision.d.ts +1 -1
- package/dist/chat/services/turn-result.d.ts +1 -1
- package/dist/chat/services/turn-session-record.d.ts +11 -8
- package/dist/chat/services/turn-thinking-level.d.ts +1 -1
- package/dist/chat/slack/assistant-thread/title.d.ts +1 -1
- package/dist/chat/slack/mrkdwn.d.ts +6 -0
- package/dist/chat/slack/tools/canvas/create.d.ts +41 -1
- package/dist/chat/slack/tools/canvas/edit.d.ts +60 -1
- package/dist/chat/slack/tools/canvas/read.d.ts +60 -1
- package/dist/chat/slack/tools/canvas/write.d.ts +41 -1
- package/dist/chat/slack/tools/channel-list-messages.d.ts +45 -1
- package/dist/chat/slack/tools/context.d.ts +3 -3
- package/dist/chat/slack/tools/list/add-items.d.ts +42 -1
- package/dist/chat/slack/tools/list/create.d.ts +40 -1
- package/dist/chat/slack/tools/list/get-items.d.ts +40 -1
- package/dist/chat/slack/tools/list/update-item.d.ts +46 -1
- package/dist/chat/slack/tools/message-add-reaction.d.ts +40 -1
- package/dist/chat/slack/tools/send-message.d.ts +45 -1
- package/dist/chat/slack/tools/thread-read.d.ts +44 -1
- package/dist/chat/slack/tools/user-lookup.d.ts +45 -1
- package/dist/chat/slack/user.d.ts +3 -3
- package/dist/chat/slack/vision-context.d.ts +2 -2
- package/dist/chat/sql/schema.d.ts +2 -19
- package/dist/chat/state/conversation-details.d.ts +4 -4
- package/dist/chat/state/conversation.d.ts +1 -1
- package/dist/chat/state/session-log.d.ts +140 -26
- package/dist/chat/state/turn-session.d.ts +18 -5
- package/dist/chat/task-execution/slack-work.d.ts +2 -2
- package/dist/chat/task-execution/state.d.ts +4 -4
- package/dist/chat/tool-support/zod-tool.d.ts +16 -4
- package/dist/chat/tools/advisor/tool.d.ts +41 -1
- package/dist/chat/tools/definition.d.ts +10 -0
- package/dist/chat/tools/execute-tool.d.ts +41 -1
- package/dist/chat/tools/resource-events.d.ts +124 -3
- package/dist/chat/tools/runtime/report-progress.d.ts +40 -1
- package/dist/chat/tools/sandbox/bash.d.ts +41 -1
- package/dist/chat/tools/sandbox/edit-file.d.ts +44 -1
- package/dist/chat/tools/sandbox/find-files.d.ts +42 -1
- package/dist/chat/tools/sandbox/grep.d.ts +46 -1
- package/dist/chat/tools/sandbox/list-dir.d.ts +41 -1
- package/dist/chat/tools/sandbox/read-file.d.ts +42 -1
- package/dist/chat/tools/sandbox/write-file.d.ts +41 -1
- package/dist/chat/tools/search-tools.d.ts +102 -1
- package/dist/chat/tools/skill/call-mcp-tool.d.ts +10 -1
- package/dist/chat/tools/skill/load-skill.d.ts +40 -1
- package/dist/chat/tools/skill/search-mcp-tools.d.ts +100 -1
- package/dist/chat/tools/system-time.d.ts +38 -1
- package/dist/chat/tools/types.d.ts +4 -4
- package/dist/chat/tools/web/fetch-tool.d.ts +41 -1
- package/dist/chat/tools/web/image-generate.d.ts +62 -1
- package/dist/chat/tools/web/search.d.ts +41 -1
- package/dist/{chunk-HXL2ZV74.js → chunk-3F54A3YM.js} +82 -11
- package/dist/{chunk-BKSZL4QO.js → chunk-7DVIELX3.js} +670 -401
- package/dist/{chunk-GCWD2VHP.js → chunk-7FS3K243.js} +284 -124
- package/dist/{chunk-AOISHLSF.js → chunk-ACJENBVF.js} +143 -20
- package/dist/{chunk-IRRMABQD.js → chunk-APIVR44P.js} +10 -10
- package/dist/{chunk-PHZHJTCK.js → chunk-BMQ5DXHV.js} +30 -52
- package/dist/{chunk-XP7F4LYB.js → chunk-BTH37NCU.js} +4 -4
- package/dist/{chunk-5GBUZI6M.js → chunk-H7KUZAMZ.js} +4 -4
- package/dist/{chunk-TYUXD3FN.js → chunk-MC4ZZE4Q.js} +1 -1
- package/dist/{chunk-QCKGI74V.js → chunk-N25HRI6B.js} +10 -10
- package/dist/{chunk-2S7M37HY.js → chunk-NIFONS4W.js} +86 -47
- package/dist/{chunk-ONFOWI2D.js → chunk-OJP53WIU.js} +16 -15
- package/dist/{chunk-NW7AXDA5.js → chunk-OZJXGX4U.js} +2 -2
- package/dist/{chunk-KC42JAAQ.js → chunk-PFXC67GJ.js} +3 -3
- package/dist/{chunk-ZUK7BL63.js → chunk-S6QKIGRM.js} +66 -54
- package/dist/{chunk-IX76WFJV.js → chunk-TF5VLGA7.js} +10 -10
- package/dist/{chunk-DACFZ5CI.js → chunk-VY7TVOIK.js} +16 -12
- package/dist/{chunk-AN2437E3.js → chunk-YTNPU7I2.js} +2 -2
- package/dist/{chunk-3MPOMK3K.js → chunk-YYBX2BD5.js} +61 -3
- package/dist/{chunk-RS6ANWVT.js → chunk-ZATRYQLR.js} +1 -1
- package/dist/cli/chat.js +20 -20
- package/dist/cli/check.js +3 -3
- package/dist/cli/plugins.js +9 -9
- package/dist/cli/snapshot-warmup.js +6 -6
- package/dist/cli/upgrade.js +9 -9
- package/dist/{db-CXI7PR5U.js → db-GCK43OO3.js} +4 -4
- package/dist/instrumentation.js +1 -1
- package/dist/reporting/conversations.d.ts +3 -3
- package/dist/reporting.d.ts +1 -1
- package/dist/reporting.js +48 -50
- package/dist/{runner-FKL3RAHA.js → runner-XWTFA26U.js} +20 -18
- package/dist/{validation-I7GD2YWS.js → validation-KYAWETI4.js} +3 -3
- package/package.json +6 -6
- package/dist/chat/requester.d.ts +0 -68
package/dist/cli/upgrade.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
recordConversationActivity,
|
|
5
5
|
recordConversationExecution,
|
|
6
6
|
requestConversationWork
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-TF5VLGA7.js";
|
|
8
8
|
import {
|
|
9
9
|
defineJuniorPlugins,
|
|
10
10
|
pluginCatalogConfigFromEnv,
|
|
@@ -14,35 +14,35 @@ import {
|
|
|
14
14
|
import {
|
|
15
15
|
JUNIOR_THREAD_STATE_TTL_MS,
|
|
16
16
|
coerceThreadConversationState
|
|
17
|
-
} from "../chunk-
|
|
17
|
+
} from "../chunk-PFXC67GJ.js";
|
|
18
18
|
import {
|
|
19
19
|
loadAppPluginSet
|
|
20
20
|
} from "../chunk-Y2CM7HXH.js";
|
|
21
21
|
import {
|
|
22
22
|
createPluginLogger,
|
|
23
23
|
createPluginState
|
|
24
|
-
} from "../chunk-
|
|
24
|
+
} from "../chunk-OZJXGX4U.js";
|
|
25
25
|
import {
|
|
26
26
|
disconnectStateAdapter,
|
|
27
27
|
getConnectedStateContext
|
|
28
|
-
} from "../chunk-
|
|
28
|
+
} from "../chunk-ZATRYQLR.js";
|
|
29
29
|
import {
|
|
30
30
|
createJuniorSqlExecutor,
|
|
31
31
|
createSqlStore,
|
|
32
32
|
getDb
|
|
33
|
-
} from "../chunk-
|
|
33
|
+
} from "../chunk-NIFONS4W.js";
|
|
34
34
|
import {
|
|
35
35
|
getChatConfig
|
|
36
|
-
} from "../chunk-
|
|
37
|
-
import "../chunk-
|
|
36
|
+
} from "../chunk-3F54A3YM.js";
|
|
37
|
+
import "../chunk-YYBX2BD5.js";
|
|
38
38
|
import {
|
|
39
39
|
parseDestination,
|
|
40
40
|
sameDestination
|
|
41
41
|
} from "../chunk-GHGPTPBL.js";
|
|
42
42
|
import {
|
|
43
43
|
pluginCatalogRuntime
|
|
44
|
-
} from "../chunk-
|
|
45
|
-
import "../chunk-
|
|
44
|
+
} from "../chunk-BTH37NCU.js";
|
|
45
|
+
import "../chunk-S6QKIGRM.js";
|
|
46
46
|
import {
|
|
47
47
|
isRecord,
|
|
48
48
|
toOptionalNumber,
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
closeDb,
|
|
3
3
|
getConversationStore,
|
|
4
4
|
getDb
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-NIFONS4W.js";
|
|
6
|
+
import "./chunk-3F54A3YM.js";
|
|
7
|
+
import "./chunk-YYBX2BD5.js";
|
|
8
8
|
import "./chunk-GHGPTPBL.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-S6QKIGRM.js";
|
|
10
10
|
import "./chunk-OB42YVAE.js";
|
|
11
11
|
import "./chunk-3DA7X2U3.js";
|
|
12
12
|
import "./chunk-LFLTJQVR.js";
|
package/dist/instrumentation.js
CHANGED
|
@@ -13,7 +13,7 @@ export interface ConversationUsage {
|
|
|
13
13
|
cacheCreationTokens?: number;
|
|
14
14
|
totalTokens?: number;
|
|
15
15
|
}
|
|
16
|
-
export interface
|
|
16
|
+
export interface ActorIdentity {
|
|
17
17
|
email?: string;
|
|
18
18
|
fullName?: string;
|
|
19
19
|
slackUserId?: string;
|
|
@@ -32,7 +32,7 @@ export interface ConversationSummaryReport {
|
|
|
32
32
|
lastProgressAt: string;
|
|
33
33
|
completedAt?: string;
|
|
34
34
|
surface: ConversationSurface;
|
|
35
|
-
|
|
35
|
+
actorIdentity?: ActorIdentity;
|
|
36
36
|
channel?: string;
|
|
37
37
|
channelName?: string;
|
|
38
38
|
channelNameRedacted?: boolean;
|
|
@@ -154,7 +154,7 @@ export interface ConversationStatsReport {
|
|
|
154
154
|
generatedAt: string;
|
|
155
155
|
hung: number;
|
|
156
156
|
locations: ConversationStatsItem[];
|
|
157
|
-
|
|
157
|
+
actors: ConversationStatsItem[];
|
|
158
158
|
sampleLimit: number;
|
|
159
159
|
sampleSize: number;
|
|
160
160
|
source: "conversation_index";
|
package/dist/reporting.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PluginOperationalReport } from "@sentry/junior-plugin-api";
|
|
2
2
|
import { type ConversationFeed, type PluginConversationSummary, type ConversationReport, type ConversationSubagentTranscriptReport, type ConversationStatsReport } from "./reporting/conversations";
|
|
3
|
-
export type { PluginConversationStatus, PluginConversations, PluginConversationSummary, ConversationActivityReport, ConversationActivityStatus, ConversationFeed, ConversationReport, ConversationReportStatus, ConversationRunReport, ConversationSubagentActivityReport, ConversationSubagentTranscriptReport, ConversationStatsItem, ConversationStatsReport, ConversationSummaryReport, ConversationSurface, ConversationToolActivityReport, ConversationUsage,
|
|
3
|
+
export type { PluginConversationStatus, PluginConversations, PluginConversationSummary, ConversationActivityReport, ConversationActivityStatus, ConversationFeed, ConversationReport, ConversationReportStatus, ConversationRunReport, ConversationSubagentActivityReport, ConversationSubagentTranscriptReport, ConversationStatsItem, ConversationStatsReport, ConversationSummaryReport, ConversationSurface, ConversationToolActivityReport, ConversationUsage, ActorIdentity, TranscriptMessage, TranscriptPart, TranscriptPartType, TranscriptRole, } from "./reporting/conversations";
|
|
4
4
|
export interface HealthReport {
|
|
5
5
|
status: "ok";
|
|
6
6
|
service: string;
|
package/dist/reporting.js
CHANGED
|
@@ -6,44 +6,45 @@ import {
|
|
|
6
6
|
getConversationDetails,
|
|
7
7
|
getConversationDetailsForIds,
|
|
8
8
|
resolveSlackConversationContextFromThreadId
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-N25HRI6B.js";
|
|
10
10
|
import {
|
|
11
|
-
buildSystemPrompt
|
|
12
|
-
|
|
13
|
-
} from "./chunk-PHZHJTCK.js";
|
|
11
|
+
buildSystemPrompt
|
|
12
|
+
} from "./chunk-BMQ5DXHV.js";
|
|
14
13
|
import {
|
|
15
14
|
getAgentTurnSessionRecord,
|
|
16
15
|
listAgentTurnSessionSummariesForConversation,
|
|
17
16
|
loadActivityEntries,
|
|
18
17
|
piContentMessageSchema
|
|
19
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-7FS3K243.js";
|
|
20
19
|
import {
|
|
21
20
|
getPluginOperationalReports
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import "./chunk-
|
|
21
|
+
} from "./chunk-VY7TVOIK.js";
|
|
22
|
+
import "./chunk-OZJXGX4U.js";
|
|
24
23
|
import "./chunk-G3E7SCME.js";
|
|
25
24
|
import {
|
|
26
25
|
getStateAdapter
|
|
27
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-ZATRYQLR.js";
|
|
28
27
|
import {
|
|
29
28
|
getConversationStore
|
|
30
|
-
} from "./chunk-
|
|
31
|
-
import
|
|
29
|
+
} from "./chunk-NIFONS4W.js";
|
|
30
|
+
import {
|
|
31
|
+
unwrapCurrentInstruction
|
|
32
|
+
} from "./chunk-3F54A3YM.js";
|
|
32
33
|
import {
|
|
33
34
|
canExposeConversationPayload,
|
|
34
35
|
parseSlackThreadId,
|
|
35
36
|
resolveConversationPrivacy
|
|
36
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-YYBX2BD5.js";
|
|
37
38
|
import "./chunk-GHGPTPBL.js";
|
|
38
39
|
import {
|
|
39
40
|
discoverSkills
|
|
40
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-YTNPU7I2.js";
|
|
41
42
|
import {
|
|
42
43
|
pluginCatalogRuntime
|
|
43
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-BTH37NCU.js";
|
|
44
45
|
import {
|
|
45
|
-
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
toStoredSlackActor
|
|
47
|
+
} from "./chunk-S6QKIGRM.js";
|
|
47
48
|
import {
|
|
48
49
|
isRecord
|
|
49
50
|
} from "./chunk-OB42YVAE.js";
|
|
@@ -103,18 +104,18 @@ function surfaceFromSource(source, conversationId) {
|
|
|
103
104
|
}
|
|
104
105
|
return surfaceFromConversationId(conversationId);
|
|
105
106
|
}
|
|
106
|
-
function
|
|
107
|
-
if (!
|
|
107
|
+
function actorIdentityReport(actor) {
|
|
108
|
+
if (!actor) return void 0;
|
|
108
109
|
const identity = {
|
|
109
|
-
...
|
|
110
|
-
...
|
|
111
|
-
...
|
|
112
|
-
...
|
|
110
|
+
...actor.email !== void 0 ? { email: actor.email } : {},
|
|
111
|
+
...actor.fullName !== void 0 ? { fullName: actor.fullName } : {},
|
|
112
|
+
...actor.slackUserId !== void 0 ? { slackUserId: actor.slackUserId } : {},
|
|
113
|
+
...actor.slackUserName !== void 0 ? { slackUserName: actor.slackUserName } : {}
|
|
113
114
|
};
|
|
114
115
|
return Object.keys(identity).length > 0 ? identity : void 0;
|
|
115
116
|
}
|
|
116
|
-
function
|
|
117
|
-
return
|
|
117
|
+
function sessionActorIdentityReport(actor) {
|
|
118
|
+
return actor?.platform === "slack" ? actorIdentityReport(toStoredSlackActor(actor)) : void 0;
|
|
118
119
|
}
|
|
119
120
|
function usageReport(usage) {
|
|
120
121
|
if (!usage) return void 0;
|
|
@@ -145,7 +146,7 @@ function sessionReportFromSummary(summary, nowMs = Date.now(), details, visibili
|
|
|
145
146
|
channel: slackThread?.channelId,
|
|
146
147
|
channelName: effectiveChannelName
|
|
147
148
|
}) ?? surfaceFallbackLabel(effectiveSurface);
|
|
148
|
-
const
|
|
149
|
+
const actorIdentity = actorIdentityReport(details?.originActor) ?? sessionActorIdentityReport(summary.actor);
|
|
149
150
|
const sentryTraceUrl = summary.traceId ? buildSentryTraceUrl(summary.traceId) : void 0;
|
|
150
151
|
const cumulativeUsage = usageReport(summary.cumulativeUsage);
|
|
151
152
|
return {
|
|
@@ -160,7 +161,7 @@ function sessionReportFromSummary(summary, nowMs = Date.now(), details, visibili
|
|
|
160
161
|
cumulativeDurationMs: summary.cumulativeDurationMs,
|
|
161
162
|
...cumulativeUsage ? { cumulativeUsage } : {},
|
|
162
163
|
surface: effectiveSurface,
|
|
163
|
-
...
|
|
164
|
+
...actorIdentity ? { actorIdentity } : {},
|
|
164
165
|
...slackThread ? { channel: slackThread.channelId } : {},
|
|
165
166
|
...channelName ? { channelName } : {},
|
|
166
167
|
...privateLabel ? { channelNameRedacted: true } : {},
|
|
@@ -240,7 +241,7 @@ function applyConversationIndexMetadata(args) {
|
|
|
240
241
|
args.conversation,
|
|
241
242
|
args.details
|
|
242
243
|
);
|
|
243
|
-
const
|
|
244
|
+
const actorIdentity = actorIdentityReport(args.details?.originActor) ?? args.report.actorIdentity ?? actorIdentityReport(args.conversation.actor);
|
|
244
245
|
const status = statusFromConversation(
|
|
245
246
|
args.conversation,
|
|
246
247
|
args.report.status,
|
|
@@ -261,7 +262,7 @@ function applyConversationIndexMetadata(args) {
|
|
|
261
262
|
status,
|
|
262
263
|
lastSeenAt: new Date(lastSeenAtMs).toISOString(),
|
|
263
264
|
surface,
|
|
264
|
-
...
|
|
265
|
+
...actorIdentity ? { actorIdentity } : {},
|
|
265
266
|
...slackThread ? { channel: slackThread.channelId } : {},
|
|
266
267
|
...effectiveChannelName ? { channelName: effectiveChannelName } : {},
|
|
267
268
|
...channelNameRedacted ? { channelNameRedacted: true } : {}
|
|
@@ -269,8 +270,8 @@ function applyConversationIndexMetadata(args) {
|
|
|
269
270
|
}
|
|
270
271
|
function sessionReportFromConversation(conversation, nowMs, details) {
|
|
271
272
|
const surface = details?.originSurface ?? surfaceFromSource(conversation.source, conversation.conversationId);
|
|
272
|
-
const
|
|
273
|
-
details?.
|
|
273
|
+
const actorIdentity = actorIdentityReport(
|
|
274
|
+
details?.originActor ?? conversation.actor
|
|
274
275
|
);
|
|
275
276
|
const slackThread = parseSlackThreadId(conversation.conversationId);
|
|
276
277
|
const channelName = channelNameFromConversation(conversation, details);
|
|
@@ -290,7 +291,7 @@ function sessionReportFromConversation(conversation, nowMs, details) {
|
|
|
290
291
|
startedAt: new Date(conversation.createdAtMs).toISOString(),
|
|
291
292
|
status: statusFromConversation(conversation, void 0, nowMs),
|
|
292
293
|
surface,
|
|
293
|
-
...
|
|
294
|
+
...actorIdentity ? { actorIdentity } : {},
|
|
294
295
|
...slackThread ? { channel: slackThread.channelId } : {},
|
|
295
296
|
...channelName ? { channelName } : {},
|
|
296
297
|
...channelNameRedacted ? { channelNameRedacted: true } : {}
|
|
@@ -356,11 +357,11 @@ function contributionTokenTotal(contributions) {
|
|
|
356
357
|
void 0
|
|
357
358
|
);
|
|
358
359
|
}
|
|
359
|
-
function
|
|
360
|
-
const email =
|
|
361
|
-
const fullName =
|
|
362
|
-
const slackUserName =
|
|
363
|
-
return email ?? fullName ?? slackUserName ??
|
|
360
|
+
function actorLabel(actor) {
|
|
361
|
+
const email = actor?.email?.trim() || void 0;
|
|
362
|
+
const fullName = actor?.fullName?.trim() || void 0;
|
|
363
|
+
const slackUserName = actor?.slackUserName?.trim() || void 0;
|
|
364
|
+
return email ?? fullName ?? slackUserName ?? actor?.slackUserId;
|
|
364
365
|
}
|
|
365
366
|
function slackStatsLocationLabel(input) {
|
|
366
367
|
const channelId = input.channel;
|
|
@@ -462,7 +463,7 @@ function conversationDurationMs(runs) {
|
|
|
462
463
|
}
|
|
463
464
|
function buildConversationStatsReport(args) {
|
|
464
465
|
const conversations = recentConversationGroups(args);
|
|
465
|
-
const
|
|
466
|
+
const actors = /* @__PURE__ */ new Map();
|
|
466
467
|
const locations = /* @__PURE__ */ new Map();
|
|
467
468
|
let durationMs = 0;
|
|
468
469
|
let tokens;
|
|
@@ -478,27 +479,24 @@ function buildConversationStatsReport(args) {
|
|
|
478
479
|
active += conversationSignals.active ? 1 : 0;
|
|
479
480
|
failed += conversationSignals.failed ? 1 : 0;
|
|
480
481
|
hung += conversationSignals.hung ? 1 : 0;
|
|
481
|
-
const
|
|
482
|
+
const actorRuns = /* @__PURE__ */ new Map();
|
|
482
483
|
for (const contribution of contributions) {
|
|
483
|
-
const
|
|
484
|
-
|
|
485
|
-
...requesterRuns.get(requester) ?? [],
|
|
486
|
-
contribution
|
|
487
|
-
]);
|
|
484
|
+
const actor = actorLabel(contribution.run.actorIdentity) ?? "Unknown";
|
|
485
|
+
actorRuns.set(actor, [...actorRuns.get(actor) ?? [], contribution]);
|
|
488
486
|
}
|
|
489
|
-
for (const [
|
|
490
|
-
const item =
|
|
487
|
+
for (const [actor, actorContributions] of actorRuns) {
|
|
488
|
+
const item = actors.get(actor) ?? emptyStatsItem(actor);
|
|
491
489
|
const signals = statusSignals(
|
|
492
|
-
|
|
490
|
+
actorContributions.map((contribution) => contribution.run)
|
|
493
491
|
);
|
|
494
492
|
item.conversations += 1;
|
|
495
|
-
item.runs +=
|
|
496
|
-
item.durationMs += contributionDurationTotal(
|
|
493
|
+
item.runs += actorContributions.length;
|
|
494
|
+
item.durationMs += contributionDurationTotal(actorContributions);
|
|
497
495
|
item.active += signals.active ? 1 : 0;
|
|
498
496
|
item.failed += signals.failed ? 1 : 0;
|
|
499
497
|
item.hung += signals.hung ? 1 : 0;
|
|
500
|
-
addItemTokens(item, contributionTokenTotal(
|
|
501
|
-
|
|
498
|
+
addItemTokens(item, contributionTokenTotal(actorContributions));
|
|
499
|
+
actors.set(actor, item);
|
|
502
500
|
}
|
|
503
501
|
const location = locationLabel(newestRun(runs));
|
|
504
502
|
const locationItem = locations.get(location) ?? emptyStatsItem(location);
|
|
@@ -519,7 +517,7 @@ function buildConversationStatsReport(args) {
|
|
|
519
517
|
generatedAt: args.generatedAt,
|
|
520
518
|
hung,
|
|
521
519
|
locations: statsItems(locations),
|
|
522
|
-
|
|
520
|
+
actors: statsItems(actors),
|
|
523
521
|
sampleLimit: args.sampleLimit,
|
|
524
522
|
sampleSize: args.sampleSize,
|
|
525
523
|
source: "conversation_index",
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
scheduleSessionCompletedPluginTasks,
|
|
9
9
|
updateConversationStats,
|
|
10
10
|
upsertConversationMessage
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-ACJENBVF.js";
|
|
12
12
|
import "./chunk-KNFROR7R.js";
|
|
13
13
|
import {
|
|
14
14
|
coerceThreadArtifactsState,
|
|
@@ -18,28 +18,28 @@ import {
|
|
|
18
18
|
markTurnFailed,
|
|
19
19
|
persistThreadStateById,
|
|
20
20
|
startActiveTurn
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-OJP53WIU.js";
|
|
22
22
|
import {
|
|
23
23
|
coerceThreadConversationState
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-PFXC67GJ.js";
|
|
25
25
|
import {
|
|
26
26
|
commitMessages,
|
|
27
27
|
loadProjection
|
|
28
|
-
} from "./chunk-
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
28
|
+
} from "./chunk-7FS3K243.js";
|
|
29
|
+
import "./chunk-VY7TVOIK.js";
|
|
30
|
+
import "./chunk-OZJXGX4U.js";
|
|
31
31
|
import "./chunk-G3E7SCME.js";
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
32
|
+
import "./chunk-ZATRYQLR.js";
|
|
33
|
+
import "./chunk-NIFONS4W.js";
|
|
34
34
|
import {
|
|
35
35
|
stripRuntimeTurnContext,
|
|
36
36
|
trimTrailingAssistantMessages
|
|
37
|
-
} from "./chunk-
|
|
38
|
-
import "./chunk-
|
|
37
|
+
} from "./chunk-3F54A3YM.js";
|
|
38
|
+
import "./chunk-YYBX2BD5.js";
|
|
39
39
|
import "./chunk-GHGPTPBL.js";
|
|
40
40
|
import {
|
|
41
41
|
logException
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-S6QKIGRM.js";
|
|
43
43
|
import "./chunk-OB42YVAE.js";
|
|
44
44
|
import "./chunk-3DA7X2U3.js";
|
|
45
45
|
import "./chunk-LFLTJQVR.js";
|
|
@@ -152,6 +152,12 @@ async function runLocalAgentTurn(input, deps) {
|
|
|
152
152
|
let reply;
|
|
153
153
|
let completedState;
|
|
154
154
|
let piMessagesBeforeRun;
|
|
155
|
+
const localActor = {
|
|
156
|
+
fullName: "Local CLI",
|
|
157
|
+
platform: "local",
|
|
158
|
+
userId: "local-cli",
|
|
159
|
+
userName: "local"
|
|
160
|
+
};
|
|
155
161
|
try {
|
|
156
162
|
const piMessages = await loadLocalPiMessages({
|
|
157
163
|
conversationId: input.conversationId,
|
|
@@ -168,16 +174,11 @@ async function runLocalAgentTurn(input, deps) {
|
|
|
168
174
|
},
|
|
169
175
|
routing: {
|
|
170
176
|
credentialContext: {
|
|
171
|
-
actor: {
|
|
177
|
+
actor: { platform: "system", name: "local-cli" }
|
|
172
178
|
},
|
|
173
179
|
destination,
|
|
174
180
|
source,
|
|
175
|
-
|
|
176
|
-
fullName: "Local CLI",
|
|
177
|
-
platform: "local",
|
|
178
|
-
userId: "local-cli",
|
|
179
|
-
userName: "local"
|
|
180
|
-
},
|
|
181
|
+
actor: localActor,
|
|
181
182
|
surface: "internal",
|
|
182
183
|
correlation: {
|
|
183
184
|
conversationId: input.conversationId,
|
|
@@ -289,6 +290,7 @@ async function runLocalAgentTurn(input, deps) {
|
|
|
289
290
|
usage: reply.diagnostics.usage,
|
|
290
291
|
destination,
|
|
291
292
|
source,
|
|
293
|
+
actor: localActor,
|
|
292
294
|
surface: "internal",
|
|
293
295
|
logContext: { modelId: reply.diagnostics.modelId }
|
|
294
296
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
validatePluginEgressCredentialHooks,
|
|
3
3
|
validatePluginRegistrations
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-MC4ZZE4Q.js";
|
|
5
|
+
import "./chunk-BTH37NCU.js";
|
|
6
|
+
import "./chunk-S6QKIGRM.js";
|
|
7
7
|
import "./chunk-OB42YVAE.js";
|
|
8
8
|
import "./chunk-3DA7X2U3.js";
|
|
9
9
|
import "./chunk-6APU57E6.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/junior",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.92.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"pg": "^8.16.3",
|
|
79
79
|
"yaml": "^2.9.0",
|
|
80
80
|
"zod": "^4.4.3",
|
|
81
|
-
"@sentry/junior-plugin-api": "0.
|
|
81
|
+
"@sentry/junior-plugin-api": "0.92.0"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
84
|
"@emnapi/core": "^1.10.0",
|
|
@@ -94,10 +94,10 @@
|
|
|
94
94
|
"typescript": "^6.0.3",
|
|
95
95
|
"vercel": "^54.4.0",
|
|
96
96
|
"vitest": "^4.1.7",
|
|
97
|
-
"@sentry/junior-
|
|
98
|
-
"@sentry/junior-memory": "0.
|
|
99
|
-
"@sentry/junior-
|
|
100
|
-
"@sentry/junior-
|
|
97
|
+
"@sentry/junior-github": "0.92.0",
|
|
98
|
+
"@sentry/junior-memory": "0.92.0",
|
|
99
|
+
"@sentry/junior-scheduler": "0.92.0",
|
|
100
|
+
"@sentry/junior-testing": "0.0.0"
|
|
101
101
|
},
|
|
102
102
|
"scripts": {
|
|
103
103
|
"build": "tsup && tsc -p tsconfig.build.json --emitDeclarationOnly",
|
package/dist/chat/requester.d.ts
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Canonical requester identity.
|
|
3
|
-
*
|
|
4
|
-
* Runtime requesters are platform-scoped actors. Stored Slack requester parsing
|
|
5
|
-
* remains explicit so durable conversation metadata is not repaired on read.
|
|
6
|
-
*/
|
|
7
|
-
import { z } from "zod";
|
|
8
|
-
export declare const storedSlackRequesterSchema: z.ZodObject<{
|
|
9
|
-
email: z.ZodOptional<z.ZodString>;
|
|
10
|
-
fullName: z.ZodOptional<z.ZodString>;
|
|
11
|
-
platform: z.ZodOptional<z.ZodLiteral<"slack">>;
|
|
12
|
-
slackUserId: z.ZodOptional<z.ZodString>;
|
|
13
|
-
slackUserName: z.ZodOptional<z.ZodString>;
|
|
14
|
-
teamId: z.ZodOptional<z.ZodString>;
|
|
15
|
-
}, z.core.$strict>;
|
|
16
|
-
interface BaseRequester {
|
|
17
|
-
email?: string;
|
|
18
|
-
fullName?: string;
|
|
19
|
-
userId: string;
|
|
20
|
-
userName?: string;
|
|
21
|
-
}
|
|
22
|
-
export interface SlackRequester extends BaseRequester {
|
|
23
|
-
platform: "slack";
|
|
24
|
-
teamId: string;
|
|
25
|
-
}
|
|
26
|
-
export interface LocalRequester extends BaseRequester {
|
|
27
|
-
platform: "local";
|
|
28
|
-
}
|
|
29
|
-
export type Requester = SlackRequester | LocalRequester;
|
|
30
|
-
export interface SlackRequesterProfile {
|
|
31
|
-
email?: string;
|
|
32
|
-
fullName?: string;
|
|
33
|
-
userName?: string;
|
|
34
|
-
}
|
|
35
|
-
export type StoredSlackRequester = z.output<typeof storedSlackRequesterSchema>;
|
|
36
|
-
/** Parse a serialized runtime requester that crossed a durable boundary. */
|
|
37
|
-
export declare function parseRequester(value: unknown): Requester | undefined;
|
|
38
|
-
interface RequesterInput {
|
|
39
|
-
email?: string;
|
|
40
|
-
fullName?: string;
|
|
41
|
-
platform?: Requester["platform"];
|
|
42
|
-
teamId?: string;
|
|
43
|
-
userId?: string;
|
|
44
|
-
userName?: string;
|
|
45
|
-
}
|
|
46
|
-
/** Keep actor ids exact at platform boundaries before they enter owned state. */
|
|
47
|
-
export declare function parseActorUserId(value: unknown): string | undefined;
|
|
48
|
-
/** Assert persisted actor ids without read-side repair. */
|
|
49
|
-
export declare function isActorUserId(value: string | undefined): value is string;
|
|
50
|
-
/** Build Junior's canonical platform requester from exact actor ids and profile data. */
|
|
51
|
-
export declare function createRequester(input: RequesterInput | undefined, context: {
|
|
52
|
-
platform?: Requester["platform"];
|
|
53
|
-
teamId?: string;
|
|
54
|
-
userId?: string;
|
|
55
|
-
}): Requester | undefined;
|
|
56
|
-
/** Build Junior's canonical requester from Slack profile data. */
|
|
57
|
-
export declare function createSlackRequester(teamId: string, userId: string, profile: SlackRequesterProfile | null | undefined): SlackRequester;
|
|
58
|
-
/** Parse a serialized Slack requester that crossed a runtime boundary. */
|
|
59
|
-
export declare function parseStoredSlackRequester(value: unknown): StoredSlackRequester | undefined;
|
|
60
|
-
/** Convert a runtime Slack requester into its durable session shape. */
|
|
61
|
-
export declare function toStoredSlackRequester(requester: SlackRequester): StoredSlackRequester;
|
|
62
|
-
/** Resolve a Slack resume requester from stored profile data and the active actor. */
|
|
63
|
-
export declare function createSlackResumeRequester(args: {
|
|
64
|
-
requester?: Requester;
|
|
65
|
-
teamId: string;
|
|
66
|
-
userId: string;
|
|
67
|
-
}): SlackRequester;
|
|
68
|
-
export {};
|