@sentry/junior 0.190.0 → 0.192.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-3IG2FQW2.js → agent-hooks-3JY76L5X.js} +11 -11
- package/dist/api/activity.d.ts +3 -1
- package/dist/api/code/overview.d.ts +12 -0
- package/dist/api/locations/detail.d.ts +8 -0
- package/dist/api/locations/list.d.ts +5 -0
- package/dist/api/people/code.d.ts +6 -0
- package/dist/api/people/shared.d.ts +2 -0
- package/dist/api/reporting-window.d.ts +40 -0
- package/dist/api/schema/code.d.ts +14 -0
- package/dist/api/schema/conversation.d.ts +27 -0
- package/dist/api/schema/location.d.ts +15 -0
- package/dist/api/schema/person.d.ts +104 -0
- package/dist/api/schema/task.d.ts +15 -2
- package/dist/api/schema.d.ts +1 -1
- package/dist/api/schema.js +2 -2
- package/dist/api.js +536 -141
- package/dist/app.js +93 -130
- package/dist/{catalog-runtime-2OT7S3ZC.js → catalog-runtime-5JVLWXRY.js} +4 -4
- package/dist/chat/agent/resume.d.ts +0 -1
- package/dist/chat/agent/types.d.ts +0 -1
- package/dist/chat/agent-invocations/types.d.ts +4 -4
- package/dist/chat/providers/slack/runtime.d.ts +1 -2
- package/dist/chat/providers/slack/system-turn.d.ts +9 -4
- package/dist/chat/providers/slack/turn.d.ts +0 -1
- package/dist/chat/services/turn-router.d.ts +1 -1
- package/dist/chat/slack/dispatch-turn.d.ts +0 -1
- package/dist/chat/slack/timestamp-param.d.ts +1 -1
- package/dist/chat/task-execution/assistant-message.d.ts +7 -7
- package/dist/chat/task-execution/checkpoint.d.ts +0 -1
- package/dist/chat/task-execution/conversation-turn.d.ts +2 -2
- package/dist/chat/task-execution/state.d.ts +0 -3
- package/dist/chat/task-execution/store.d.ts +0 -1
- package/dist/chat/task-execution/turn-cursor.d.ts +0 -2
- package/dist/chat/task-execution/worker.d.ts +0 -1
- package/dist/chat/tasks/execution-stats.d.ts +12 -0
- package/dist/{chunk-Y4WL4OYD.js → chunk-3ADPXQBL.js} +1 -1
- package/dist/{chunk-F3K2267N.js → chunk-3O2NXVGB.js} +77 -35
- package/dist/{chunk-2MKHYSYL.js → chunk-3UJSII43.js} +3 -3
- package/dist/{chunk-RLYJYEIY.js → chunk-47JFLZSF.js} +5 -7
- package/dist/{chunk-T66GV7A3.js → chunk-4AFSQJD6.js} +2 -2
- package/dist/{chunk-DJZGQ7OL.js → chunk-4B4DQGOM.js} +22 -29
- package/dist/{chunk-OJFX2FP7.js → chunk-4CCQZHD3.js} +9 -11
- package/dist/{chunk-BUJU6C2J.js → chunk-4WIA45WD.js} +1 -1
- package/dist/{chunk-VWNIDTFR.js → chunk-4Z7B5WVV.js} +2 -2
- package/dist/{chunk-3J3BCB4J.js → chunk-5V4BAUCH.js} +1 -1
- package/dist/{chunk-663DQH5W.js → chunk-6FCKJDKS.js} +1 -1
- package/dist/{chunk-HI5KXE3C.js → chunk-6LX6KV5C.js} +3 -3
- package/dist/{chunk-67MMSYSE.js → chunk-7XO7PTZE.js} +1 -1
- package/dist/{chunk-OKAHLUSU.js → chunk-AKR6W7VV.js} +3 -3
- package/dist/{chunk-JV7U4665.js → chunk-ARSUYYQG.js} +1 -1
- package/dist/{chunk-IRQ3RSX3.js → chunk-BGLMT6KP.js} +3 -3
- package/dist/{chunk-2MRF22J4.js → chunk-BUTAWPUV.js} +50 -8
- package/dist/{chunk-62DRKZQU.js → chunk-EIYOABL4.js} +4 -4
- package/dist/{chunk-PFAZSRGR.js → chunk-EYIMZY5O.js} +114 -19
- package/dist/{chunk-DVX6U6GI.js → chunk-EYNUOZCN.js} +1 -1
- package/dist/{chunk-4PKEJK5B.js → chunk-FGYWKKTJ.js} +1 -1
- package/dist/{chunk-YFU4DGZY.js → chunk-G4E5WIRL.js} +30 -9
- package/dist/{chunk-OON4IQHH.js → chunk-H5Q2T5VC.js} +1 -1
- package/dist/{chunk-ZFCO2TMB.js → chunk-IBO4YFFZ.js} +1 -1
- package/dist/{chunk-ECOR3OXY.js → chunk-ITTEDZGY.js} +8 -8
- package/dist/{chunk-4BLFIYVK.js → chunk-KR5F3QSP.js} +9 -12
- package/dist/{chunk-6BXUSF7J.js → chunk-LRTEMMCZ.js} +1 -1
- package/dist/{chunk-MNHJ4WLE.js → chunk-MB2CTEPD.js} +74 -4
- package/dist/{chunk-YKIAUKYH.js → chunk-OBN7UEQJ.js} +2 -2
- package/dist/{chunk-OYCOLHCR.js → chunk-PXP2M32M.js} +5 -5
- package/dist/{chunk-6H7YU6XH.js → chunk-PXUBRZBU.js} +1 -1
- package/dist/{chunk-REVH4BZU.js → chunk-PYVGXGKC.js} +2 -2
- package/dist/{chunk-UTL3MHPC.js → chunk-RC745GGZ.js} +8 -1
- package/dist/{chunk-CZXZKTAI.js → chunk-RWBZZMW6.js} +3 -3
- package/dist/{chunk-GWCFXTB6.js → chunk-SSR6YBWW.js} +6 -6
- package/dist/{chunk-7UJ6IJCK.js → chunk-SZ2O3CGS.js} +1 -1
- package/dist/{chunk-BGOLRC36.js → chunk-VF3EDS7P.js} +13 -11
- package/dist/{chunk-FVFJ57RK.js → chunk-YE6DVM43.js} +9 -8
- package/dist/{chunk-7Y7XMI6P.js → chunk-YRWGJ5OO.js} +5 -5
- package/dist/{chunk-W2C4TPLB.js → chunk-Z4DNJI5F.js} +5 -5
- package/dist/cli/chat.js +33 -33
- package/dist/cli/check.js +5 -5
- package/dist/cli/plugins.js +12 -12
- package/dist/cli/snapshot-create.js +9 -9
- package/dist/cli/upgrade.js +6 -6
- package/dist/db/schema/stats.d.ts +5 -1
- package/dist/{db-2IFDMDDY.js → db-LRM6AP66.js} +6 -6
- package/dist/instrumentation.js +3 -3
- package/dist/nitro.js +6 -6
- package/dist/{oauth-callback-server-SZSS2KH6.js → oauth-callback-server-BKCDVYVH.js} +29 -29
- package/dist/reporting-schema.d.ts +2 -2
- package/dist/{runner-2N4QU77X.js → runner-RUXGS3E6.js} +21 -21
- package/dist/{skills-VU2LZAKX.js → skills-DXP2RCJF.js} +5 -5
- package/dist/spawn-HH7GH7XT.js +42 -0
- package/dist/task-runner-H5I7R3LJ.js +36 -0
- package/dist/{validation-IJGHK7NI.js → validation-F4KYLIF2.js} +5 -5
- package/dist/version.js +1 -1
- package/dist/{work-DI45MLRL.js → work-UUNMNSML.js} +21 -21
- package/dist/{worker-FY7KWG2M.js → worker-PMIJ5NLD.js} +10 -10
- package/package.json +6 -6
- package/dist/spawn-3K7RV4T5.js +0 -42
- package/dist/task-runner-52DYFHW3.js +0 -36
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
PluginCredentialFailureError,
|
|
8
8
|
agentNameSchema,
|
|
9
9
|
createPluginAuthOrchestration
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-PXP2M32M.js";
|
|
11
11
|
import {
|
|
12
12
|
parseSandboxEgressAuthRequiredSignal,
|
|
13
13
|
parseSandboxEgressPermissionDeniedSignal,
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
searchSlackUsers,
|
|
39
39
|
selectPluginGrant,
|
|
40
40
|
toMcpProviderError
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-YE6DVM43.js";
|
|
42
42
|
import {
|
|
43
43
|
RetryableDeliveryError,
|
|
44
44
|
actorFromRun,
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
surfaceFromRun,
|
|
53
53
|
toolInvocationDestination,
|
|
54
54
|
uploadFilesToConversation
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-SSR6YBWW.js";
|
|
56
56
|
import {
|
|
57
57
|
CooperativeTurnYieldError,
|
|
58
58
|
NO_REPLY_MARKER,
|
|
@@ -65,7 +65,7 @@ import {
|
|
|
65
65
|
isNoReplyMarker,
|
|
66
66
|
isTurnInputCommitLostError,
|
|
67
67
|
sanitizeAssistantText
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-7XO7PTZE.js";
|
|
69
69
|
import {
|
|
70
70
|
AGENTS_REMOVAL_NOTICE,
|
|
71
71
|
AGENTS_REPLACEMENT_NOTICE,
|
|
@@ -119,7 +119,7 @@ import {
|
|
|
119
119
|
stripRuntimeTurnContext,
|
|
120
120
|
trimTrailingAssistantMessages,
|
|
121
121
|
truncateText
|
|
122
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-VF3EDS7P.js";
|
|
123
123
|
import {
|
|
124
124
|
SCHEDULED_TASK_SYSTEM_ACTOR,
|
|
125
125
|
WORKSPACE_SNAPSHOT_FAILED_EVENT,
|
|
@@ -160,13 +160,13 @@ import {
|
|
|
160
160
|
workspaceSnapshotFinishedEvent,
|
|
161
161
|
workspaceSnapshotWatch,
|
|
162
162
|
writableEventTask
|
|
163
|
-
} from "./chunk-
|
|
163
|
+
} from "./chunk-EIYOABL4.js";
|
|
164
164
|
import {
|
|
165
165
|
parseSlackThreadId
|
|
166
|
-
} from "./chunk-
|
|
166
|
+
} from "./chunk-4WIA45WD.js";
|
|
167
167
|
import {
|
|
168
168
|
appendAndEnqueueInboundMessage
|
|
169
|
-
} from "./chunk-
|
|
169
|
+
} from "./chunk-G4E5WIRL.js";
|
|
170
170
|
import {
|
|
171
171
|
SHORT_TITLE_MAX_LENGTH,
|
|
172
172
|
ToolInputError,
|
|
@@ -174,7 +174,7 @@ import {
|
|
|
174
174
|
generateShortTitle,
|
|
175
175
|
hasAgentTurnUsage,
|
|
176
176
|
resolveTaskTitle
|
|
177
|
-
} from "./chunk-
|
|
177
|
+
} from "./chunk-OBN7UEQJ.js";
|
|
178
178
|
import {
|
|
179
179
|
bindSandboxFileSystem,
|
|
180
180
|
createSandboxSession,
|
|
@@ -185,7 +185,7 @@ import {
|
|
|
185
185
|
resolve,
|
|
186
186
|
setSnapshotSpanAttributes,
|
|
187
187
|
stopSession
|
|
188
|
-
} from "./chunk-
|
|
188
|
+
} from "./chunk-3UJSII43.js";
|
|
189
189
|
import {
|
|
190
190
|
privateTraceResultAttributes
|
|
191
191
|
} from "./chunk-UIE3R5XU.js";
|
|
@@ -195,7 +195,7 @@ import {
|
|
|
195
195
|
} from "./chunk-X6GDDWQH.js";
|
|
196
196
|
import {
|
|
197
197
|
getTurnRequestDeadline
|
|
198
|
-
} from "./chunk-
|
|
198
|
+
} from "./chunk-SZ2O3CGS.js";
|
|
199
199
|
import {
|
|
200
200
|
getVercelConversationWorkQueue
|
|
201
201
|
} from "./chunk-DKIJ2RP5.js";
|
|
@@ -242,19 +242,19 @@ import {
|
|
|
242
242
|
updateWorkspace,
|
|
243
243
|
withSlackRetries,
|
|
244
244
|
workspaceRepoCheckoutPath
|
|
245
|
-
} from "./chunk-
|
|
245
|
+
} from "./chunk-BUTAWPUV.js";
|
|
246
246
|
import {
|
|
247
247
|
getConversationEventStore,
|
|
248
248
|
getConversationMessageSearchStore,
|
|
249
249
|
getConversationStore,
|
|
250
250
|
getDb,
|
|
251
251
|
getSqlExecutor
|
|
252
|
-
} from "./chunk-
|
|
252
|
+
} from "./chunk-AKR6W7VV.js";
|
|
253
253
|
import {
|
|
254
254
|
juniorArtifacts,
|
|
255
255
|
juniorIdentities,
|
|
256
256
|
juniorSchedulerRuns
|
|
257
|
-
} from "./chunk-
|
|
257
|
+
} from "./chunk-IBO4YFFZ.js";
|
|
258
258
|
import {
|
|
259
259
|
SANDBOX_DATA_ROOT,
|
|
260
260
|
SANDBOX_REPOS_ROOT,
|
|
@@ -285,12 +285,12 @@ import {
|
|
|
285
285
|
throwSandboxOperationError,
|
|
286
286
|
workspaceSnapshotNotReadyUserMessage,
|
|
287
287
|
wrapSandboxSetupError
|
|
288
|
-
} from "./chunk-
|
|
288
|
+
} from "./chunk-6LX6KV5C.js";
|
|
289
289
|
import {
|
|
290
290
|
fenceLock,
|
|
291
291
|
getStateAdapter,
|
|
292
292
|
withLock
|
|
293
|
-
} from "./chunk-
|
|
293
|
+
} from "./chunk-LRTEMMCZ.js";
|
|
294
294
|
import {
|
|
295
295
|
KNOWN_CONVERSATION_EVENT_TYPES,
|
|
296
296
|
contextProvenance,
|
|
@@ -323,7 +323,7 @@ import {
|
|
|
323
323
|
resolveGatewayCredential,
|
|
324
324
|
resolveGatewayModel,
|
|
325
325
|
unwrapCurrentInstruction
|
|
326
|
-
} from "./chunk-
|
|
326
|
+
} from "./chunk-4Z7B5WVV.js";
|
|
327
327
|
import {
|
|
328
328
|
ModelProfileNotConfiguredError,
|
|
329
329
|
TURN_REASONING_LEVELS,
|
|
@@ -340,16 +340,16 @@ import {
|
|
|
340
340
|
toGenAiMessagesTraceAttributes,
|
|
341
341
|
toGenAiPayloadMetadata,
|
|
342
342
|
toGenAiPayloadTraceAttributes
|
|
343
|
-
} from "./chunk-
|
|
343
|
+
} from "./chunk-EYNUOZCN.js";
|
|
344
344
|
import {
|
|
345
345
|
discoverSkills,
|
|
346
346
|
findSkillByName,
|
|
347
347
|
loadSkillsByName,
|
|
348
348
|
parseSkillInvocation
|
|
349
|
-
} from "./chunk-
|
|
349
|
+
} from "./chunk-PYVGXGKC.js";
|
|
350
350
|
import {
|
|
351
351
|
pluginCatalogRuntime
|
|
352
|
-
} from "./chunk-
|
|
352
|
+
} from "./chunk-FGYWKKTJ.js";
|
|
353
353
|
import {
|
|
354
354
|
CredentialUnavailableError,
|
|
355
355
|
OAuthProviderError,
|
|
@@ -357,7 +357,7 @@ import {
|
|
|
357
357
|
getOAuthProviderErrorAttributes,
|
|
358
358
|
resolveAuthTokenPlaceholder,
|
|
359
359
|
resolvePluginCommandEnv
|
|
360
|
-
} from "./chunk-
|
|
360
|
+
} from "./chunk-6FCKJDKS.js";
|
|
361
361
|
import {
|
|
362
362
|
credentialContextForActor,
|
|
363
363
|
credentialUserSubjectId
|
|
@@ -393,7 +393,7 @@ import {
|
|
|
393
393
|
summarizeMessageText,
|
|
394
394
|
withLogContext,
|
|
395
395
|
withSpan
|
|
396
|
-
} from "./chunk-
|
|
396
|
+
} from "./chunk-3ADPXQBL.js";
|
|
397
397
|
import {
|
|
398
398
|
startInactiveSpan,
|
|
399
399
|
withActiveSpan
|
|
@@ -3220,10 +3220,6 @@ function createResourceEventInboundMessage(input) {
|
|
|
3220
3220
|
delivery: "defer",
|
|
3221
3221
|
source: "resource_event",
|
|
3222
3222
|
receivedAtMs: input.receivedAtMs ?? Date.now(),
|
|
3223
|
-
// TODO(dcramer): Store the final publish fact here after resource-event
|
|
3224
|
-
// ingress loads the Conversation. Then remove the worker's Location-based
|
|
3225
|
-
// publish default. Resource events only wake the mailbox until that change.
|
|
3226
|
-
publishExternally: false,
|
|
3227
3223
|
input: {
|
|
3228
3224
|
text: input.text,
|
|
3229
3225
|
authorId: RESOURCE_EVENT_AUTHOR_ID,
|
|
@@ -17881,7 +17877,6 @@ function createResumeState(args) {
|
|
|
17881
17877
|
channelName: args.channelName,
|
|
17882
17878
|
destination: args.destination,
|
|
17883
17879
|
dispatchId: args.dispatchId,
|
|
17884
|
-
publishExternally: args.publishExternally,
|
|
17885
17880
|
source: args.runSource,
|
|
17886
17881
|
actor: args.actor,
|
|
17887
17882
|
surface: args.surface
|
|
@@ -18692,7 +18687,6 @@ async function executeAgentRunInPrivacyContext(run, conversationPrivacy, runLogC
|
|
|
18692
18687
|
slackConversation: run.slackConversation,
|
|
18693
18688
|
slackActionToken: run.slackActionToken,
|
|
18694
18689
|
destination: run.destination,
|
|
18695
|
-
publishExternally: run.publishExternally,
|
|
18696
18690
|
surface: run.surface,
|
|
18697
18691
|
dispatch: run.dispatch,
|
|
18698
18692
|
toolChannelId: run.toolChannelId
|
|
@@ -18847,7 +18841,6 @@ async function executeAgentRunInPrivacyContext(run, conversationPrivacy, runLogC
|
|
|
18847
18841
|
...routing.dispatch?.id ? { dispatchId: routing.dispatch.id } : void 0,
|
|
18848
18842
|
durability,
|
|
18849
18843
|
recordActiveMcpProviders,
|
|
18850
|
-
publishExternally: checkpoint.record?.publishExternally ?? routing.publishExternally ?? false,
|
|
18851
18844
|
actor,
|
|
18852
18845
|
runSource,
|
|
18853
18846
|
conversationId,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AgentRunError,
|
|
3
3
|
executeTurn
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-BGLMT6KP.js";
|
|
5
5
|
import {
|
|
6
6
|
ConversationTurnLifecycleService
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-PXUBRZBU.js";
|
|
8
8
|
import {
|
|
9
9
|
getPersistedSandboxState,
|
|
10
10
|
getPersistedThreadState,
|
|
11
11
|
persistThreadStateById
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-Z4DNJI5F.js";
|
|
13
13
|
import {
|
|
14
14
|
AgentInvocationBusyError,
|
|
15
15
|
AgentInvocationLimitError,
|
|
@@ -18,32 +18,32 @@ import {
|
|
|
18
18
|
agentBindingSchema,
|
|
19
19
|
agentInvocationSchema,
|
|
20
20
|
createAgentInvocationSchema
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-PXP2M32M.js";
|
|
22
22
|
import {
|
|
23
23
|
TurnInputCommitLostError,
|
|
24
24
|
getAssistantReplyText,
|
|
25
25
|
getConversationTurnBoundaryError,
|
|
26
26
|
isTurnInputCommitLostError
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-7XO7PTZE.js";
|
|
28
28
|
import {
|
|
29
29
|
failTurnRecord,
|
|
30
30
|
getTerminalAssistantMessages,
|
|
31
31
|
getTurnRecord,
|
|
32
32
|
openConversationProjection,
|
|
33
33
|
saveTurnCheckpoint
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-VF3EDS7P.js";
|
|
35
35
|
import {
|
|
36
36
|
appendAndEnqueueInboundMessage
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-G4E5WIRL.js";
|
|
38
38
|
import {
|
|
39
39
|
getConversationEventStore,
|
|
40
40
|
getConversationStore,
|
|
41
41
|
getSqlExecutor
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-AKR6W7VV.js";
|
|
43
43
|
import {
|
|
44
44
|
juniorAgentBindings,
|
|
45
45
|
juniorAgentInvocations
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-IBO4YFFZ.js";
|
|
47
47
|
|
|
48
48
|
// src/chat/agent-invocations/work.ts
|
|
49
49
|
import { z } from "zod";
|
|
@@ -314,7 +314,6 @@ function buildAgentInvocationInboundMessage(invocation, nowMs = Date.now()) {
|
|
|
314
314
|
}
|
|
315
315
|
},
|
|
316
316
|
receivedAtMs: nowMs,
|
|
317
|
-
publishExternally: false,
|
|
318
317
|
source: "internal"
|
|
319
318
|
};
|
|
320
319
|
}
|
|
@@ -590,7 +589,6 @@ function createAgentInvocationWorker(agentRunner) {
|
|
|
590
589
|
actor: invocation.actor,
|
|
591
590
|
credentialContext: invocation.credentialContext,
|
|
592
591
|
destination: invocation.destination,
|
|
593
|
-
publishExternally: context.publishExternally,
|
|
594
592
|
source: invocation.source,
|
|
595
593
|
...location ? { location } : void 0,
|
|
596
594
|
surface: "internal",
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
toCanonicalInputMessage,
|
|
8
8
|
toCanonicalOutputMessage,
|
|
9
9
|
toGenAiMessagesTraceAttributes
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-EYNUOZCN.js";
|
|
11
11
|
import {
|
|
12
12
|
extractGenAiUsageAttributes,
|
|
13
13
|
logException,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
normalizeGenAiFinishReason,
|
|
16
16
|
serializeGenAiAttribute,
|
|
17
17
|
withSpan
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-3ADPXQBL.js";
|
|
19
19
|
|
|
20
20
|
// src/chat/services/provider-error.ts
|
|
21
21
|
var ProviderError = class extends Error {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
toOptionalTrimmed
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4Z7B5WVV.js";
|
|
4
4
|
import {
|
|
5
5
|
pluginCatalogRuntime
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-FGYWKKTJ.js";
|
|
7
7
|
import {
|
|
8
8
|
setSpanAttributes,
|
|
9
9
|
setSpanStatus
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-3ADPXQBL.js";
|
|
11
11
|
|
|
12
12
|
// src/chat/sandbox/paths.ts
|
|
13
13
|
function normalizeWorkspaceRoot(input) {
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
juniorConversations,
|
|
9
9
|
juniorIdentities,
|
|
10
10
|
juniorUsers
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-IBO4YFFZ.js";
|
|
12
12
|
import {
|
|
13
13
|
conversationEventDataSchema,
|
|
14
14
|
decodeStoredConversationEvent,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
} from "./chunk-VFUK3X5B.js";
|
|
21
21
|
import {
|
|
22
22
|
getChatConfig
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-4Z7B5WVV.js";
|
|
24
24
|
import {
|
|
25
25
|
parseActorUserId,
|
|
26
26
|
parseSlackChannelReferenceId,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
} from "./chunk-N7TMSOZH.js";
|
|
29
29
|
import {
|
|
30
30
|
normalizeIdentityEmail
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-3ADPXQBL.js";
|
|
32
32
|
|
|
33
33
|
// src/chat/conversations/sql/store.ts
|
|
34
34
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ConversationTurnLifecycleService
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PXUBRZBU.js";
|
|
4
4
|
import {
|
|
5
5
|
runAgentWithTimeout
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-SSR6YBWW.js";
|
|
7
7
|
import {
|
|
8
8
|
getConversationEventStore
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-AKR6W7VV.js";
|
|
10
10
|
|
|
11
11
|
// src/chat/runtime/turn-execution.ts
|
|
12
12
|
var AgentRunError = class extends Error {
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
getConversationEventStore,
|
|
6
6
|
getDb,
|
|
7
7
|
getSqlExecutor
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-AKR6W7VV.js";
|
|
9
9
|
import {
|
|
10
10
|
juniorCodeChanges,
|
|
11
11
|
juniorCodeRepositories,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
juniorUsers,
|
|
17
17
|
juniorWorkspaceRepos,
|
|
18
18
|
juniorWorkspaces
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-IBO4YFFZ.js";
|
|
20
20
|
import {
|
|
21
21
|
SANDBOX_WORKSPACE_ROOT,
|
|
22
22
|
getVercelSandboxCredentials,
|
|
@@ -24,16 +24,16 @@ import {
|
|
|
24
24
|
isSandboxMissingError,
|
|
25
25
|
runNonInteractiveCommand,
|
|
26
26
|
sleep
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-6LX6KV5C.js";
|
|
28
28
|
import {
|
|
29
29
|
getStateAdapter
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-LRTEMMCZ.js";
|
|
31
31
|
import {
|
|
32
32
|
botConfig,
|
|
33
33
|
completeObject,
|
|
34
34
|
embedTexts,
|
|
35
35
|
getSlackBotToken
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-4Z7B5WVV.js";
|
|
37
37
|
import {
|
|
38
38
|
defaultModelId
|
|
39
39
|
} from "./chunk-D4YV5TDV.js";
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
setSpanAttributes,
|
|
53
53
|
setSpanStatus,
|
|
54
54
|
withSpan
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-3ADPXQBL.js";
|
|
56
56
|
|
|
57
57
|
// src/chat/plugins/agent-hooks.ts
|
|
58
58
|
import {
|
|
@@ -211,7 +211,7 @@ import { z } from "zod";
|
|
|
211
211
|
var DAY_MS = 24 * 60 * 60 * 1e3;
|
|
212
212
|
var costRowSchema = z.object({
|
|
213
213
|
costUsd: z.number().finite().nonnegative(),
|
|
214
|
-
date: z.string().
|
|
214
|
+
date: z.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/),
|
|
215
215
|
events: z.number().int().nonnegative()
|
|
216
216
|
}).strict();
|
|
217
217
|
function startOfUtcDay(value) {
|
|
@@ -231,6 +231,48 @@ function registeredEventName(plugin, eventName) {
|
|
|
231
231
|
}
|
|
232
232
|
function createPluginConversationEventStats(plugin, now = Date.now) {
|
|
233
233
|
return {
|
|
234
|
+
async costsByHour(input) {
|
|
235
|
+
const eventName = registeredEventName(plugin, input.eventName);
|
|
236
|
+
const hourCount = input.hours ?? 24;
|
|
237
|
+
const end = new Date(now());
|
|
238
|
+
end.setUTCMinutes(0, 0, 0);
|
|
239
|
+
const start = new Date(end.getTime() - (hourCount - 1) * 60 * 60 * 1e3);
|
|
240
|
+
const endExclusive = new Date(end.getTime() + 60 * 60 * 1e3);
|
|
241
|
+
const date = sql`TO_CHAR(
|
|
242
|
+
${juniorConversationEvents.createdAt} AT TIME ZONE 'UTC',
|
|
243
|
+
'YYYY-MM-DD"T"HH24'
|
|
244
|
+
)`;
|
|
245
|
+
const cost = sql`CASE
|
|
246
|
+
WHEN jsonb_typeof(${juniorConversationEvents.payload}->'content'->'costUsd') = 'number'
|
|
247
|
+
THEN (${juniorConversationEvents.payload}->'content'->>'costUsd')::double precision
|
|
248
|
+
ELSE 0
|
|
249
|
+
END`;
|
|
250
|
+
const rows = await getDb().select({
|
|
251
|
+
costUsd: sql`SUM(${cost})::double precision`.mapWith(Number),
|
|
252
|
+
date,
|
|
253
|
+
events: sql`COUNT(*)::integer`.mapWith(Number)
|
|
254
|
+
}).from(juniorConversationEvents).where(
|
|
255
|
+
and2(
|
|
256
|
+
eq2(juniorConversationEvents.type, "structured_event"),
|
|
257
|
+
sql`${juniorConversationEvents.payload}->>'namespace' = ${plugin.manifest.name}`,
|
|
258
|
+
sql`${juniorConversationEvents.payload}->>'name' = ${eventName}`,
|
|
259
|
+
gte(juniorConversationEvents.createdAt, start),
|
|
260
|
+
lt(juniorConversationEvents.createdAt, endExclusive)
|
|
261
|
+
)
|
|
262
|
+
).groupBy(date);
|
|
263
|
+
const byHour = new Map(
|
|
264
|
+
z.array(costRowSchema).parse(rows).map((row) => [row.date, row])
|
|
265
|
+
);
|
|
266
|
+
return Array.from({ length: hourCount }, (_, index) => {
|
|
267
|
+
const hour = new Date(start.getTime() + index * 60 * 60 * 1e3);
|
|
268
|
+
const key = hour.toISOString().slice(0, 13);
|
|
269
|
+
return byHour.get(key) ?? {
|
|
270
|
+
costUsd: 0,
|
|
271
|
+
date: key,
|
|
272
|
+
events: 0
|
|
273
|
+
};
|
|
274
|
+
});
|
|
275
|
+
},
|
|
234
276
|
async costsByDay(input) {
|
|
235
277
|
const eventName = registeredEventName(plugin, input.eventName);
|
|
236
278
|
const end = startOfUtcDay(now());
|
|
@@ -3191,7 +3233,7 @@ function sanitizeOperationalReport(args) {
|
|
|
3191
3233
|
sanitizedWidget.emptyText = emptyText;
|
|
3192
3234
|
}
|
|
3193
3235
|
const timeRangeDays = widget.timeRangeDays?.filter(
|
|
3194
|
-
(days) => days === 7 || days === 30 || days === 90
|
|
3236
|
+
(days) => days === 1 || days === 7 || days === 30 || days === 90
|
|
3195
3237
|
);
|
|
3196
3238
|
if (timeRangeDays?.length) {
|
|
3197
3239
|
sanitizedWidget.timeRangeDays = [...new Set(timeRangeDays)];
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ToolInputError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OBN7UEQJ.js";
|
|
4
4
|
import {
|
|
5
5
|
getPlugins
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-BUTAWPUV.js";
|
|
7
7
|
import {
|
|
8
8
|
getDb
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-AKR6W7VV.js";
|
|
10
10
|
import {
|
|
11
11
|
juniorAttachments,
|
|
12
12
|
juniorConversations,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
juniorSchedulerRuns,
|
|
15
15
|
juniorSchedulerTasks,
|
|
16
16
|
juniorStats
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-IBO4YFFZ.js";
|
|
18
18
|
import {
|
|
19
19
|
juniorDestinations
|
|
20
20
|
} from "./chunk-VFUK3X5B.js";
|