@sentry/junior 0.179.0 → 0.181.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-32IDCLMW.js → agent-hooks-IQUW6ERD.js} +16 -18
- package/dist/api/schema/workspace.d.ts +2 -0
- package/dist/api/schema.js +1 -2
- package/dist/api.js +202 -199
- package/dist/app.d.ts +4 -0
- package/dist/app.js +300 -1259
- package/dist/catalog-runtime-PMQWNIXA.js +14 -0
- package/dist/chat/agent/sandbox.d.ts +0 -2
- package/dist/chat/api-turns/routing.d.ts +4 -0
- package/dist/chat/api-turns/work.d.ts +5 -0
- package/dist/chat/config.d.ts +5 -2
- package/dist/chat/configuration/defaults.d.ts +1 -1
- package/dist/chat/conversations/projection.d.ts +6 -4
- package/dist/chat/ingress/message-router.d.ts +3 -0
- package/dist/chat/model-profile.d.ts +8 -10
- package/dist/chat/pi/conversation-events.d.ts +3 -2
- package/dist/chat/plugins/agent-hooks.d.ts +1 -1
- package/dist/chat/plugins/task-queue.d.ts +40 -3
- package/dist/chat/plugins/task-runner.d.ts +1 -1
- package/dist/chat/queue/callback.d.ts +26 -0
- package/dist/chat/queue/sign.d.ts +30 -0
- package/dist/chat/sandbox/sandbox.d.ts +0 -2
- package/dist/chat/sandbox/session.d.ts +0 -2
- package/dist/chat/sandbox/skill-sync.d.ts +1 -1
- package/dist/chat/sandbox/snapshot/events.d.ts +23 -0
- package/dist/chat/sandbox/snapshot/job-callback.d.ts +5 -0
- package/dist/chat/sandbox/snapshot/job-queue.d.ts +26 -0
- package/dist/chat/sandbox/snapshot/job-runner.d.ts +11 -0
- package/dist/chat/sandbox/snapshot/not-ready-error.d.ts +6 -0
- package/dist/chat/sandbox/snapshot/workspace.d.ts +9 -3
- package/dist/chat/services/turn-router.d.ts +4 -3
- package/dist/chat/services/turn-session-routing.d.ts +1 -0
- package/dist/chat/task-execution/queue-signing.d.ts +10 -21
- package/dist/chat/task-execution/state.d.ts +48 -0
- package/dist/chat/task-execution/store.d.ts +28 -2
- package/dist/chat/task-execution/worker.d.ts +4 -1
- package/dist/chat/tools/handoff/tool.d.ts +1 -1
- package/dist/chat/tools/types.d.ts +2 -0
- package/dist/chat/workspaces/types.d.ts +2 -0
- package/dist/{chunk-Q5B3WTGG.js → chunk-3KCQEG6W.js} +42 -41
- package/dist/{chunk-XZY6G5YZ.js → chunk-3KSSALN4.js} +180 -87
- package/dist/{chunk-3AFVR5UC.js → chunk-3X55QRAG.js} +18 -16
- package/dist/{chunk-SLGGOASN.js → chunk-4IX32NSL.js} +46 -46
- package/dist/{chunk-6ZWRNC4D.js → chunk-6Y5B5PEX.js} +1 -1
- package/dist/chunk-7H2VZTWN.js +103 -0
- package/dist/{chunk-CGA4ERJ5.js → chunk-CEMMLV5L.js} +1 -1
- package/dist/{chunk-FIANEE7Z.js → chunk-CM5HNV2W.js} +6 -6
- package/dist/{chunk-TKB25A3L.js → chunk-CZYNWPWD.js} +2 -1
- package/dist/{chunk-3I7XE3PA.js → chunk-D6ZD7VXP.js} +49 -38
- package/dist/chunk-DKIJ2RP5.js +68 -0
- package/dist/{chunk-G2CAC4CV.js → chunk-DSA6WTRP.js} +74 -68
- package/dist/{chunk-OOUNJNMR.js → chunk-DWPN6SCH.js} +1 -1
- package/dist/{chunk-HQNE5APD.js → chunk-EBMRB6Z6.js} +100 -79
- package/dist/{chunk-ZQMG3CL5.js → chunk-EM7EECT5.js} +16 -16
- package/dist/{chunk-XSPSCWLH.js → chunk-ETJTXYHY.js} +4 -4
- package/dist/{chunk-FTGD2FBP.js → chunk-EU7KJDOG.js} +2 -2
- package/dist/{chunk-CJLBLELR.js → chunk-FWILPBVQ.js} +8 -61
- package/dist/{chunk-4GWXAILB.js → chunk-GPA3ZSYY.js} +1 -1
- package/dist/{chunk-U4TKB6F6.js → chunk-GREV5PJK.js} +108 -5
- package/dist/{chunk-KJLHIHFF.js → chunk-GWFRPQNP.js} +43 -230
- package/dist/{chunk-YFNAMRGE.js → chunk-HEBMSITT.js} +1 -1
- package/dist/chunk-HJ27A6YB.js +218 -0
- package/dist/{chunk-R5NWWYIS.js → chunk-HZHUMCNV.js} +5 -5
- package/dist/{chunk-RTRBYSF3.js → chunk-IJ6SS4WB.js} +1 -1
- package/dist/{chunk-B6ECUSVX.js → chunk-IKKETMQC.js} +8 -8
- package/dist/{chunk-R6U7N4FS.js → chunk-KKSVCHDO.js} +10 -3
- package/dist/{chunk-JMJNFEDC.js → chunk-KMBU4PJP.js} +9 -54
- package/dist/chunk-KQZX24QQ.js +164 -0
- package/dist/{chunk-GPLAT6H7.js → chunk-LCNPXLE7.js} +22 -18
- package/dist/{chunk-2HIPYNQI.js → chunk-LG5MYY6U.js} +33 -32
- package/dist/chunk-LZOQFC5F.js +209 -0
- package/dist/chunk-M3QYTBQ6.js +55 -0
- package/dist/{chunk-M63DETLL.js → chunk-N7TMSOZH.js} +6 -6
- package/dist/{chunk-FIDMHAO6.js → chunk-NQTA72Q3.js} +84 -274
- package/dist/{chunk-RZRYOLCE.js → chunk-PBKZQAUA.js} +2315 -1150
- package/dist/chunk-PEQXYSSE.js +45 -0
- package/dist/{chunk-3TM3FYLQ.js → chunk-PL57B6NC.js} +1 -1
- package/dist/{chunk-JT4WMD3C.js → chunk-PPYDHUEL.js} +144 -218
- package/dist/{chunk-5IRROPA5.js → chunk-Q2KY27IX.js} +129 -31
- package/dist/{chunk-VP4OVRDD.js → chunk-RNMASWLP.js} +69 -73
- package/dist/{chunk-FAS6AIMF.js → chunk-TDT2R77B.js} +8 -8
- package/dist/{chunk-TIEKUH4Q.js → chunk-TJHSAHQN.js} +4 -3
- package/dist/{chunk-H4HBKISO.js → chunk-TXKUKMVO.js} +1 -1
- package/dist/chunk-X6GDDWQH.js +60 -0
- package/dist/{chunk-GENV6KF2.js → chunk-XYTJUHRZ.js} +108 -76
- package/dist/cli/chat.js +47 -43
- package/dist/cli/check.js +13 -15
- package/dist/cli/env.js +0 -1
- package/dist/cli/init.js +0 -1
- package/dist/cli/main.js +2 -3
- package/dist/cli/plugins.js +18 -20
- package/dist/cli/run.js +0 -1
- package/dist/cli/snapshot-create.js +14 -16
- package/dist/cli/upgrade.js +16 -18
- package/dist/{conversation-work-KATFHLG3.js → conversation-work-VIOQ5ZF3.js} +0 -2
- package/dist/db/schema/snapshots.d.ts +17 -0
- package/dist/db/schema.d.ts +17 -0
- package/dist/{db-EJAV7JL6.js → db-QNPVCQPT.js} +8 -10
- package/dist/deployment.d.ts +1 -0
- package/dist/{discovery-GUFTFBTL.js → discovery-DWVDM7UK.js} +1 -2
- package/dist/{experimental-XVDOSRBS.js → experimental-SIJSRDJD.js} +0 -1
- package/dist/instrumentation.js +7 -9
- package/dist/nitro.js +39 -13
- package/dist/{oauth-callback-server-GAVSUBTQ.js → oauth-callback-server-KYMPJOTC.js} +34 -32
- package/dist/{oauth-relay-3ZU72UGL.js → oauth-relay-5XPVRPYB.js} +0 -1
- package/dist/{plugins-HW4VWW6G.js → plugins-YTYJMMJF.js} +1 -2
- package/dist/{runner-34JL64JF.js → runner-3RS2D2ZR.js} +39 -33
- package/dist/{sandbox-egress-signals-DXOOBSBI.js → sandbox-egress-signals-FIL7EGPR.js} +5 -6
- package/dist/{sentry-JMWTS32N.js → sentry-MB3NL3IR.js} +1 -2
- package/dist/skills-5B3Y6XX6.js +27 -0
- package/dist/spawn-VYARS3DU.js +37 -0
- package/dist/task-runner-4IXKKZHL.js +32 -0
- package/dist/validation-Q65QD27B.js +17 -0
- package/dist/vercel.js +0 -1
- package/dist/version.js +1 -2
- package/dist/work-DCMQWAAP.js +45 -0
- package/dist/worker-QL3CHLZL.js +22 -0
- package/migrations/0035_workspace_snapshot_size_bytes.sql +2 -0
- package/migrations/meta/0035_snapshot.json +3048 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +7 -6
- package/dist/catalog-runtime-FBVA6WAQ.js +0 -16
- package/dist/chat/plugins/task-callback.d.ts +0 -5
- package/dist/chat/plugins/task-message.d.ts +0 -23
- package/dist/chat/plugins/task-signing.d.ts +0 -31
- package/dist/chat/sandbox/snapshot/waiting-error.d.ts +0 -15
- package/dist/chat/services/workspace-snapshot-wait.d.ts +0 -27
- package/dist/chunk-5I6ORJUY.js +0 -127
- package/dist/chunk-6GWA276C.js +0 -72
- package/dist/chunk-MLKGABMK.js +0 -9
- package/dist/chunk-UT6X7XN7.js +0 -51
- package/dist/chunk-WR76IVA5.js +0 -130
- package/dist/skills-U545HALM.js +0 -29
- package/dist/spawn-I2S4IDUQ.js +0 -37
- package/dist/validation-EVXVGA44.js +0 -19
- package/dist/work-QOAUPDBU.js +0 -45
- package/dist/worker-5GX2IKLZ.js +0 -24
package/dist/api.js
CHANGED
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
workspaceListSchema,
|
|
42
42
|
workspaceParamsSchema,
|
|
43
43
|
workspaceSchema
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-CZYNWPWD.js";
|
|
45
45
|
import {
|
|
46
46
|
appendAndEnqueueApiConversationMessage,
|
|
47
47
|
authenticatePersonalToken,
|
|
@@ -57,22 +57,18 @@ import {
|
|
|
57
57
|
createVercelAttachmentStorage,
|
|
58
58
|
formatSlackConversationRedactedLabel,
|
|
59
59
|
listPersonalTokens,
|
|
60
|
-
lookupSlackUser,
|
|
61
60
|
readConversationAccessFromSql,
|
|
62
61
|
readHealthReport,
|
|
63
62
|
resolveSlackConversationContextFromThreadId,
|
|
64
63
|
revokePersonalToken,
|
|
65
64
|
viewerConversationMembership,
|
|
66
65
|
webActorFromEmail
|
|
67
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-PPYDHUEL.js";
|
|
68
67
|
import {
|
|
69
68
|
buildSentryConversationUrl,
|
|
70
69
|
getWebAuthorization
|
|
71
|
-
} from "./chunk-
|
|
72
|
-
import
|
|
73
|
-
cancelHumanFacingPendingMessages,
|
|
74
|
-
getConversation
|
|
75
|
-
} from "./chunk-5IRROPA5.js";
|
|
70
|
+
} from "./chunk-EU7KJDOG.js";
|
|
71
|
+
import "./chunk-LZOQFC5F.js";
|
|
76
72
|
import {
|
|
77
73
|
readTaskExecutionByConversationId,
|
|
78
74
|
readTaskExecutionDays,
|
|
@@ -80,8 +76,9 @@ import {
|
|
|
80
76
|
readTaskExecutionSummaries,
|
|
81
77
|
readTaskExecutions,
|
|
82
78
|
readTaskRuns
|
|
83
|
-
} from "./chunk-
|
|
84
|
-
import "./chunk-
|
|
79
|
+
} from "./chunk-GWFRPQNP.js";
|
|
80
|
+
import "./chunk-M3QYTBQ6.js";
|
|
81
|
+
import "./chunk-FWILPBVQ.js";
|
|
85
82
|
import {
|
|
86
83
|
healthReportSchema,
|
|
87
84
|
pluginOperationalReportFeedSchema,
|
|
@@ -89,11 +86,7 @@ import {
|
|
|
89
86
|
runtimeInfoReportSchema,
|
|
90
87
|
skillReportsSchema
|
|
91
88
|
} from "./chunk-UTL3MHPC.js";
|
|
92
|
-
import
|
|
93
|
-
getVercelConversationWorkQueue
|
|
94
|
-
} from "./chunk-WR76IVA5.js";
|
|
95
|
-
import "./chunk-JAL3CH4G.js";
|
|
96
|
-
import "./chunk-5I6ORJUY.js";
|
|
89
|
+
import "./chunk-KQZX24QQ.js";
|
|
97
90
|
import {
|
|
98
91
|
deleteEventTask,
|
|
99
92
|
eventTaskBelongsToUser,
|
|
@@ -104,25 +97,37 @@ import {
|
|
|
104
97
|
listEventTasksCreatedBy,
|
|
105
98
|
listPublicEventTasksForTeams,
|
|
106
99
|
listPublicScheduledTasksForTeams,
|
|
100
|
+
lookupSlackUser,
|
|
107
101
|
parseScheduledTaskRow,
|
|
108
102
|
readLiveAttachment,
|
|
109
103
|
readScheduledTask,
|
|
110
104
|
readStats,
|
|
111
105
|
saveScheduledTask
|
|
112
|
-
} from "./chunk-
|
|
106
|
+
} from "./chunk-3KSSALN4.js";
|
|
113
107
|
import {
|
|
114
108
|
parseSlackThreadId
|
|
115
|
-
} from "./chunk-
|
|
109
|
+
} from "./chunk-TDT2R77B.js";
|
|
110
|
+
import {
|
|
111
|
+
cancelHumanFacingPendingMessages,
|
|
112
|
+
getConversation
|
|
113
|
+
} from "./chunk-Q2KY27IX.js";
|
|
114
|
+
import "./chunk-HJ27A6YB.js";
|
|
116
115
|
import {
|
|
117
116
|
agentTurnUsageSchema,
|
|
118
117
|
fallbackShortTitle,
|
|
119
118
|
hasAgentTurnUsage,
|
|
120
119
|
renderJuniorNativeConversationEvent
|
|
121
|
-
} from "./chunk-
|
|
120
|
+
} from "./chunk-NQTA72Q3.js";
|
|
122
121
|
import {
|
|
123
122
|
getCachedSnapshot
|
|
124
|
-
} from "./chunk-
|
|
123
|
+
} from "./chunk-IKKETMQC.js";
|
|
125
124
|
import "./chunk-PDO5BLNM.js";
|
|
125
|
+
import {
|
|
126
|
+
getVercelConversationWorkQueue
|
|
127
|
+
} from "./chunk-DKIJ2RP5.js";
|
|
128
|
+
import "./chunk-JAL3CH4G.js";
|
|
129
|
+
import "./chunk-7H2VZTWN.js";
|
|
130
|
+
import "./chunk-GPA3ZSYY.js";
|
|
126
131
|
import {
|
|
127
132
|
SANDBOX_RUNTIME,
|
|
128
133
|
WorkspaceValidationError,
|
|
@@ -142,7 +147,7 @@ import {
|
|
|
142
147
|
updateWorkspace,
|
|
143
148
|
withSlackRetries,
|
|
144
149
|
workspaceRepoCheckoutPath
|
|
145
|
-
} from "./chunk-
|
|
150
|
+
} from "./chunk-D6ZD7VXP.js";
|
|
146
151
|
import "./chunk-3Y47VMHV.js";
|
|
147
152
|
import {
|
|
148
153
|
decodeStoredConversationEvent,
|
|
@@ -152,7 +157,7 @@ import {
|
|
|
152
157
|
locationFromRow,
|
|
153
158
|
parseSessionSource,
|
|
154
159
|
resolveRootConversationId
|
|
155
|
-
} from "./chunk-
|
|
160
|
+
} from "./chunk-RNMASWLP.js";
|
|
156
161
|
import {
|
|
157
162
|
conversationReadColumns,
|
|
158
163
|
juniorConversationEvents,
|
|
@@ -161,35 +166,33 @@ import {
|
|
|
161
166
|
juniorIdentities,
|
|
162
167
|
juniorSchedulerTasks,
|
|
163
168
|
juniorUsers
|
|
164
|
-
} from "./chunk-
|
|
169
|
+
} from "./chunk-KKSVCHDO.js";
|
|
165
170
|
import {
|
|
166
171
|
create,
|
|
167
172
|
hash
|
|
168
|
-
} from "./chunk-
|
|
169
|
-
import "./chunk-
|
|
170
|
-
import "./chunk-GENV6KF2.js";
|
|
173
|
+
} from "./chunk-KMBU4PJP.js";
|
|
174
|
+
import "./chunk-PL57B6NC.js";
|
|
171
175
|
import {
|
|
172
176
|
juniorDestinations
|
|
173
177
|
} from "./chunk-VFUK3X5B.js";
|
|
174
|
-
import "./chunk-
|
|
175
|
-
import "./chunk-
|
|
176
|
-
import "./chunk-
|
|
177
|
-
import "./chunk-
|
|
178
|
+
import "./chunk-XYTJUHRZ.js";
|
|
179
|
+
import "./chunk-ETJTXYHY.js";
|
|
180
|
+
import "./chunk-HEBMSITT.js";
|
|
181
|
+
import "./chunk-4IX32NSL.js";
|
|
182
|
+
import "./chunk-CEMMLV5L.js";
|
|
178
183
|
import {
|
|
179
184
|
parseSlackChannelId,
|
|
180
185
|
parseSlackMessageTs,
|
|
181
186
|
parseSlackTeamId
|
|
182
|
-
} from "./chunk-
|
|
187
|
+
} from "./chunk-N7TMSOZH.js";
|
|
188
|
+
import "./chunk-DWPN6SCH.js";
|
|
189
|
+
import "./chunk-TXKUKMVO.js";
|
|
183
190
|
import {
|
|
184
191
|
logException,
|
|
185
192
|
logWarn
|
|
186
|
-
} from "./chunk-
|
|
187
|
-
import "./chunk-
|
|
188
|
-
import "./chunk-
|
|
189
|
-
import "./chunk-H4HBKISO.js";
|
|
190
|
-
import "./chunk-UT6X7XN7.js";
|
|
191
|
-
import "./chunk-TIEKUH4Q.js";
|
|
192
|
-
import "./chunk-MLKGABMK.js";
|
|
193
|
+
} from "./chunk-EBMRB6Z6.js";
|
|
194
|
+
import "./chunk-PEQXYSSE.js";
|
|
195
|
+
import "./chunk-TJHSAHQN.js";
|
|
193
196
|
|
|
194
197
|
// src/api.ts
|
|
195
198
|
import { Hono as Hono8 } from "hono";
|
|
@@ -217,7 +220,7 @@ function emptyResponse(status = 204) {
|
|
|
217
220
|
}
|
|
218
221
|
function throwApiError(status, message2, cause) {
|
|
219
222
|
throw new HTTPException(status, {
|
|
220
|
-
...cause === void 0 ?
|
|
223
|
+
...cause === void 0 ? void 0 : { cause },
|
|
221
224
|
message: message2,
|
|
222
225
|
res: jsonResponse(apiErrorSchema, { error: message2 }, { status })
|
|
223
226
|
});
|
|
@@ -375,7 +378,7 @@ async function requireConversationAttachment(args) {
|
|
|
375
378
|
function actorFromViewer(viewer) {
|
|
376
379
|
const normalized = viewer.email.trim().toLowerCase();
|
|
377
380
|
return webActorFromEmail(normalized, {
|
|
378
|
-
...viewer.displayName ? { fullName: viewer.displayName } :
|
|
381
|
+
...viewer.displayName ? { fullName: viewer.displayName } : void 0,
|
|
379
382
|
userName: normalized.split("@")[0] || normalized
|
|
380
383
|
});
|
|
381
384
|
}
|
|
@@ -386,7 +389,7 @@ async function createConversationForViewer(viewer, body) {
|
|
|
386
389
|
actor: actorFromViewer(viewer),
|
|
387
390
|
idempotencyKey: body.idempotencyKey,
|
|
388
391
|
message: body.message,
|
|
389
|
-
...body.visibility ? { visibility: body.visibility } :
|
|
392
|
+
...body.visibility ? { visibility: body.visibility } : void 0
|
|
390
393
|
},
|
|
391
394
|
{
|
|
392
395
|
conversationStore: getConversationStore(),
|
|
@@ -610,9 +613,9 @@ function usageFromRow(row) {
|
|
|
610
613
|
...Object.fromEntries(
|
|
611
614
|
Object.entries(components).filter(([, value]) => value !== void 0)
|
|
612
615
|
),
|
|
613
|
-
...row.reasoningTokens === null ?
|
|
614
|
-
...row.totalTokens === null ?
|
|
615
|
-
...Object.keys(definedCost).length > 0 ? { cost: definedCost } :
|
|
616
|
+
...row.reasoningTokens === null ? void 0 : { reasoningTokens: row.reasoningTokens },
|
|
617
|
+
...row.totalTokens === null ? void 0 : { totalTokens: row.totalTokens },
|
|
618
|
+
...Object.keys(definedCost).length > 0 ? { cost: definedCost } : void 0
|
|
616
619
|
};
|
|
617
620
|
return hasAgentTurnUsage(result) ? agentTurnUsageSchema.parse(result) : void 0;
|
|
618
621
|
}
|
|
@@ -793,7 +796,7 @@ function sanitizeModelContentPart(value) {
|
|
|
793
796
|
if (!media.success) return void 0;
|
|
794
797
|
return {
|
|
795
798
|
type: media.data.type,
|
|
796
|
-
...media.data.mimeType ? { mimeType: media.data.mimeType } :
|
|
799
|
+
...media.data.mimeType ? { mimeType: media.data.mimeType } : void 0
|
|
797
800
|
};
|
|
798
801
|
}
|
|
799
802
|
function modelVisibleToolOutput(content) {
|
|
@@ -808,9 +811,9 @@ function reportMessageActorIdentity(data) {
|
|
|
808
811
|
const author = reportingMessageAuthorSchema.safeParse(data.meta?.author);
|
|
809
812
|
if (!author.success) return void 0;
|
|
810
813
|
const actorIdentity = {
|
|
811
|
-
...author.data.fullName ? { fullName: author.data.fullName } :
|
|
812
|
-
...author.data.userId ? { slackUserId: author.data.userId } :
|
|
813
|
-
...author.data.userName ? { slackUserName: author.data.userName } :
|
|
814
|
+
...author.data.fullName ? { fullName: author.data.fullName } : void 0,
|
|
815
|
+
...author.data.userId ? { slackUserId: author.data.userId } : void 0,
|
|
816
|
+
...author.data.userName ? { slackUserName: author.data.userName } : void 0
|
|
814
817
|
};
|
|
815
818
|
return Object.keys(actorIdentity).length > 0 ? actorIdentity : void 0;
|
|
816
819
|
}
|
|
@@ -827,7 +830,7 @@ function reportToolCalls(args) {
|
|
|
827
830
|
status: "running",
|
|
828
831
|
startedAt: new Date(args.createdAtMs).toISOString(),
|
|
829
832
|
startedSeq: args.seq,
|
|
830
|
-
...args.canExposePayload && call.data.arguments !== void 0 ? { input: call.data.arguments } :
|
|
833
|
+
...args.canExposePayload && call.data.arguments !== void 0 ? { input: call.data.arguments } : void 0
|
|
831
834
|
}
|
|
832
835
|
];
|
|
833
836
|
});
|
|
@@ -890,8 +893,8 @@ function reportToolResult(args) {
|
|
|
890
893
|
...args.start ? {
|
|
891
894
|
startedAt: new Date(args.start.createdAtMs).toISOString(),
|
|
892
895
|
startedSeq: args.start.seq
|
|
893
|
-
} :
|
|
894
|
-
...args.canExposePayload && output !== void 0 ? { output } :
|
|
896
|
+
} : void 0,
|
|
897
|
+
...args.canExposePayload && output !== void 0 ? { output } : void 0
|
|
895
898
|
}
|
|
896
899
|
]
|
|
897
900
|
};
|
|
@@ -917,7 +920,7 @@ function reportEventData(args) {
|
|
|
917
920
|
namespace: data.namespace,
|
|
918
921
|
name: data.name,
|
|
919
922
|
version: data.version,
|
|
920
|
-
...data.turnId ? { turnId: data.turnId } :
|
|
923
|
+
...data.turnId ? { turnId: data.turnId } : void 0,
|
|
921
924
|
presentation
|
|
922
925
|
};
|
|
923
926
|
}
|
|
@@ -928,10 +931,10 @@ function reportEventData(args) {
|
|
|
928
931
|
type: "message",
|
|
929
932
|
messageId: data.messageId,
|
|
930
933
|
role: data.role,
|
|
931
|
-
...data.meta?.source === "web" || data.meta?.source === "slack" ? { source: data.meta.source } :
|
|
932
|
-
...actorIdentity ? { actorIdentity } :
|
|
933
|
-
...typeof data.meta?.eventType === "string" ? { eventType: data.meta.eventType } :
|
|
934
|
-
...typeof data.meta?.explicitMention === "boolean" ? { explicitMention: data.meta.explicitMention } :
|
|
934
|
+
...data.meta?.source === "web" || data.meta?.source === "slack" ? { source: data.meta.source } : void 0,
|
|
935
|
+
...actorIdentity ? { actorIdentity } : void 0,
|
|
936
|
+
...typeof data.meta?.eventType === "string" ? { eventType: data.meta.eventType } : void 0,
|
|
937
|
+
...typeof data.meta?.explicitMention === "boolean" ? { explicitMention: data.meta.explicitMention } : void 0,
|
|
935
938
|
...args.canExposePayload ? { text: data.text } : { redacted: true }
|
|
936
939
|
};
|
|
937
940
|
}
|
|
@@ -945,7 +948,7 @@ function reportEventData(args) {
|
|
|
945
948
|
type: "turn_lifecycle",
|
|
946
949
|
turnId: data.turnId,
|
|
947
950
|
state: "started",
|
|
948
|
-
...data.inputMessageIds.length > 0 ? { inputMessageIds: data.inputMessageIds } :
|
|
951
|
+
...data.inputMessageIds.length > 0 ? { inputMessageIds: data.inputMessageIds } : void 0
|
|
949
952
|
};
|
|
950
953
|
case "turn_context":
|
|
951
954
|
if (!args.canExposePayload) {
|
|
@@ -973,9 +976,9 @@ function reportEventData(args) {
|
|
|
973
976
|
turnId: data.turnId,
|
|
974
977
|
modelProfile: data.modelProfile,
|
|
975
978
|
modelId: data.modelId,
|
|
976
|
-
...data.costUsd !== void 0 ? { costUsd: data.costUsd } :
|
|
979
|
+
...data.costUsd !== void 0 ? { costUsd: data.costUsd } : void 0,
|
|
977
980
|
reasoningLevel: data.reasoningLevel,
|
|
978
|
-
...data.confidence !== void 0 ? { confidence: data.confidence } :
|
|
981
|
+
...data.confidence !== void 0 ? { confidence: data.confidence } : void 0,
|
|
979
982
|
source: data.source
|
|
980
983
|
};
|
|
981
984
|
case "guardian_action_reviewed":
|
|
@@ -1006,8 +1009,8 @@ function reportEventData(args) {
|
|
|
1006
1009
|
type: "compaction",
|
|
1007
1010
|
modelProfile: data.modelProfile,
|
|
1008
1011
|
modelId: data.modelId,
|
|
1009
|
-
...args.canExposePayload && data.summary ? { summary: data.summary } :
|
|
1010
|
-
...data.details ? { details: data.details } :
|
|
1012
|
+
...args.canExposePayload && data.summary ? { summary: data.summary } : void 0,
|
|
1013
|
+
...data.details ? { details: data.details } : void 0
|
|
1011
1014
|
};
|
|
1012
1015
|
default:
|
|
1013
1016
|
return void 0;
|
|
@@ -1052,7 +1055,7 @@ function projectConversationReportEventPage(args) {
|
|
|
1052
1055
|
data = reportAssistantMessage(reportArgs) ?? reportToolResult({
|
|
1053
1056
|
canExposePayload: args.canExposePayload,
|
|
1054
1057
|
message: event.data,
|
|
1055
|
-
...start && start.seq < event.seq ? { start } :
|
|
1058
|
+
...start && start.seq < event.seq ? { start } : void 0
|
|
1056
1059
|
});
|
|
1057
1060
|
} else if (event.data.type === "tool_execution_started") {
|
|
1058
1061
|
toolStarts.set(event.data.toolCallId, {
|
|
@@ -1085,7 +1088,7 @@ function projectConversationReportEventPage(args) {
|
|
|
1085
1088
|
childConversationId: event.data.childConversationId,
|
|
1086
1089
|
subagentKind: event.data.subagentKind,
|
|
1087
1090
|
status: "running",
|
|
1088
|
-
...event.data.parentToolCallId ? { parentToolCallId: event.data.parentToolCallId } :
|
|
1091
|
+
...event.data.parentToolCallId ? { parentToolCallId: event.data.parentToolCallId } : void 0
|
|
1089
1092
|
};
|
|
1090
1093
|
} else if (event.data.type === "subagent_ended") {
|
|
1091
1094
|
const started = subagentStarts.get(event.data.subagentInvocationId);
|
|
@@ -1096,7 +1099,7 @@ function projectConversationReportEventPage(args) {
|
|
|
1096
1099
|
startedAt: new Date(started.createdAtMs).toISOString(),
|
|
1097
1100
|
childConversationId: started.data.childConversationId,
|
|
1098
1101
|
subagentKind: started.data.subagentKind,
|
|
1099
|
-
...started.data.parentToolCallId ? { parentToolCallId: started.data.parentToolCallId } :
|
|
1102
|
+
...started.data.parentToolCallId ? { parentToolCallId: started.data.parentToolCallId } : void 0,
|
|
1100
1103
|
status: event.data.outcome === "success" ? "completed" : event.data.outcome
|
|
1101
1104
|
};
|
|
1102
1105
|
subagentStarts.delete(event.data.subagentInvocationId);
|
|
@@ -1106,9 +1109,9 @@ function projectConversationReportEventPage(args) {
|
|
|
1106
1109
|
type: "handoff",
|
|
1107
1110
|
modelProfile: event.data.modelProfile,
|
|
1108
1111
|
modelId: event.data.modelId,
|
|
1109
|
-
...event.data.reasoningLevel ? { reasoningLevel: event.data.reasoningLevel } :
|
|
1110
|
-
...event.data.triggeringToolCallId ? { triggeringToolCallId: event.data.triggeringToolCallId } :
|
|
1111
|
-
...args.canExposePayload && event.data.summary ? { summary: event.data.summary } :
|
|
1112
|
+
...event.data.reasoningLevel ? { reasoningLevel: event.data.reasoningLevel } : void 0,
|
|
1113
|
+
...event.data.triggeringToolCallId ? { triggeringToolCallId: event.data.triggeringToolCallId } : void 0,
|
|
1114
|
+
...args.canExposePayload && event.data.summary ? { summary: event.data.summary } : void 0
|
|
1112
1115
|
};
|
|
1113
1116
|
} else {
|
|
1114
1117
|
data = reportEventData({
|
|
@@ -1170,7 +1173,7 @@ function decodeConversationEventRow(row) {
|
|
|
1170
1173
|
schemaVersion: row.schemaVersion,
|
|
1171
1174
|
seq: row.seq,
|
|
1172
1175
|
historyVersion: row.historyVersion,
|
|
1173
|
-
...row.idempotencyKey ? { idempotencyKey: row.idempotencyKey } :
|
|
1176
|
+
...row.idempotencyKey ? { idempotencyKey: row.idempotencyKey } : void 0,
|
|
1174
1177
|
createdAtMs: row.createdAt.getTime(),
|
|
1175
1178
|
type: row.type,
|
|
1176
1179
|
payload: row.payload
|
|
@@ -1232,7 +1235,7 @@ async function readConversationEventPage(executor, args) {
|
|
|
1232
1235
|
const events = projected.slice(-args.limit);
|
|
1233
1236
|
return {
|
|
1234
1237
|
events,
|
|
1235
|
-
...projected.length > events.length && events[0] ? { previousSeq: events[0].seq } :
|
|
1238
|
+
...projected.length > events.length && events[0] ? { previousSeq: events[0].seq } : void 0
|
|
1236
1239
|
};
|
|
1237
1240
|
}
|
|
1238
1241
|
|
|
@@ -1301,10 +1304,10 @@ function sourceUrlFromConversation(args) {
|
|
|
1301
1304
|
function actorIdentityReport(actor) {
|
|
1302
1305
|
if (!actor) return void 0;
|
|
1303
1306
|
const identity = {
|
|
1304
|
-
...actor.email !== void 0 ? { email: actor.email } :
|
|
1305
|
-
...actor.fullName !== void 0 ? { fullName: actor.fullName } :
|
|
1306
|
-
...actor.slackUserId !== void 0 ? { slackUserId: actor.slackUserId } :
|
|
1307
|
-
...actor.slackUserName !== void 0 ? { slackUserName: actor.slackUserName } :
|
|
1307
|
+
...actor.email !== void 0 ? { email: actor.email } : void 0,
|
|
1308
|
+
...actor.fullName !== void 0 ? { fullName: actor.fullName } : void 0,
|
|
1309
|
+
...actor.slackUserId !== void 0 ? { slackUserId: actor.slackUserId } : void 0,
|
|
1310
|
+
...actor.slackUserName !== void 0 ? { slackUserName: actor.slackUserName } : void 0
|
|
1308
1311
|
};
|
|
1309
1312
|
return Object.keys(identity).length > 0 ? identity : void 0;
|
|
1310
1313
|
}
|
|
@@ -1323,7 +1326,7 @@ function titleFromConversation(args) {
|
|
|
1323
1326
|
const slackConversation = resolveSlackConversationContextFromThreadId({
|
|
1324
1327
|
threadId: args.conversation.conversationId,
|
|
1325
1328
|
channelName: effectiveChannelName,
|
|
1326
|
-
...args.visibility ? { visibility: args.visibility } :
|
|
1329
|
+
...args.visibility ? { visibility: args.visibility } : void 0
|
|
1327
1330
|
});
|
|
1328
1331
|
const privateLabel = args.canViewPrivateContent ? void 0 : privateConversationLabel(slackConversation);
|
|
1329
1332
|
return privateLabel ?? args.conversation.title ?? slackStatsLocationLabel({
|
|
@@ -1340,7 +1343,7 @@ function channelNameFromConversation(conversation, canViewPrivateContent, visibi
|
|
|
1340
1343
|
const slackConversation = resolveSlackConversationContextFromThreadId({
|
|
1341
1344
|
threadId: conversation.conversationId,
|
|
1342
1345
|
channelName: effectiveChannelName,
|
|
1343
|
-
...visibility ? { visibility } :
|
|
1346
|
+
...visibility ? { visibility } : void 0
|
|
1344
1347
|
});
|
|
1345
1348
|
if (!canViewPrivateContent) {
|
|
1346
1349
|
return privateConversationLabel(slackConversation);
|
|
@@ -1377,7 +1380,7 @@ function conversationSummaryFromStoredConversation(args) {
|
|
|
1377
1380
|
const sourceUrl = sourceUrlFromConversation({
|
|
1378
1381
|
canViewPrivateContent,
|
|
1379
1382
|
conversation,
|
|
1380
|
-
...args.teamDomainByTeamId ? { teamDomainByTeamId: args.teamDomainByTeamId } :
|
|
1383
|
+
...args.teamDomainByTeamId ? { teamDomainByTeamId: args.teamDomainByTeamId } : void 0
|
|
1381
1384
|
});
|
|
1382
1385
|
const slackThread = parseSlackThreadId(conversation.conversationId);
|
|
1383
1386
|
const channelName = channelNameFromConversation(
|
|
@@ -1399,7 +1402,7 @@ function conversationSummaryFromStoredConversation(args) {
|
|
|
1399
1402
|
visibility
|
|
1400
1403
|
}),
|
|
1401
1404
|
isParticipant: args.access?.isParticipant ?? false,
|
|
1402
|
-
...visibility ? { visibility } :
|
|
1405
|
+
...visibility ? { visibility } : void 0,
|
|
1403
1406
|
lastProgressAt: new Date(
|
|
1404
1407
|
conversation.execution.updatedAtMs ?? conversation.updatedAtMs
|
|
1405
1408
|
).toISOString(),
|
|
@@ -1407,15 +1410,15 @@ function conversationSummaryFromStoredConversation(args) {
|
|
|
1407
1410
|
startedAt: new Date(conversation.createdAtMs).toISOString(),
|
|
1408
1411
|
status: statusFromConversation(conversation),
|
|
1409
1412
|
surface,
|
|
1410
|
-
...args.auxiliaryCosts ? { auxiliaryCosts: args.auxiliaryCosts } :
|
|
1411
|
-
...usage3 ? { cumulativeUsage: usage3 } :
|
|
1412
|
-
...actorIdentity ? { actorIdentity } :
|
|
1413
|
-
...sourceUrl ? { sourceUrl } :
|
|
1413
|
+
...args.auxiliaryCosts ? { auxiliaryCosts: args.auxiliaryCosts } : void 0,
|
|
1414
|
+
...usage3 ? { cumulativeUsage: usage3 } : void 0,
|
|
1415
|
+
...actorIdentity ? { actorIdentity } : void 0,
|
|
1416
|
+
...sourceUrl ? { sourceUrl } : void 0,
|
|
1414
1417
|
archivedAt: args.archivedAtMs === void 0 ? null : new Date(args.archivedAtMs).toISOString(),
|
|
1415
|
-
...slackThread ? { channel: slackThread.channelId } :
|
|
1416
|
-
...channelName ? { channelName } :
|
|
1417
|
-
...channelNameRedacted ? { channelNameRedacted: true } :
|
|
1418
|
-
...args.locationId && !channelNameRedacted ? { locationId: args.locationId } :
|
|
1418
|
+
...slackThread ? { channel: slackThread.channelId } : void 0,
|
|
1419
|
+
...channelName ? { channelName } : void 0,
|
|
1420
|
+
...channelNameRedacted ? { channelNameRedacted: true } : void 0,
|
|
1421
|
+
...args.locationId && !channelNameRedacted ? { locationId: args.locationId } : void 0
|
|
1419
1422
|
};
|
|
1420
1423
|
}
|
|
1421
1424
|
|
|
@@ -1452,16 +1455,16 @@ function usageFromAggregate(row) {
|
|
|
1452
1455
|
componentTotal += value;
|
|
1453
1456
|
}
|
|
1454
1457
|
const cost2 = {
|
|
1455
|
-
...row.costInput === null ?
|
|
1456
|
-
...row.costOutput === null ?
|
|
1457
|
-
...row.costCacheRead === null ?
|
|
1458
|
-
...row.costCacheWrite === null ?
|
|
1459
|
-
...row.costTotal === null ?
|
|
1458
|
+
...row.costInput === null ? void 0 : { input: row.costInput },
|
|
1459
|
+
...row.costOutput === null ? void 0 : { output: row.costOutput },
|
|
1460
|
+
...row.costCacheRead === null ? void 0 : { cacheRead: row.costCacheRead },
|
|
1461
|
+
...row.costCacheWrite === null ? void 0 : { cacheWrite: row.costCacheWrite },
|
|
1462
|
+
...row.costTotal === null ? void 0 : { total: row.costTotal }
|
|
1460
1463
|
};
|
|
1461
1464
|
const result = {
|
|
1462
1465
|
...row.totalOnlyTokens === null ? components : { totalTokens: row.totalOnlyTokens + componentTotal },
|
|
1463
|
-
...row.reasoningTokens === null ?
|
|
1464
|
-
...Object.keys(cost2).length === 0 ?
|
|
1466
|
+
...row.reasoningTokens === null ? void 0 : { reasoningTokens: row.reasoningTokens },
|
|
1467
|
+
...Object.keys(cost2).length === 0 ? void 0 : { cost: cost2 }
|
|
1465
1468
|
};
|
|
1466
1469
|
return hasAgentTurnUsage(result) ? result : void 0;
|
|
1467
1470
|
}
|
|
@@ -1515,7 +1518,7 @@ async function readRootConversationMetricsFromSql(db, rootConversationIds) {
|
|
|
1515
1518
|
return [
|
|
1516
1519
|
[
|
|
1517
1520
|
row.rootConversationId,
|
|
1518
|
-
{ durationMs: row.durationMs, ...usage3 ? { usage: usage3 } :
|
|
1521
|
+
{ durationMs: row.durationMs, ...usage3 ? { usage: usage3 } : void 0 }
|
|
1519
1522
|
]
|
|
1520
1523
|
];
|
|
1521
1524
|
})
|
|
@@ -1848,11 +1851,11 @@ function conversationFromRow(row) {
|
|
|
1848
1851
|
const actorFullName = row.userDisplayName?.trim() ? row.userDisplayName : row.identityDisplayName;
|
|
1849
1852
|
const actor = row.identityProvider === "slack" ? {
|
|
1850
1853
|
platform: "slack",
|
|
1851
|
-
...row.identityEmail ? { email: row.identityEmail } :
|
|
1852
|
-
...actorFullName ? { fullName: actorFullName } :
|
|
1853
|
-
...row.identitySubjectId ? { slackUserId: row.identitySubjectId } :
|
|
1854
|
-
...row.identityHandle ? { slackUserName: row.identityHandle } :
|
|
1855
|
-
...row.identityTenantId ? { teamId: row.identityTenantId } :
|
|
1854
|
+
...row.identityEmail ? { email: row.identityEmail } : void 0,
|
|
1855
|
+
...actorFullName ? { fullName: actorFullName } : void 0,
|
|
1856
|
+
...row.identitySubjectId ? { slackUserId: row.identitySubjectId } : void 0,
|
|
1857
|
+
...row.identityHandle ? { slackUserName: row.identityHandle } : void 0,
|
|
1858
|
+
...row.identityTenantId ? { teamId: row.identityTenantId } : void 0
|
|
1856
1859
|
} : void 0;
|
|
1857
1860
|
const location = locationFromRow(row.destination);
|
|
1858
1861
|
return {
|
|
@@ -1863,16 +1866,16 @@ function conversationFromRow(row) {
|
|
|
1863
1866
|
updatedAtMs: value.updatedAt.getTime(),
|
|
1864
1867
|
execution: {
|
|
1865
1868
|
status: value.executionStatus,
|
|
1866
|
-
...value.runId ? { runId: value.runId } :
|
|
1867
|
-
...value.executionUpdatedAt ? { updatedAtMs: value.executionUpdatedAt.getTime() } :
|
|
1869
|
+
...value.runId ? { runId: value.runId } : void 0,
|
|
1870
|
+
...value.executionUpdatedAt ? { updatedAtMs: value.executionUpdatedAt.getTime() } : void 0
|
|
1868
1871
|
},
|
|
1869
|
-
...actor ? { actor } :
|
|
1870
|
-
...location ? { location } :
|
|
1871
|
-
...value.channelName ? { channelName: value.channelName } :
|
|
1872
|
-
...value.source ? { source: value.source } :
|
|
1873
|
-
...sessionSource ? { sessionSource } :
|
|
1874
|
-
...value.title ? { title: value.title } :
|
|
1875
|
-
...value.transcriptPurgedAt ? { transcriptPurgedAtMs: value.transcriptPurgedAt.getTime() } :
|
|
1872
|
+
...actor ? { actor } : void 0,
|
|
1873
|
+
...location ? { location } : void 0,
|
|
1874
|
+
...value.channelName ? { channelName: value.channelName } : void 0,
|
|
1875
|
+
...value.source ? { source: value.source } : void 0,
|
|
1876
|
+
...sessionSource ? { sessionSource } : void 0,
|
|
1877
|
+
...value.title ? { title: value.title } : void 0,
|
|
1878
|
+
...value.transcriptPurgedAt ? { transcriptPurgedAtMs: value.transcriptPurgedAt.getTime() } : void 0
|
|
1876
1879
|
};
|
|
1877
1880
|
}
|
|
1878
1881
|
async function readConversationRecordFromSql(conversationId) {
|
|
@@ -1898,7 +1901,7 @@ async function readConversationRecordFromSql(conversationId) {
|
|
|
1898
1901
|
return row ? {
|
|
1899
1902
|
conversation: conversationFromRow(row),
|
|
1900
1903
|
durationMs: row.conversation.durationMs,
|
|
1901
|
-
...row.destination?.visibility === "public" ? { locationId: row.destination.id } :
|
|
1904
|
+
...row.destination?.visibility === "public" ? { locationId: row.destination.id } : void 0,
|
|
1902
1905
|
usage: row.conversation.usage,
|
|
1903
1906
|
rootConversationId: row.conversation.rootConversationId
|
|
1904
1907
|
} : void 0;
|
|
@@ -1982,30 +1985,30 @@ async function readConversationFeedFromSql(options = {}) {
|
|
|
1982
1985
|
conversation.conversationId
|
|
1983
1986
|
);
|
|
1984
1987
|
const summary = conversationSummaryFromStoredConversation({
|
|
1985
|
-
...archivedAtMs === void 0 ?
|
|
1988
|
+
...archivedAtMs === void 0 ? void 0 : { archivedAtMs },
|
|
1986
1989
|
conversation,
|
|
1987
1990
|
access,
|
|
1988
1991
|
auxiliaryCosts: auxiliaryCostsByRoot.get(conversation.conversationId),
|
|
1989
1992
|
durationMs: metrics?.durationMs ?? row.conversation.durationMs,
|
|
1990
1993
|
teamDomainByTeamId,
|
|
1991
|
-
...row.destination?.visibility === "public" ? { locationId: row.destination.id } :
|
|
1994
|
+
...row.destination?.visibility === "public" ? { locationId: row.destination.id } : void 0,
|
|
1992
1995
|
usage: metrics?.usage ?? row.conversation.usage ?? void 0
|
|
1993
1996
|
});
|
|
1994
1997
|
const work = {
|
|
1995
|
-
...assignedWork.has(conversation.conversationId) ? { assignedWork: true } :
|
|
1998
|
+
...assignedWork.has(conversation.conversationId) ? { assignedWork: true } : void 0,
|
|
1996
1999
|
...conversationWork.finishedAtById[conversation.conversationId] ? {
|
|
1997
2000
|
finishedWorkAt: conversationWork.finishedAtById[conversation.conversationId]
|
|
1998
|
-
} :
|
|
1999
|
-
...unfinishedWork.has(conversation.conversationId) ? { unfinishedWork: true } :
|
|
2001
|
+
} : void 0,
|
|
2002
|
+
...unfinishedWork.has(conversation.conversationId) ? { unfinishedWork: true } : void 0
|
|
2000
2003
|
};
|
|
2001
2004
|
const annotations = access?.canViewPrivateContent ? annotationsByConversation.get(conversation.conversationId) ?? [] : [];
|
|
2002
2005
|
return {
|
|
2003
2006
|
...summary,
|
|
2004
2007
|
...work,
|
|
2005
|
-
...annotations.length > 0 ? { annotations } :
|
|
2008
|
+
...annotations.length > 0 ? { annotations } : void 0,
|
|
2006
2009
|
...sidebarAnnotationsByConversation[conversation.conversationId] ? {
|
|
2007
2010
|
sidebarAnnotations: sidebarAnnotationsByConversation[conversation.conversationId]
|
|
2008
|
-
} :
|
|
2011
|
+
} : void 0,
|
|
2009
2012
|
isPriority: isConversationPriority(
|
|
2010
2013
|
{
|
|
2011
2014
|
lastSeenAt: summary.lastSeenAt,
|
|
@@ -2074,7 +2077,7 @@ function encodeCursor(task, query) {
|
|
|
2074
2077
|
JSON.stringify({
|
|
2075
2078
|
createdAtMs: task.createdAtMs,
|
|
2076
2079
|
id: task.id,
|
|
2077
|
-
...query ? { query } :
|
|
2080
|
+
...query ? { query } : void 0,
|
|
2078
2081
|
version: 1
|
|
2079
2082
|
}),
|
|
2080
2083
|
"utf8"
|
|
@@ -2144,7 +2147,7 @@ async function listViewerScheduledTasks(db, user, input) {
|
|
|
2144
2147
|
const page = tasks.slice(0, input.limit);
|
|
2145
2148
|
return {
|
|
2146
2149
|
tasks: page,
|
|
2147
|
-
...tasks.length > input.limit && page.length > 0 ? { nextCursor: encodeCursor(page.at(-1), query) } :
|
|
2150
|
+
...tasks.length > input.limit && page.length > 0 ? { nextCursor: encodeCursor(page.at(-1), query) } : void 0
|
|
2148
2151
|
};
|
|
2149
2152
|
}
|
|
2150
2153
|
|
|
@@ -2245,8 +2248,8 @@ async function destinationDetails(destinations) {
|
|
|
2245
2248
|
}
|
|
2246
2249
|
function executionSummaryFields(stats) {
|
|
2247
2250
|
return {
|
|
2248
|
-
...stats?.lastConversationId ? { lastConversationId: stats.lastConversationId } :
|
|
2249
|
-
...stats?.lastExecutedAtMs ? { lastRunAt: new Date(stats.lastExecutedAtMs).toISOString() } :
|
|
2251
|
+
...stats?.lastConversationId ? { lastConversationId: stats.lastConversationId } : void 0,
|
|
2252
|
+
...stats?.lastExecutedAtMs ? { lastRunAt: new Date(stats.lastExecutedAtMs).toISOString() } : void 0,
|
|
2250
2253
|
runsLast7Days: stats?.runsLast7Days ?? 0,
|
|
2251
2254
|
totalRuns: stats?.totalRuns ?? 0
|
|
2252
2255
|
};
|
|
@@ -2260,7 +2263,7 @@ function scheduledTaskSummary(task, ownedByViewer, destination, stats, createdBy
|
|
|
2260
2263
|
return {
|
|
2261
2264
|
createdAt: new Date(task.createdAtMs).toISOString(),
|
|
2262
2265
|
createdBy: creatorLabel(task.createdBy),
|
|
2263
|
-
...createdByEmail ? { createdByEmail } :
|
|
2266
|
+
...createdByEmail ? { createdByEmail } : void 0,
|
|
2264
2267
|
destination: {
|
|
2265
2268
|
channelId: task.destination.channelId,
|
|
2266
2269
|
label: destination.label,
|
|
@@ -2271,7 +2274,7 @@ function scheduledTaskSummary(task, ownedByViewer, destination, stats, createdBy
|
|
|
2271
2274
|
instruction,
|
|
2272
2275
|
kind: "scheduled",
|
|
2273
2276
|
...executionSummaryFields(stats),
|
|
2274
|
-
...nextRunAtMs !== void 0 ? { nextRunAt: new Date(nextRunAtMs).toISOString() } :
|
|
2277
|
+
...nextRunAtMs !== void 0 ? { nextRunAt: new Date(nextRunAtMs).toISOString() } : void 0,
|
|
2275
2278
|
ownedByViewer,
|
|
2276
2279
|
schedule: displayText(task.schedule.description, "Schedule unavailable"),
|
|
2277
2280
|
status: task.status,
|
|
@@ -2283,7 +2286,7 @@ function eventTaskSummary(task, ownedByViewer, destination, stats, createdByEmai
|
|
|
2283
2286
|
return {
|
|
2284
2287
|
createdAt: new Date(task.createdAtMs).toISOString(),
|
|
2285
2288
|
createdBy: creatorLabel(task.createdBy),
|
|
2286
|
-
...createdByEmail ? { createdByEmail } :
|
|
2289
|
+
...createdByEmail ? { createdByEmail } : void 0,
|
|
2287
2290
|
destination: {
|
|
2288
2291
|
channelId: task.destination.channelId,
|
|
2289
2292
|
label: destination.label,
|
|
@@ -2594,12 +2597,12 @@ function projectConversationDetail(args) {
|
|
|
2594
2597
|
return {
|
|
2595
2598
|
...conversationSummaryFromStoredConversation({
|
|
2596
2599
|
access: args.access,
|
|
2597
|
-
...args.archivedAtMs === void 0 ?
|
|
2600
|
+
...args.archivedAtMs === void 0 ? void 0 : { archivedAtMs: args.archivedAtMs },
|
|
2598
2601
|
auxiliaryCosts: args.auxiliaryCosts,
|
|
2599
2602
|
conversation,
|
|
2600
2603
|
durationMs: args.durationMs,
|
|
2601
|
-
...args.locationId ? { locationId: args.locationId } :
|
|
2602
|
-
...args.teamDomainByTeamId ? { teamDomainByTeamId: args.teamDomainByTeamId } :
|
|
2604
|
+
...args.locationId ? { locationId: args.locationId } : void 0,
|
|
2605
|
+
...args.teamDomainByTeamId ? { teamDomainByTeamId: args.teamDomainByTeamId } : void 0,
|
|
2603
2606
|
usage: args.usage
|
|
2604
2607
|
}),
|
|
2605
2608
|
annotations: canExposePayload ? args.annotations : [],
|
|
@@ -2609,15 +2612,15 @@ function projectConversationDetail(args) {
|
|
|
2609
2612
|
conversationId,
|
|
2610
2613
|
seq: args.previousSeq
|
|
2611
2614
|
})
|
|
2612
|
-
} :
|
|
2613
|
-
...modelUsage.length > 0 ? { modelUsage } :
|
|
2615
|
+
} : void 0,
|
|
2616
|
+
...modelUsage.length > 0 ? { modelUsage } : void 0,
|
|
2614
2617
|
eventHistory: conversationEventHistory({
|
|
2615
2618
|
canExposePayload,
|
|
2616
|
-
...transcriptPurgedAtMs === void 0 ?
|
|
2619
|
+
...transcriptPurgedAtMs === void 0 ? void 0 : { transcriptPurgedAtMs }
|
|
2617
2620
|
}),
|
|
2618
2621
|
generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2619
|
-
...sentryConversationUrl ? { sentryConversationUrl } :
|
|
2620
|
-
...args.sourceTask ? { sourceTask: args.sourceTask } :
|
|
2622
|
+
...sentryConversationUrl ? { sentryConversationUrl } : void 0,
|
|
2623
|
+
...args.sourceTask ? { sourceTask: args.sourceTask } : void 0
|
|
2621
2624
|
};
|
|
2622
2625
|
}
|
|
2623
2626
|
async function readConversationDetailFromSql(conversationId, options) {
|
|
@@ -2650,7 +2653,7 @@ async function readConversationDetailFromSql(conversationId, options) {
|
|
|
2650
2653
|
),
|
|
2651
2654
|
readConversationSourceTask({
|
|
2652
2655
|
conversationId,
|
|
2653
|
-
...options.viewer ? { viewer: options.viewer } :
|
|
2656
|
+
...options.viewer ? { viewer: options.viewer } : void 0
|
|
2654
2657
|
}),
|
|
2655
2658
|
resolveSlackTeamDomains(
|
|
2656
2659
|
record.conversation.sessionSource?.platform === "slack" ? [record.conversation.sessionSource.teamId] : []
|
|
@@ -2666,15 +2669,15 @@ async function readConversationDetailFromSql(conversationId, options) {
|
|
|
2666
2669
|
return projectConversationDetail({
|
|
2667
2670
|
...record,
|
|
2668
2671
|
access,
|
|
2669
|
-
...archivedAtMs === void 0 ?
|
|
2672
|
+
...archivedAtMs === void 0 ? void 0 : { archivedAtMs },
|
|
2670
2673
|
annotations,
|
|
2671
2674
|
auxiliaryCosts: auxiliaryCostsByConversation.get(conversationId),
|
|
2672
2675
|
durationMs: metrics?.durationMs ?? record.durationMs,
|
|
2673
2676
|
events: page.events,
|
|
2674
2677
|
modelUsage,
|
|
2675
|
-
...sourceTask ? { sourceTask } :
|
|
2678
|
+
...sourceTask ? { sourceTask } : void 0,
|
|
2676
2679
|
teamDomainByTeamId,
|
|
2677
|
-
...page.previousSeq === void 0 ?
|
|
2680
|
+
...page.previousSeq === void 0 ? void 0 : { previousSeq: page.previousSeq },
|
|
2678
2681
|
usage: metrics?.usage ?? record.usage ?? void 0
|
|
2679
2682
|
});
|
|
2680
2683
|
}
|
|
@@ -2713,9 +2716,9 @@ async function readConversationEvents(conversationId, beforeValue, options = {})
|
|
|
2713
2716
|
events: page.events,
|
|
2714
2717
|
eventHistory: conversationEventHistory({
|
|
2715
2718
|
canExposePayload,
|
|
2716
|
-
...transcriptPurgedAtMs === void 0 ?
|
|
2719
|
+
...transcriptPurgedAtMs === void 0 ? void 0 : { transcriptPurgedAtMs }
|
|
2717
2720
|
}),
|
|
2718
|
-
...page.previousSeq === void 0 ?
|
|
2721
|
+
...page.previousSeq === void 0 ? void 0 : {
|
|
2719
2722
|
previousCursor: encodeConversationCursor({
|
|
2720
2723
|
conversationId,
|
|
2721
2724
|
seq: page.previousSeq
|
|
@@ -2745,8 +2748,8 @@ async function cancelConversationPendingMessagesForViewer(viewer, conversationId
|
|
|
2745
2748
|
try {
|
|
2746
2749
|
const result = await cancelHumanFacingPendingMessages({
|
|
2747
2750
|
conversationId,
|
|
2748
|
-
...body.inboundMessageIds ? { inboundMessageIds: body.inboundMessageIds } :
|
|
2749
|
-
...body.receivedBefore ? { receivedBeforeMs: Date.parse(body.receivedBefore) } :
|
|
2751
|
+
...body.inboundMessageIds ? { inboundMessageIds: body.inboundMessageIds } : void 0,
|
|
2752
|
+
...body.receivedBefore ? { receivedBeforeMs: Date.parse(body.receivedBefore) } : void 0,
|
|
2750
2753
|
conversationStore: getConversationStore()
|
|
2751
2754
|
});
|
|
2752
2755
|
return {
|
|
@@ -2789,7 +2792,7 @@ function isoFromMs(value) {
|
|
|
2789
2792
|
function actorIdentityFromApiMetadata(metadata) {
|
|
2790
2793
|
return {
|
|
2791
2794
|
email: metadata.authorEmail.trim().toLowerCase(),
|
|
2792
|
-
...metadata.authorFullName ? { fullName: metadata.authorFullName } :
|
|
2795
|
+
...metadata.authorFullName ? { fullName: metadata.authorFullName } : void 0
|
|
2793
2796
|
};
|
|
2794
2797
|
}
|
|
2795
2798
|
async function actorIdentityFromSlackMetadata(metadata, teamId) {
|
|
@@ -2802,9 +2805,9 @@ async function actorIdentityFromSlackMetadata(metadata, teamId) {
|
|
|
2802
2805
|
const email = profile?.email?.trim().toLowerCase();
|
|
2803
2806
|
return {
|
|
2804
2807
|
slackUserId,
|
|
2805
|
-
...slackUserName ? { slackUserName } :
|
|
2806
|
-
...fullName ? { fullName } :
|
|
2807
|
-
...email ? { email } :
|
|
2808
|
+
...slackUserName ? { slackUserName } : void 0,
|
|
2809
|
+
...fullName ? { fullName } : void 0,
|
|
2810
|
+
...email ? { email } : void 0
|
|
2808
2811
|
};
|
|
2809
2812
|
}
|
|
2810
2813
|
async function projectPendingMessage(message2, canExposePayload) {
|
|
@@ -2861,7 +2864,7 @@ async function projectPendingMessage(message2, canExposePayload) {
|
|
|
2861
2864
|
receivedAt: isoFromMs(message2.receivedAtMs),
|
|
2862
2865
|
role: "user",
|
|
2863
2866
|
source: "slack",
|
|
2864
|
-
...actorIdentity ? { actorIdentity } :
|
|
2867
|
+
...actorIdentity ? { actorIdentity } : void 0,
|
|
2865
2868
|
text
|
|
2866
2869
|
};
|
|
2867
2870
|
}
|
|
@@ -2895,7 +2898,7 @@ async function readConversationPendingMessages(conversationId, options = {}) {
|
|
|
2895
2898
|
completionText: authorization.completionText,
|
|
2896
2899
|
label: authorization.label
|
|
2897
2900
|
}
|
|
2898
|
-
} :
|
|
2901
|
+
} : void 0,
|
|
2899
2902
|
conversationId,
|
|
2900
2903
|
generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2901
2904
|
messages
|
|
@@ -3079,10 +3082,10 @@ function metricDays(rows, endMs) {
|
|
|
3079
3082
|
conversations: row?.conversations ?? 0,
|
|
3080
3083
|
date,
|
|
3081
3084
|
durationMs: row?.durationMs ?? 0,
|
|
3082
|
-
...row?.cachedInputTokens !== null && row?.cachedInputTokens !== void 0 ? { cachedInputTokens: row.cachedInputTokens } :
|
|
3083
|
-
...row?.costUsd !== null && row?.costUsd !== void 0 ? { costUsd: addUsd(void 0, row.costUsd) } :
|
|
3084
|
-
...row?.inputTokens !== null && row?.inputTokens !== void 0 ? { inputTokens: row.inputTokens } :
|
|
3085
|
-
...row?.tokens !== null && row?.tokens !== void 0 ? { tokens: row.tokens } :
|
|
3085
|
+
...row?.cachedInputTokens !== null && row?.cachedInputTokens !== void 0 ? { cachedInputTokens: row.cachedInputTokens } : void 0,
|
|
3086
|
+
...row?.costUsd !== null && row?.costUsd !== void 0 ? { costUsd: addUsd(void 0, row.costUsd) } : void 0,
|
|
3087
|
+
...row?.inputTokens !== null && row?.inputTokens !== void 0 ? { inputTokens: row.inputTokens } : void 0,
|
|
3088
|
+
...row?.tokens !== null && row?.tokens !== void 0 ? { tokens: row.tokens } : void 0
|
|
3086
3089
|
});
|
|
3087
3090
|
}
|
|
3088
3091
|
return days;
|
|
@@ -3115,7 +3118,7 @@ function guardianStats(rows, endMs) {
|
|
|
3115
3118
|
date,
|
|
3116
3119
|
deny: row?.deny ?? 0,
|
|
3117
3120
|
requests: row?.requests ?? 0,
|
|
3118
|
-
...row?.costUsd !== null && row?.costUsd !== void 0 ? { costUsd: row.costUsd } :
|
|
3121
|
+
...row?.costUsd !== null && row?.costUsd !== void 0 ? { costUsd: row.costUsd } : void 0
|
|
3119
3122
|
});
|
|
3120
3123
|
}
|
|
3121
3124
|
return {
|
|
@@ -3124,7 +3127,7 @@ function guardianStats(rows, endMs) {
|
|
|
3124
3127
|
deny,
|
|
3125
3128
|
metricDays: metricDays2,
|
|
3126
3129
|
requests,
|
|
3127
|
-
...costUsd !== void 0 ? { costUsd } :
|
|
3130
|
+
...costUsd !== void 0 ? { costUsd } : void 0
|
|
3128
3131
|
};
|
|
3129
3132
|
}
|
|
3130
3133
|
async function aggregateStats(db, start, end) {
|
|
@@ -3253,7 +3256,7 @@ async function readConversationStatsFromSql() {
|
|
|
3253
3256
|
}
|
|
3254
3257
|
return {
|
|
3255
3258
|
active: totals?.active ?? 0,
|
|
3256
|
-
...totals?.cachedInputTokens !== null && totals?.cachedInputTokens !== void 0 ? { cachedInputTokens: totals.cachedInputTokens } :
|
|
3259
|
+
...totals?.cachedInputTokens !== null && totals?.cachedInputTokens !== void 0 ? { cachedInputTokens: totals.cachedInputTokens } : void 0,
|
|
3257
3260
|
conversations: totals?.conversations ?? 0,
|
|
3258
3261
|
durationMs: totals?.durationMs ?? 0,
|
|
3259
3262
|
failed: totals?.failed ?? 0,
|
|
@@ -3263,9 +3266,9 @@ async function readConversationStatsFromSql() {
|
|
|
3263
3266
|
locations: statsItems(locations),
|
|
3264
3267
|
actors: statsItems(actors),
|
|
3265
3268
|
source: "conversation_index",
|
|
3266
|
-
...totals?.costUsd !== null && totals?.costUsd !== void 0 ? { costUsd: addUsd(void 0, totals.costUsd) } :
|
|
3267
|
-
...totals?.inputTokens !== null && totals?.inputTokens !== void 0 ? { inputTokens: totals.inputTokens } :
|
|
3268
|
-
...totals?.tokens !== null && totals?.tokens !== void 0 ? { tokens: totals.tokens } :
|
|
3269
|
+
...totals?.costUsd !== null && totals?.costUsd !== void 0 ? { costUsd: addUsd(void 0, totals.costUsd) } : void 0,
|
|
3270
|
+
...totals?.inputTokens !== null && totals?.inputTokens !== void 0 ? { inputTokens: totals.inputTokens } : void 0,
|
|
3271
|
+
...totals?.tokens !== null && totals?.tokens !== void 0 ? { tokens: totals.tokens } : void 0,
|
|
3269
3272
|
windowEnd: end.toISOString(),
|
|
3270
3273
|
windowStart: start.toISOString()
|
|
3271
3274
|
};
|
|
@@ -3294,9 +3297,9 @@ function createConversationRoutes(options) {
|
|
|
3294
3297
|
return jsonResponse(
|
|
3295
3298
|
conversationFeedSchema,
|
|
3296
3299
|
await readConversationFeed({
|
|
3297
|
-
...actorEmail ? { actorEmail } :
|
|
3300
|
+
...actorEmail ? { actorEmail } : void 0,
|
|
3298
3301
|
status,
|
|
3299
|
-
...viewer ? { viewer } :
|
|
3302
|
+
...viewer ? { viewer } : void 0
|
|
3300
3303
|
})
|
|
3301
3304
|
);
|
|
3302
3305
|
}
|
|
@@ -3386,7 +3389,7 @@ function createConversationRoutes(options) {
|
|
|
3386
3389
|
const viewer = context.get("viewer");
|
|
3387
3390
|
const report = await readConversationEvents(conversationId, before, {
|
|
3388
3391
|
limit,
|
|
3389
|
-
...viewer ? { viewer } :
|
|
3392
|
+
...viewer ? { viewer } : void 0
|
|
3390
3393
|
});
|
|
3391
3394
|
if (!report) throwApiError(404, "Conversation not found.");
|
|
3392
3395
|
return jsonResponse(conversationEventPageSchema, report);
|
|
@@ -3451,7 +3454,7 @@ function createConversationRoutes(options) {
|
|
|
3451
3454
|
attachmentId,
|
|
3452
3455
|
conversationId,
|
|
3453
3456
|
storage: options.attachmentStorage,
|
|
3454
|
-
...viewer ? { viewer } :
|
|
3457
|
+
...viewer ? { viewer } : void 0
|
|
3455
3458
|
});
|
|
3456
3459
|
return new Response(opened.body, {
|
|
3457
3460
|
headers: conversationAttachmentHeaders({
|
|
@@ -3480,7 +3483,7 @@ function createConversationRoutes(options) {
|
|
|
3480
3483
|
const viewer = context.get("viewer");
|
|
3481
3484
|
const report = await readConversationDetail(conversationId, {
|
|
3482
3485
|
...query,
|
|
3483
|
-
...viewer ? { viewer } :
|
|
3486
|
+
...viewer ? { viewer } : void 0
|
|
3484
3487
|
});
|
|
3485
3488
|
if (!report) throwApiError(404, "Conversation not found.");
|
|
3486
3489
|
return jsonResponse(conversationDetailReportSchema, report);
|
|
@@ -3520,10 +3523,10 @@ function slackLocationLabel(args) {
|
|
|
3520
3523
|
}
|
|
3521
3524
|
function actorFromRow(row) {
|
|
3522
3525
|
const actor = {
|
|
3523
|
-
...row.email ? { email: row.email } :
|
|
3524
|
-
...row.fullName ? { fullName: row.fullName } :
|
|
3525
|
-
...row.providerSubjectId ? { slackUserId: row.providerSubjectId } :
|
|
3526
|
-
...row.handle ? { slackUserName: row.handle } :
|
|
3526
|
+
...row.email ? { email: row.email } : void 0,
|
|
3527
|
+
...row.fullName ? { fullName: row.fullName } : void 0,
|
|
3528
|
+
...row.providerSubjectId ? { slackUserId: row.providerSubjectId } : void 0,
|
|
3529
|
+
...row.handle ? { slackUserName: row.handle } : void 0
|
|
3527
3530
|
};
|
|
3528
3531
|
return Object.keys(actor).length ? actor : void 0;
|
|
3529
3532
|
}
|
|
@@ -3536,18 +3539,18 @@ function summaryFromRow(row, options = {}) {
|
|
|
3536
3539
|
updatedAtMs: row.updatedAt.getTime(),
|
|
3537
3540
|
execution: {
|
|
3538
3541
|
status: row.executionStatus,
|
|
3539
|
-
...row.executionUpdatedAt ? { updatedAtMs: row.executionUpdatedAt.getTime() } :
|
|
3542
|
+
...row.executionUpdatedAt ? { updatedAtMs: row.executionUpdatedAt.getTime() } : void 0
|
|
3540
3543
|
},
|
|
3541
|
-
...actor ? { actor } :
|
|
3542
|
-
...row.channelName ? { channelName: row.channelName } :
|
|
3543
|
-
...row.source ? { source: row.source } :
|
|
3544
|
-
...row.title ? { title: row.title } :
|
|
3544
|
+
...actor ? { actor } : void 0,
|
|
3545
|
+
...row.channelName ? { channelName: row.channelName } : void 0,
|
|
3546
|
+
...row.source ? { source: row.source } : void 0,
|
|
3547
|
+
...row.title ? { title: row.title } : void 0
|
|
3545
3548
|
};
|
|
3546
3549
|
return conversationSummaryFromStoredConversation({
|
|
3547
3550
|
access: options.access,
|
|
3548
3551
|
conversation,
|
|
3549
3552
|
durationMs: options.metrics?.durationMs ?? row.durationMs,
|
|
3550
|
-
...options.access?.visibility === "public" && row.destinationId ? { locationId: row.destinationId } :
|
|
3553
|
+
...options.access?.visibility === "public" && row.destinationId ? { locationId: row.destinationId } : void 0,
|
|
3551
3554
|
usage: options.metrics?.usage ?? row.usage ?? void 0
|
|
3552
3555
|
});
|
|
3553
3556
|
}
|
|
@@ -3860,17 +3863,17 @@ async function readLocationDetailFromSql(locationId, options = {}) {
|
|
|
3860
3863
|
date: row.date,
|
|
3861
3864
|
durationMs: row.durationMs,
|
|
3862
3865
|
failed: row.failed,
|
|
3863
|
-
...row.tokens !== null ? { tokens: row.tokens } :
|
|
3866
|
+
...row.tokens !== null ? { tokens: row.tokens } : void 0
|
|
3864
3867
|
});
|
|
3865
3868
|
}
|
|
3866
3869
|
const actors = [];
|
|
3867
3870
|
for (const row of actorRows) {
|
|
3868
3871
|
if (!row.actorIdentityId) continue;
|
|
3869
3872
|
const actor = {
|
|
3870
|
-
...row.email ?? row.identityEmail ? { email: row.email ?? row.identityEmail ?? void 0 } :
|
|
3871
|
-
...row.fullName ? { fullName: row.fullName } :
|
|
3872
|
-
...row.identityProvider === "slack" && row.providerSubjectId ? { slackUserId: row.providerSubjectId } :
|
|
3873
|
-
...row.handle ? { slackUserName: row.handle } :
|
|
3873
|
+
...row.email ?? row.identityEmail ? { email: row.email ?? row.identityEmail ?? void 0 } : void 0,
|
|
3874
|
+
...row.fullName ? { fullName: row.fullName } : void 0,
|
|
3875
|
+
...row.identityProvider === "slack" && row.providerSubjectId ? { slackUserId: row.providerSubjectId } : void 0,
|
|
3876
|
+
...row.handle ? { slackUserName: row.handle } : void 0
|
|
3874
3877
|
};
|
|
3875
3878
|
if (!actor.email && !actor.slackUserId) continue;
|
|
3876
3879
|
const item = emptyActor(actor);
|
|
@@ -4147,9 +4150,9 @@ async function readPeopleListFromSql() {
|
|
|
4147
4150
|
const people = rows.map((row) => {
|
|
4148
4151
|
const actor = {
|
|
4149
4152
|
email: row.email,
|
|
4150
|
-
...row.fullName ? { fullName: row.fullName } :
|
|
4151
|
-
...row.slackUserId ? { slackUserId: row.slackUserId } :
|
|
4152
|
-
...row.slackUserName ? { slackUserName: row.slackUserName } :
|
|
4153
|
+
...row.fullName ? { fullName: row.fullName } : void 0,
|
|
4154
|
+
...row.slackUserId ? { slackUserId: row.slackUserId } : void 0,
|
|
4155
|
+
...row.slackUserName ? { slackUserName: row.slackUserName } : void 0
|
|
4153
4156
|
};
|
|
4154
4157
|
return {
|
|
4155
4158
|
active: row.active,
|
|
@@ -4160,7 +4163,7 @@ async function readPeopleListFromSql() {
|
|
|
4160
4163
|
firstSeenAt: row.firstSeenAt.toISOString(),
|
|
4161
4164
|
lastSeenAt: row.lastSeenAt.toISOString(),
|
|
4162
4165
|
actor,
|
|
4163
|
-
...row.tokens !== null ? { tokens: row.tokens } :
|
|
4166
|
+
...row.tokens !== null ? { tokens: row.tokens } : void 0
|
|
4164
4167
|
};
|
|
4165
4168
|
});
|
|
4166
4169
|
return {
|
|
@@ -4191,7 +4194,7 @@ async function readPeoplePluginReports(args) {
|
|
|
4191
4194
|
source: "plugins"
|
|
4192
4195
|
});
|
|
4193
4196
|
}
|
|
4194
|
-
const { getPluginProfileReports } = await import("./agent-hooks-
|
|
4197
|
+
const { getPluginProfileReports } = await import("./agent-hooks-IQUW6ERD.js");
|
|
4195
4198
|
return pluginOperationalReportFeedSchema.parse({
|
|
4196
4199
|
generatedAt: new Date(nowMs).toISOString(),
|
|
4197
4200
|
reports: await getPluginProfileReports({
|
|
@@ -4320,20 +4323,20 @@ async function readPeopleProfileFromSql(email, options = {}) {
|
|
|
4320
4323
|
if (!totalsRow) return emptyProfile(normalizedEmail, nowMs);
|
|
4321
4324
|
const actor = {
|
|
4322
4325
|
email: totalsRow.email,
|
|
4323
|
-
...totalsRow.fullName ? { fullName: totalsRow.fullName } :
|
|
4324
|
-
...totalsRow.slackUserId ? { slackUserId: totalsRow.slackUserId } :
|
|
4325
|
-
...totalsRow.slackUserName ? { slackUserName: totalsRow.slackUserName } :
|
|
4326
|
+
...totalsRow.fullName ? { fullName: totalsRow.fullName } : void 0,
|
|
4327
|
+
...totalsRow.slackUserId ? { slackUserId: totalsRow.slackUserId } : void 0,
|
|
4328
|
+
...totalsRow.slackUserName ? { slackUserName: totalsRow.slackUserName } : void 0
|
|
4326
4329
|
};
|
|
4327
4330
|
const days = /* @__PURE__ */ new Map();
|
|
4328
4331
|
for (const row of dayRows) {
|
|
4329
4332
|
days.set(row.date, {
|
|
4330
4333
|
active: row.active,
|
|
4331
4334
|
conversations: row.conversations,
|
|
4332
|
-
...row.costUsd !== null ? { costUsd: row.costUsd } :
|
|
4335
|
+
...row.costUsd !== null ? { costUsd: row.costUsd } : void 0,
|
|
4333
4336
|
date: row.date,
|
|
4334
4337
|
durationMs: row.durationMs,
|
|
4335
4338
|
failed: row.failed,
|
|
4336
|
-
...row.tokens !== null ? { tokens: row.tokens } :
|
|
4339
|
+
...row.tokens !== null ? { tokens: row.tokens } : void 0
|
|
4337
4340
|
});
|
|
4338
4341
|
}
|
|
4339
4342
|
const locations = /* @__PURE__ */ new Map();
|
|
@@ -4376,7 +4379,7 @@ async function readPeopleProfileFromSql(email, options = {}) {
|
|
|
4376
4379
|
conversations: totalsRow.conversations,
|
|
4377
4380
|
durationMs: totalsRow.durationMs,
|
|
4378
4381
|
failed: totalsRow.failed,
|
|
4379
|
-
...totalsRow.tokens !== null ? { tokens: totalsRow.tokens } :
|
|
4382
|
+
...totalsRow.tokens !== null ? { tokens: totalsRow.tokens } : void 0
|
|
4380
4383
|
},
|
|
4381
4384
|
windowEnd: end.toISOString(),
|
|
4382
4385
|
windowStart: start.toISOString()
|
|
@@ -4572,8 +4575,10 @@ import { Hono as Hono5 } from "hono";
|
|
|
4572
4575
|
import { z as z5 } from "zod";
|
|
4573
4576
|
import {
|
|
4574
4577
|
pluginUserPageContentSchema as pluginUserPageContentSchema2,
|
|
4575
|
-
|
|
4576
|
-
|
|
4578
|
+
pluginUserPageCursorSchema,
|
|
4579
|
+
pluginUserPageFilterSchema,
|
|
4580
|
+
pluginUserPageLinksSchema as pluginUserPageLinksSchema2,
|
|
4581
|
+
pluginUserPageQuerySchema
|
|
4577
4582
|
} from "@sentry/junior-plugin-api";
|
|
4578
4583
|
|
|
4579
4584
|
// src/chat/plugins/user-pages.ts
|
|
@@ -4638,20 +4643,17 @@ async function readPluginUserPage(input) {
|
|
|
4638
4643
|
var userPageQuerySchema = z5.object({
|
|
4639
4644
|
cursor: z5.preprocess(
|
|
4640
4645
|
(value) => value || void 0,
|
|
4641
|
-
|
|
4646
|
+
pluginUserPageCursorSchema
|
|
4642
4647
|
),
|
|
4643
4648
|
filter: z5.preprocess(
|
|
4644
4649
|
(value) => value || void 0,
|
|
4645
|
-
|
|
4650
|
+
pluginUserPageFilterSchema
|
|
4646
4651
|
),
|
|
4647
4652
|
limit: z5.preprocess(
|
|
4648
4653
|
(value) => value === "" ? void 0 : value,
|
|
4649
4654
|
z5.coerce.number().int().min(1).max(50).default(20)
|
|
4650
4655
|
),
|
|
4651
|
-
q: z5.preprocess(
|
|
4652
|
-
(value) => value || void 0,
|
|
4653
|
-
pluginUserPageInputSchema.shape.query
|
|
4654
|
-
)
|
|
4656
|
+
q: z5.preprocess((value) => value || void 0, pluginUserPageQuerySchema)
|
|
4655
4657
|
});
|
|
4656
4658
|
function createUserPageRoutes() {
|
|
4657
4659
|
const app = new Hono5();
|
|
@@ -4670,7 +4672,7 @@ function createUserPageRoutes() {
|
|
|
4670
4672
|
email: viewer.email,
|
|
4671
4673
|
pageId: context.req.param("pageId"),
|
|
4672
4674
|
pluginName: context.req.param("pluginName"),
|
|
4673
|
-
query: { ...query, ...q === void 0 ?
|
|
4675
|
+
query: { ...query, ...q === void 0 ? void 0 : { query: q } }
|
|
4674
4676
|
});
|
|
4675
4677
|
return page ? jsonResponse(pluginUserPageContentSchema2, page) : jsonResponse(
|
|
4676
4678
|
apiErrorSchema,
|
|
@@ -4753,7 +4755,8 @@ function snapshotView(workspace) {
|
|
|
4753
4755
|
return {
|
|
4754
4756
|
id: recorded.id,
|
|
4755
4757
|
generatedAt: recorded.generatedAt.toISOString(),
|
|
4756
|
-
buildDurationMs: recorded.buildDurationMs
|
|
4758
|
+
buildDurationMs: recorded.buildDurationMs,
|
|
4759
|
+
sizeBytes: recorded.sizeBytes
|
|
4757
4760
|
};
|
|
4758
4761
|
}
|
|
4759
4762
|
async function baselineSnapshotView() {
|
|
@@ -4910,7 +4913,7 @@ function readDescriptionText(home) {
|
|
|
4910
4913
|
}
|
|
4911
4914
|
}
|
|
4912
4915
|
async function readSkillReports() {
|
|
4913
|
-
const { discoverSkills } = await import("./skills-
|
|
4916
|
+
const { discoverSkills } = await import("./skills-5B3Y6XX6.js");
|
|
4914
4917
|
const skills = await discoverSkills();
|
|
4915
4918
|
return skillReportsSchema.parse(
|
|
4916
4919
|
skills.map((skill) => ({
|
|
@@ -4920,7 +4923,7 @@ async function readSkillReports() {
|
|
|
4920
4923
|
);
|
|
4921
4924
|
}
|
|
4922
4925
|
async function readPlugins() {
|
|
4923
|
-
const { pluginCatalogRuntime } = await import("./catalog-runtime-
|
|
4926
|
+
const { pluginCatalogRuntime } = await import("./catalog-runtime-PMQWNIXA.js");
|
|
4924
4927
|
return pluginsSchema.parse(
|
|
4925
4928
|
pluginCatalogRuntime.getProviders().map((plugin) => ({
|
|
4926
4929
|
configKeys: plugin.manifest.configKeys ?? [],
|
|
@@ -4932,8 +4935,8 @@ async function readPlugins() {
|
|
|
4932
4935
|
}
|
|
4933
4936
|
async function readRuntimeInfoReport() {
|
|
4934
4937
|
const [{ homeDir }, { pluginCatalogRuntime }, plugins, skills] = await Promise.all([
|
|
4935
|
-
import("./discovery-
|
|
4936
|
-
import("./catalog-runtime-
|
|
4938
|
+
import("./discovery-DWVDM7UK.js"),
|
|
4939
|
+
import("./catalog-runtime-PMQWNIXA.js"),
|
|
4937
4940
|
readPlugins(),
|
|
4938
4941
|
readSkillReports()
|
|
4939
4942
|
]);
|
|
@@ -4949,7 +4952,7 @@ async function readRuntimeInfoReport() {
|
|
|
4949
4952
|
}
|
|
4950
4953
|
async function readPluginOperationalReportFeed() {
|
|
4951
4954
|
const nowMs = Date.now();
|
|
4952
|
-
const { getPluginOperationalReports } = await import("./agent-hooks-
|
|
4955
|
+
const { getPluginOperationalReports } = await import("./agent-hooks-IQUW6ERD.js");
|
|
4953
4956
|
return pluginOperationalReportFeedSchema.parse({
|
|
4954
4957
|
source: "plugins",
|
|
4955
4958
|
generatedAt: new Date(nowMs).toISOString(),
|