@sentry/junior 0.160.0 → 0.161.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-U6R3O2V4.js → agent-hooks-O75UJNC6.js} +13 -10
- package/dist/api/locations/detail.d.ts +17 -0
- package/dist/api/people/plugin-reports.d.ts +7 -0
- package/dist/api/schema/conversation.d.ts +77 -8
- package/dist/api/schema/location.d.ts +29 -0
- package/dist/api/schema/person.d.ts +29 -0
- package/dist/api/schema.js +1 -1
- package/dist/api.js +128 -27
- package/dist/app.js +73 -42
- package/dist/{catalog-runtime-HIDNHGOP.js → catalog-runtime-Z3FHU4ZY.js} +5 -5
- package/dist/chat/artifacts/store.d.ts +42 -0
- package/dist/chat/plugins/agent-hooks.d.ts +9 -1
- package/dist/chat/plugins/annotations.d.ts +3 -0
- package/dist/chat/plugins/conversation-sidebar.d.ts +3 -0
- package/dist/chat/plugins/viewer.d.ts +4 -0
- package/dist/chat/slack/mrkdwn.d.ts +3 -4
- package/dist/chat/tools/publish-image.d.ts +44 -0
- package/dist/chat/tools/unpublish-image.d.ts +35 -0
- package/dist/{chunk-MBDWMEO6.js → chunk-4WAZ6DGX.js} +10 -10
- package/dist/{chunk-FJR66CQT.js → chunk-6ILVZOF6.js} +4 -4
- package/dist/{chunk-42E7432W.js → chunk-6WTDZKFR.js} +1 -1
- package/dist/{chunk-2SFMRMDV.js → chunk-CGAIDDLD.js} +1 -1
- package/dist/{chunk-XPX3DYG7.js → chunk-DGKLYDX7.js} +2 -2
- package/dist/{chunk-ZNBGWMVQ.js → chunk-DNSIU27S.js} +1 -1
- package/dist/{chunk-TBRJGMTO.js → chunk-EAIQBR66.js} +1 -1
- package/dist/{chunk-4UO3UAW7.js → chunk-FLMD25Y5.js} +239 -199
- package/dist/{chunk-FKMWPA4A.js → chunk-G35DUPNB.js} +4 -4
- package/dist/{chunk-472VVYYV.js → chunk-HSFYTIS2.js} +1 -1
- package/dist/{chunk-LNUZXEEI.js → chunk-IRHX2S46.js} +1 -1
- package/dist/{chunk-TPFOVXRB.js → chunk-IW7C5C7E.js} +19 -21
- package/dist/{chunk-UNDTW2PY.js → chunk-IYFKONIL.js} +1 -1
- package/dist/{chunk-U26KRMYX.js → chunk-MNY5M7RB.js} +537 -27
- package/dist/{chunk-PZUJPPON.js → chunk-MVG5UPLM.js} +1 -1
- package/dist/{chunk-WACYTIIK.js → chunk-O7JTSJPU.js} +6 -6
- package/dist/{chunk-URPLKXLG.js → chunk-OPIJ6HY3.js} +9 -9
- package/dist/{chunk-756F567I.js → chunk-OY2DBUV4.js} +5 -5
- package/dist/{chunk-M5HCOMDR.js → chunk-OYQEO72I.js} +410 -108
- package/dist/{chunk-2MK6S2UA.js → chunk-QHXT7LLF.js} +1 -1
- package/dist/{chunk-3AHIB66R.js → chunk-QQ7SY5IZ.js} +5 -5
- package/dist/{chunk-BGVQGEKB.js → chunk-RULQD7OX.js} +4 -4
- package/dist/{chunk-J77DLAPE.js → chunk-RVENVPNO.js} +2 -2
- package/dist/{chunk-UYUS4L6F.js → chunk-SA6BEEAB.js} +16 -9
- package/dist/{chunk-RLOXMHLA.js → chunk-STZVUVMS.js} +4 -4
- package/dist/{chunk-JQZIUESN.js → chunk-U2XOBFDK.js} +3 -3
- package/dist/{chunk-PVIM2RWO.js → chunk-V67ORYKQ.js} +8 -10
- package/dist/{chunk-P7W3ZL5J.js → chunk-VXFDVY4C.js} +8 -36
- package/dist/{chunk-YPMDNE7R.js → chunk-WKN4ZQTZ.js} +1 -1
- package/dist/{chunk-HDPH4CHJ.js → chunk-WVSQ2SCS.js} +1 -1
- package/dist/{chunk-56TFPTZU.js → chunk-YSWHAOPQ.js} +1 -1
- package/dist/{chunk-RJGRXDA7.js → chunk-ZBCLWBMV.js} +5 -5
- package/dist/cli/chat.js +29 -30
- package/dist/cli/check.js +6 -6
- package/dist/cli/plugins.js +12 -13
- package/dist/cli/snapshot-create.js +9 -9
- package/dist/cli/upgrade.js +7 -7
- package/dist/db/schema/artifacts.d.ts +178 -0
- package/dist/db/schema.d.ts +179 -1
- package/dist/{db-2JKT3BB5.js → db-KKOZRE62.js} +7 -7
- package/dist/handlers/artifacts.d.ts +8 -0
- package/dist/instrumentation.js +4 -4
- package/dist/nitro.js +2 -2
- package/dist/{oauth-callback-server-7MC2UMQC.js → oauth-callback-server-5AUZDWXA.js} +22 -23
- package/dist/{runner-GUU4G7XO.js → runner-K5H5NDEC.js} +12 -13
- package/dist/{skills-7NW5N3VM.js → skills-OZGPB6G4.js} +6 -6
- package/dist/spawn-RCQSC2L5.js +37 -0
- package/dist/{validation-AQLI6N2C.js → validation-TVHCNCYL.js} +6 -6
- package/dist/version.js +1 -1
- package/dist/{work-FLFK5XNU.js → work-DXCQMJ5U.js} +17 -17
- package/dist/worker-24HZ5HRI.js +24 -0
- package/migrations/0028_artifacts.sql +16 -0
- package/migrations/meta/0028_snapshot.json +2685 -0
- package/migrations/meta/_journal.json +8 -1
- package/package.json +4 -4
- package/dist/chunk-OUAZDZTZ.js +0 -441
- package/dist/spawn-WGK4W3XF.js +0 -37
- package/dist/worker-KSJIRBQJ.js +0 -24
package/dist/app.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
processConversationWork
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-6ILVZOF6.js";
|
|
4
4
|
import {
|
|
5
5
|
bindSpawnAgent
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-QHXT7LLF.js";
|
|
7
7
|
import {
|
|
8
8
|
createAgentInvocationWorker,
|
|
9
9
|
enqueueAgentInvocation,
|
|
10
10
|
listPendingAgentInvocationMailboxAppends,
|
|
11
11
|
routeAgentInvocationWork
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-O7JTSJPU.js";
|
|
13
13
|
import {
|
|
14
14
|
GET as GET2,
|
|
15
15
|
GET2 as GET3,
|
|
@@ -36,12 +36,12 @@ import {
|
|
|
36
36
|
startSlackProcessingReaction,
|
|
37
37
|
stripLeadingBotMention,
|
|
38
38
|
wakePausedTurn
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-IW7C5C7E.js";
|
|
40
40
|
import "./chunk-FA6POGLH.js";
|
|
41
41
|
import {
|
|
42
42
|
getTurnRequestDeadline,
|
|
43
43
|
runWithTurnRequestDeadline
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-IRHX2S46.js";
|
|
45
45
|
import {
|
|
46
46
|
GET,
|
|
47
47
|
conversationVisibilityFromSlackChannelType,
|
|
@@ -51,8 +51,8 @@ import {
|
|
|
51
51
|
resolveSlackChannelTypeFromMessage,
|
|
52
52
|
resolveSlackConversationContext,
|
|
53
53
|
routeApiTurnWork
|
|
54
|
-
} from "./chunk-
|
|
55
|
-
import "./chunk-
|
|
54
|
+
} from "./chunk-4WAZ6DGX.js";
|
|
55
|
+
import "./chunk-HSFYTIS2.js";
|
|
56
56
|
import {
|
|
57
57
|
CONVERSATION_WORK_STALE_ENQUEUE_MS,
|
|
58
58
|
appendAndEnqueueInboundMessage,
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
isInvalidConversationRecordError,
|
|
64
64
|
listActiveConversationIds,
|
|
65
65
|
removeActiveConversation
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-G35DUPNB.js";
|
|
67
67
|
import {
|
|
68
68
|
buildDeliveredTurnStatePatch,
|
|
69
69
|
claimDispatchMailboxAppend,
|
|
@@ -94,7 +94,7 @@ import {
|
|
|
94
94
|
requireTurnFailureEventId,
|
|
95
95
|
resolveTurnSessionRouting,
|
|
96
96
|
scheduleSessionCompletedPluginTasks
|
|
97
|
-
} from "./chunk-
|
|
97
|
+
} from "./chunk-OPIJ6HY3.js";
|
|
98
98
|
import {
|
|
99
99
|
ConversationTurnLifecycleService,
|
|
100
100
|
coerceThreadConversationState,
|
|
@@ -104,7 +104,7 @@ import {
|
|
|
104
104
|
persistThreadRuntimeState,
|
|
105
105
|
persistThreadState,
|
|
106
106
|
persistThreadStateById
|
|
107
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-QQ7SY5IZ.js";
|
|
108
108
|
import "./chunk-UTL3MHPC.js";
|
|
109
109
|
import {
|
|
110
110
|
getVercelConversationWorkQueue,
|
|
@@ -123,7 +123,7 @@ import {
|
|
|
123
123
|
import {
|
|
124
124
|
validatePluginEgressCredentialHooks,
|
|
125
125
|
validatePluginRegistrations
|
|
126
|
-
} from "./chunk-
|
|
126
|
+
} from "./chunk-MVG5UPLM.js";
|
|
127
127
|
import {
|
|
128
128
|
defineJuniorPlugins,
|
|
129
129
|
pluginCatalogConfigFromEnv,
|
|
@@ -147,6 +147,8 @@ import {
|
|
|
147
147
|
listThreadReplies,
|
|
148
148
|
normalizeSandboxEgressTracePropagationDomains,
|
|
149
149
|
parseSandboxEgressCredentialToken,
|
|
150
|
+
publicArtifactHeaders,
|
|
151
|
+
readPublicArtifact,
|
|
150
152
|
renderAttachmentText,
|
|
151
153
|
renderBlockText,
|
|
152
154
|
resolveDestinationVisibility,
|
|
@@ -154,12 +156,13 @@ import {
|
|
|
154
156
|
sanitizeScheduledTaskPrincipal,
|
|
155
157
|
setConfigDefaults,
|
|
156
158
|
shouldEmitDevAgentTrace,
|
|
157
|
-
shouldPropagateSandboxEgressTrace
|
|
158
|
-
|
|
159
|
+
shouldPropagateSandboxEgressTrace,
|
|
160
|
+
unpublishedArtifactHeaders
|
|
161
|
+
} from "./chunk-OYQEO72I.js";
|
|
159
162
|
import {
|
|
160
163
|
AuthorizationFlowDisabledError,
|
|
161
164
|
PluginCredentialFailureError
|
|
162
|
-
} from "./chunk-
|
|
165
|
+
} from "./chunk-OY2DBUV4.js";
|
|
163
166
|
import "./chunk-DIB4GX3G.js";
|
|
164
167
|
import {
|
|
165
168
|
createAgentRunner,
|
|
@@ -167,7 +170,7 @@ import {
|
|
|
167
170
|
deleteMcpAuthSessionsForUserProvider,
|
|
168
171
|
deleteMcpServerSessionId,
|
|
169
172
|
deleteMcpStoredOAuthCredentials
|
|
170
|
-
} from "./chunk-
|
|
173
|
+
} from "./chunk-V67ORYKQ.js";
|
|
171
174
|
import {
|
|
172
175
|
RetryableDeliveryError
|
|
173
176
|
} from "./chunk-RF6J3DIO.js";
|
|
@@ -175,7 +178,7 @@ import {
|
|
|
175
178
|
formatProviderLabel,
|
|
176
179
|
postSlackMessage,
|
|
177
180
|
startOAuthFlow
|
|
178
|
-
} from "./chunk-
|
|
181
|
+
} from "./chunk-VXFDVY4C.js";
|
|
179
182
|
import "./chunk-7MA4HV4W.js";
|
|
180
183
|
import {
|
|
181
184
|
getExperimentalFeatures,
|
|
@@ -184,7 +187,7 @@ import {
|
|
|
184
187
|
import {
|
|
185
188
|
getSandboxResourceConfig,
|
|
186
189
|
setSandboxResourceConfig
|
|
187
|
-
} from "./chunk-
|
|
190
|
+
} from "./chunk-RULQD7OX.js";
|
|
188
191
|
import {
|
|
189
192
|
collectAttachmentGarbage,
|
|
190
193
|
createSchedulerSqlStore,
|
|
@@ -192,10 +195,10 @@ import {
|
|
|
192
195
|
logScheduledTaskRunSkipped,
|
|
193
196
|
requestAttachmentDeletion,
|
|
194
197
|
scheduledTaskRunAttributes
|
|
195
|
-
} from "./chunk-
|
|
198
|
+
} from "./chunk-ZBCLWBMV.js";
|
|
196
199
|
import {
|
|
197
200
|
parseSlackThreadId
|
|
198
|
-
} from "./chunk-
|
|
201
|
+
} from "./chunk-YSWHAOPQ.js";
|
|
199
202
|
import {
|
|
200
203
|
ConversationTurnBoundaryError,
|
|
201
204
|
CooperativeTurnYieldError,
|
|
@@ -245,37 +248,35 @@ import {
|
|
|
245
248
|
trimTrailingAssistantMessages,
|
|
246
249
|
turnHasReply,
|
|
247
250
|
upsertConversationMessage
|
|
248
|
-
} from "./chunk-
|
|
251
|
+
} from "./chunk-STZVUVMS.js";
|
|
249
252
|
import "./chunk-3Y47VMHV.js";
|
|
250
253
|
import "./chunk-PDO5BLNM.js";
|
|
251
254
|
import "./chunk-UIE3R5XU.js";
|
|
252
255
|
import {
|
|
256
|
+
SlackActionError,
|
|
253
257
|
bindEventTaskCredentialSubject,
|
|
254
258
|
bindScheduledTaskCredentialSubject,
|
|
255
259
|
bindSlackDirectCredentialSubject,
|
|
256
260
|
createPluginLogger,
|
|
257
261
|
createPluginState,
|
|
258
262
|
createResourceEventTeamIdResolver,
|
|
263
|
+
downloadPrivateSlackFile,
|
|
259
264
|
getPluginApiRoutes,
|
|
260
265
|
getPluginRoutes,
|
|
261
266
|
getPlugins,
|
|
267
|
+
getSlackClient,
|
|
268
|
+
getWorkspaceTeamId,
|
|
269
|
+
isDmChannel,
|
|
270
|
+
normalizeSlackConversationId,
|
|
271
|
+
runWithSlackInstallationToken,
|
|
272
|
+
runWithWorkspaceTeamId,
|
|
262
273
|
setDashboardConversationLinkOptions,
|
|
263
274
|
setPlugins,
|
|
264
275
|
validatePlugins,
|
|
265
276
|
verifyEventTaskCredentialSubject,
|
|
266
277
|
verifyScheduledTaskCredentialSubject,
|
|
267
278
|
verifySlackDirectCredentialSubject
|
|
268
|
-
} from "./chunk-
|
|
269
|
-
import {
|
|
270
|
-
SlackActionError,
|
|
271
|
-
downloadPrivateSlackFile,
|
|
272
|
-
getSlackClient,
|
|
273
|
-
getWorkspaceTeamId,
|
|
274
|
-
isDmChannel,
|
|
275
|
-
normalizeSlackConversationId,
|
|
276
|
-
runWithSlackInstallationToken,
|
|
277
|
-
runWithWorkspaceTeamId
|
|
278
|
-
} from "./chunk-OUAZDZTZ.js";
|
|
279
|
+
} from "./chunk-MNY5M7RB.js";
|
|
279
280
|
import {
|
|
280
281
|
contextProvenance,
|
|
281
282
|
createSlackDestination,
|
|
@@ -288,19 +289,19 @@ import {
|
|
|
288
289
|
requireSlackDestination,
|
|
289
290
|
withConversationEventLock,
|
|
290
291
|
withConversationMutationLock
|
|
291
|
-
} from "./chunk-
|
|
292
|
+
} from "./chunk-U2XOBFDK.js";
|
|
292
293
|
import {
|
|
293
294
|
juniorAgentBindings,
|
|
294
295
|
juniorAgentInvocations,
|
|
295
296
|
juniorConversationEvents,
|
|
296
297
|
juniorConversations
|
|
297
|
-
} from "./chunk-
|
|
298
|
+
} from "./chunk-FLMD25Y5.js";
|
|
298
299
|
import "./chunk-EM225ITJ.js";
|
|
299
300
|
import {
|
|
300
301
|
acquireActiveLock,
|
|
301
302
|
getStateAdapter,
|
|
302
303
|
withActiveLock
|
|
303
|
-
} from "./chunk-
|
|
304
|
+
} from "./chunk-IYFKONIL.js";
|
|
304
305
|
import {
|
|
305
306
|
STANDARD_MODEL_PROFILE,
|
|
306
307
|
botConfig,
|
|
@@ -318,16 +319,16 @@ import {
|
|
|
318
319
|
modelIdForProfile,
|
|
319
320
|
setSlackReactionConfig,
|
|
320
321
|
standardModelId
|
|
321
|
-
} from "./chunk-
|
|
322
|
+
} from "./chunk-RVENVPNO.js";
|
|
322
323
|
import {
|
|
323
324
|
juniorDestinations
|
|
324
325
|
} from "./chunk-VFUK3X5B.js";
|
|
325
|
-
import "./chunk-
|
|
326
|
-
import "./chunk-
|
|
326
|
+
import "./chunk-EAIQBR66.js";
|
|
327
|
+
import "./chunk-DGKLYDX7.js";
|
|
327
328
|
import {
|
|
328
329
|
pluginCatalogRuntime
|
|
329
|
-
} from "./chunk-
|
|
330
|
-
import "./chunk-
|
|
330
|
+
} from "./chunk-CGAIDDLD.js";
|
|
331
|
+
import "./chunk-6WTDZKFR.js";
|
|
331
332
|
import {
|
|
332
333
|
credentialContextForActor
|
|
333
334
|
} from "./chunk-BDUENQD3.js";
|
|
@@ -359,7 +360,7 @@ import {
|
|
|
359
360
|
withContext,
|
|
360
361
|
withLogContext,
|
|
361
362
|
withSpan
|
|
362
|
-
} from "./chunk-
|
|
363
|
+
} from "./chunk-DNSIU27S.js";
|
|
363
364
|
import {
|
|
364
365
|
continueTrace
|
|
365
366
|
} from "./chunk-6GWA276C.js";
|
|
@@ -367,10 +368,10 @@ import "./chunk-OOUNJNMR.js";
|
|
|
367
368
|
import "./chunk-H4HBKISO.js";
|
|
368
369
|
import {
|
|
369
370
|
JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE
|
|
370
|
-
} from "./chunk-
|
|
371
|
+
} from "./chunk-WVSQ2SCS.js";
|
|
371
372
|
import {
|
|
372
373
|
JUNIOR_VERSION
|
|
373
|
-
} from "./chunk-
|
|
374
|
+
} from "./chunk-WKN4ZQTZ.js";
|
|
374
375
|
import "./chunk-MLKGABMK.js";
|
|
375
376
|
|
|
376
377
|
// src/app.ts
|
|
@@ -8524,6 +8525,29 @@ function createProductionConversationWorkOptions(options) {
|
|
|
8524
8525
|
});
|
|
8525
8526
|
}
|
|
8526
8527
|
|
|
8528
|
+
// src/handlers/artifacts.ts
|
|
8529
|
+
async function publicArtifactGET(args) {
|
|
8530
|
+
try {
|
|
8531
|
+
const artifact = await readPublicArtifact({
|
|
8532
|
+
db: args.db ?? getSqlExecutor(),
|
|
8533
|
+
filename: args.filename,
|
|
8534
|
+
storage: args.storage ?? createVercelAttachmentStorage()
|
|
8535
|
+
});
|
|
8536
|
+
if (!artifact) {
|
|
8537
|
+
return new Response("Not Found", {
|
|
8538
|
+
headers: unpublishedArtifactHeaders(),
|
|
8539
|
+
status: 404
|
|
8540
|
+
});
|
|
8541
|
+
}
|
|
8542
|
+
return new Response(artifact.body, {
|
|
8543
|
+
headers: publicArtifactHeaders(artifact.contentType)
|
|
8544
|
+
});
|
|
8545
|
+
} catch (error) {
|
|
8546
|
+
logException(error, "public_artifact.get.failed");
|
|
8547
|
+
return new Response("Internal Server Error", { status: 500 });
|
|
8548
|
+
}
|
|
8549
|
+
}
|
|
8550
|
+
|
|
8527
8551
|
// src/chat/resource-events/ingest.ts
|
|
8528
8552
|
import { resourceEventSchema } from "@sentry/junior-plugin-api";
|
|
8529
8553
|
|
|
@@ -9178,6 +9202,13 @@ async function createApp(options) {
|
|
|
9178
9202
|
);
|
|
9179
9203
|
app.get("/", () => GET());
|
|
9180
9204
|
app.get("/health", () => GET());
|
|
9205
|
+
app.get(
|
|
9206
|
+
"/public/artifacts/:filename",
|
|
9207
|
+
(c) => publicArtifactGET({
|
|
9208
|
+
filename: c.req.param("filename"),
|
|
9209
|
+
storage: attachmentStorage
|
|
9210
|
+
})
|
|
9211
|
+
);
|
|
9181
9212
|
app.get("/api/oauth/callback/mcp/:provider", (c) => {
|
|
9182
9213
|
return GET2(c.req.raw, c.req.param("provider"), waitUntil, {
|
|
9183
9214
|
agentRunner,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pluginCatalogRuntime
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-CGAIDDLD.js";
|
|
4
|
+
import "./chunk-6WTDZKFR.js";
|
|
5
5
|
import "./chunk-BDUENQD3.js";
|
|
6
6
|
import "./chunk-V7YE4WCP.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-DNSIU27S.js";
|
|
8
8
|
import "./chunk-6GWA276C.js";
|
|
9
9
|
import "./chunk-OOUNJNMR.js";
|
|
10
10
|
import "./chunk-H4HBKISO.js";
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-WVSQ2SCS.js";
|
|
12
|
+
import "./chunk-WKN4ZQTZ.js";
|
|
13
13
|
import "./chunk-MLKGABMK.js";
|
|
14
14
|
export {
|
|
15
15
|
pluginCatalogRuntime
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { AttachmentStorage } from "@/chat/attachments/storage";
|
|
2
|
+
import type { JuniorSqlDatabase } from "@/db/db";
|
|
3
|
+
/** Parse a public artifact URL or filename into a content-addressed filename. */
|
|
4
|
+
export declare function artifactFilenameFromRef(ref: string): string | null;
|
|
5
|
+
/** Publish validated image bytes as a conversation-owned public artifact. */
|
|
6
|
+
export declare function publishImage(args: {
|
|
7
|
+
body: Buffer;
|
|
8
|
+
conversationId: string;
|
|
9
|
+
db: JuniorSqlDatabase;
|
|
10
|
+
now?: Date;
|
|
11
|
+
publicBaseUrl: string;
|
|
12
|
+
storage: Pick<AttachmentStorage, "put">;
|
|
13
|
+
}): Promise<{
|
|
14
|
+
bytes: number;
|
|
15
|
+
contentType: string;
|
|
16
|
+
url: string;
|
|
17
|
+
}>;
|
|
18
|
+
/**
|
|
19
|
+
* Mark one public artifact unavailable for unauthenticated reads.
|
|
20
|
+
* Only the owning conversation may unpublish it.
|
|
21
|
+
*/
|
|
22
|
+
export declare function unpublishArtifact(args: {
|
|
23
|
+
conversationId: string;
|
|
24
|
+
db: JuniorSqlDatabase;
|
|
25
|
+
now?: Date;
|
|
26
|
+
ref: string;
|
|
27
|
+
}): Promise<{
|
|
28
|
+
filename: string;
|
|
29
|
+
}>;
|
|
30
|
+
/** Open one public artifact by id when the row allows it. */
|
|
31
|
+
export declare function readPublicArtifact(args: {
|
|
32
|
+
db: JuniorSqlDatabase;
|
|
33
|
+
filename: string;
|
|
34
|
+
storage: Pick<AttachmentStorage, "get">;
|
|
35
|
+
}): Promise<{
|
|
36
|
+
body: ReadableStream<Uint8Array>;
|
|
37
|
+
contentType: string;
|
|
38
|
+
} | null>;
|
|
39
|
+
/** Build public response headers for one live public artifact. */
|
|
40
|
+
export declare function publicArtifactHeaders(contentType: string): Headers;
|
|
41
|
+
/** Build short-lived headers for missing or unpublished artifact responses. */
|
|
42
|
+
export declare function unpublishedArtifactHeaders(): Headers;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PluginRoute, PluginSandbox, PluginOperationalReport, PluginRouteApp, ResourceEvent, SlackConversationLink, PluginRegistration } from "@sentry/junior-plugin-api";
|
|
1
|
+
import type { PluginRoute, PluginSandbox, PluginOperationalReport, PluginRouteApp, ResourceEvent, SlackConversationLink, PluginRegistration, User } from "@sentry/junior-plugin-api";
|
|
2
2
|
import type { PluginPromptContributionContext } from "@/chat/plugins/prompt";
|
|
3
3
|
import type { AnyToolDefinition } from "@/chat/tools/definition";
|
|
4
4
|
import type { ToolRuntimeContext } from "@/chat/tools/types";
|
|
@@ -43,6 +43,8 @@ export declare function validatePlugins(plugins: PluginRegistration[]): void;
|
|
|
43
43
|
export declare function setPlugins(nextPlugins: PluginRegistration[]): PluginRegistration[];
|
|
44
44
|
/** Return the current runtime hook plugins without exposing mutable state. */
|
|
45
45
|
export declare function getPlugins(): PluginRegistration[];
|
|
46
|
+
/** Apply plugin Markdown rewrites before destination delivery formatting. */
|
|
47
|
+
export declare function applyPluginFormatMarkdown(text: string): string;
|
|
46
48
|
/** Collect stable plugin prompt contributions for the static system prompt. */
|
|
47
49
|
export declare function getPluginSystemPromptContributions(source: ToolRuntimeContext["source"]): Promise<PluginPromptContributionContext[]>;
|
|
48
50
|
/** Collect request-scoped plugin prompt contributions. */
|
|
@@ -64,6 +66,12 @@ export declare function getPluginApiRoutes(): PluginApiRouteRegistration[];
|
|
|
64
66
|
export declare function getPluginSlackConversationLink(conversationId: string): SlackConversationLink | undefined;
|
|
65
67
|
/** Collect read-only operational summaries exposed by plugins. */
|
|
66
68
|
export declare function getPluginOperationalReports(nowMs: number): Promise<PluginOperationalReport[]>;
|
|
69
|
+
/** Collect person-scoped plugin reports for one profile subject. */
|
|
70
|
+
export declare function getPluginProfileReports(args: {
|
|
71
|
+
nowMs: number;
|
|
72
|
+
subject: User;
|
|
73
|
+
viewer: User;
|
|
74
|
+
}): Promise<PluginOperationalReport[]>;
|
|
67
75
|
/** Create one runner over runtime hook plugins registered by the app. */
|
|
68
76
|
export declare function createPluginHookRunner(input?: {
|
|
69
77
|
actor?: Actor;
|
|
@@ -5,4 +5,7 @@ export declare function createPluginAnnotations(args: {
|
|
|
5
5
|
db: JuniorDatabase;
|
|
6
6
|
plugin: string;
|
|
7
7
|
}): PluginAnnotations;
|
|
8
|
+
/** Load stored annotations for one conversation, newest update first. */
|
|
8
9
|
export declare function listConversationAnnotations(db: JuniorDatabase, conversationId: string): Promise<ConversationAnnotation[]>;
|
|
10
|
+
/** Load stored annotations for a bounded set of conversations. */
|
|
11
|
+
export declare function listConversationAnnotationsById(db: JuniorDatabase, conversationIds: readonly string[]): Promise<Map<string, ConversationAnnotation[]>>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type ConversationAnnotation, type ConversationSidebarAnnotation } from "@sentry/junior-plugin-api";
|
|
2
|
+
/** Return plugin-selected sidebar annotations for candidate conversations. */
|
|
3
|
+
export declare function listConversationSidebarAnnotations(conversationIds: string[], annotationsByConversation: Map<string, ConversationAnnotation[]>): Promise<Record<string, ConversationSidebarAnnotation[]>>;
|
|
@@ -4,6 +4,10 @@ import type { JuniorDatabase } from "@/db/db";
|
|
|
4
4
|
export declare function resolveViewerUserFromSql(db: JuniorDatabase, email: string): Promise<User | undefined>;
|
|
5
5
|
/** Resolve or create the canonical user for one authenticated viewer. */
|
|
6
6
|
export declare function resolveViewerUser(email: string): Promise<User | undefined>;
|
|
7
|
+
/** Read one existing canonical user by verified email without creating a row. */
|
|
8
|
+
export declare function findUserByEmailFromSql(db: JuniorDatabase, email: string): Promise<User | undefined>;
|
|
9
|
+
/** Read one existing canonical user by verified email without creating a row. */
|
|
10
|
+
export declare function findUserByEmail(email: string): Promise<User | undefined>;
|
|
7
11
|
/** Update one canonical user's display name in SQL. */
|
|
8
12
|
export declare function updateViewerDisplayNameFromSql(db: JuniorDatabase, userId: string, displayName: string): Promise<User | undefined>;
|
|
9
13
|
/** Update one canonical user's display name. */
|
|
@@ -10,10 +10,9 @@ export declare function ensureBlockSpacing(text: string): string;
|
|
|
10
10
|
* Normalize model-authored Slack markdown for delivery via `markdown_text`
|
|
11
11
|
* or `{ type: "markdown" }` blocks.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* chunking and continuation markers separately.
|
|
13
|
+
* Plugins may first rewrite ordinary Markdown. Core then applies Slack-only
|
|
14
|
+
* delivery shaping: bare URL wrapping and block spacing. Slack reply delivery
|
|
15
|
+
* owns chunking and continuation markers separately.
|
|
17
16
|
*/
|
|
18
17
|
export declare function normalizeSlackReplyMarkdown(text: string): string;
|
|
19
18
|
/** Normalize assistant status text before handing it to Slack. */
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { AttachmentStorage } from "@/chat/attachments/storage";
|
|
2
|
+
import type { SandboxWorkspace } from "@/chat/sandbox/workspace";
|
|
3
|
+
import type { JuniorSqlDatabase } from "@/db/db";
|
|
4
|
+
/** Create a tool that publishes one sandbox image at a public internet URL. */
|
|
5
|
+
export declare function createPublishImageTool(args: {
|
|
6
|
+
conversationId: string;
|
|
7
|
+
db: JuniorSqlDatabase;
|
|
8
|
+
publicBaseUrl?: () => string | undefined;
|
|
9
|
+
storage: Pick<AttachmentStorage, "put">;
|
|
10
|
+
workspace: SandboxWorkspace;
|
|
11
|
+
}): Omit<import("./definition").AnyToolDefinition, "inputSchema" | "outputSchema" | "prepareArguments" | "execute"> & {
|
|
12
|
+
inputSchema: import("./definition").JsonSchemaObject;
|
|
13
|
+
outputSchema: import("./definition").JsonSchemaObject;
|
|
14
|
+
prepareArguments(args: unknown): {
|
|
15
|
+
path: string;
|
|
16
|
+
};
|
|
17
|
+
execute?: ((input: unknown, options: import("./definition").ToolExecuteOptions) => {
|
|
18
|
+
[x: string]: unknown;
|
|
19
|
+
bytes: number;
|
|
20
|
+
content_type: string;
|
|
21
|
+
public: true;
|
|
22
|
+
url: string;
|
|
23
|
+
target?: string | undefined;
|
|
24
|
+
truncated?: boolean | undefined;
|
|
25
|
+
timed_out?: boolean | undefined;
|
|
26
|
+
continuation?: {
|
|
27
|
+
arguments: Record<string, unknown>;
|
|
28
|
+
reason?: string | undefined;
|
|
29
|
+
} | undefined;
|
|
30
|
+
} | Promise<{
|
|
31
|
+
[x: string]: unknown;
|
|
32
|
+
bytes: number;
|
|
33
|
+
content_type: string;
|
|
34
|
+
public: true;
|
|
35
|
+
url: string;
|
|
36
|
+
target?: string | undefined;
|
|
37
|
+
truncated?: boolean | undefined;
|
|
38
|
+
timed_out?: boolean | undefined;
|
|
39
|
+
continuation?: {
|
|
40
|
+
arguments: Record<string, unknown>;
|
|
41
|
+
reason?: string | undefined;
|
|
42
|
+
} | undefined;
|
|
43
|
+
}>) | undefined;
|
|
44
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { JuniorSqlDatabase } from "@/db/db";
|
|
2
|
+
/** Create a tool that stops serving one previously published public image. */
|
|
3
|
+
export declare function createUnpublishImageTool(args: {
|
|
4
|
+
conversationId: string;
|
|
5
|
+
db: JuniorSqlDatabase;
|
|
6
|
+
}): Omit<import("./definition").AnyToolDefinition, "inputSchema" | "outputSchema" | "prepareArguments" | "execute"> & {
|
|
7
|
+
inputSchema: import("./definition").JsonSchemaObject;
|
|
8
|
+
outputSchema: import("./definition").JsonSchemaObject;
|
|
9
|
+
prepareArguments(args: unknown): {
|
|
10
|
+
ref: string;
|
|
11
|
+
};
|
|
12
|
+
execute?: ((input: unknown, options: import("./definition").ToolExecuteOptions) => {
|
|
13
|
+
[x: string]: unknown;
|
|
14
|
+
filename: string;
|
|
15
|
+
unpublished: true;
|
|
16
|
+
target?: string | undefined;
|
|
17
|
+
truncated?: boolean | undefined;
|
|
18
|
+
timed_out?: boolean | undefined;
|
|
19
|
+
continuation?: {
|
|
20
|
+
arguments: Record<string, unknown>;
|
|
21
|
+
reason?: string | undefined;
|
|
22
|
+
} | undefined;
|
|
23
|
+
} | Promise<{
|
|
24
|
+
[x: string]: unknown;
|
|
25
|
+
filename: string;
|
|
26
|
+
unpublished: true;
|
|
27
|
+
target?: string | undefined;
|
|
28
|
+
truncated?: boolean | undefined;
|
|
29
|
+
timed_out?: boolean | undefined;
|
|
30
|
+
continuation?: {
|
|
31
|
+
arguments: Record<string, unknown>;
|
|
32
|
+
reason?: string | undefined;
|
|
33
|
+
} | undefined;
|
|
34
|
+
}>) | undefined;
|
|
35
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createWebAuthorization,
|
|
3
3
|
deleteWebAuthorization
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-HSFYTIS2.js";
|
|
5
5
|
import {
|
|
6
6
|
appendAndEnqueueInboundMessage
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-G35DUPNB.js";
|
|
8
8
|
import {
|
|
9
9
|
buildDeliveredTurnStatePatch,
|
|
10
10
|
completeAuthPauseTurn,
|
|
@@ -12,20 +12,20 @@ import {
|
|
|
12
12
|
getTurnUserMessage,
|
|
13
13
|
processPluginTask,
|
|
14
14
|
scheduleSessionCompletedPluginTasks
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-OPIJ6HY3.js";
|
|
16
16
|
import {
|
|
17
17
|
ConversationTurnLifecycleService,
|
|
18
18
|
coerceThreadConversationState,
|
|
19
19
|
getPersistedSandboxState,
|
|
20
20
|
getPersistedThreadState,
|
|
21
21
|
persistThreadStateById
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-QQ7SY5IZ.js";
|
|
23
23
|
import {
|
|
24
24
|
healthReportSchema
|
|
25
25
|
} from "./chunk-UTL3MHPC.js";
|
|
26
26
|
import {
|
|
27
27
|
parseSlackThreadId
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-YSWHAOPQ.js";
|
|
29
29
|
import {
|
|
30
30
|
TurnInputCommitLostError,
|
|
31
31
|
abandonTurnRecord,
|
|
@@ -48,17 +48,17 @@ import {
|
|
|
48
48
|
saveTurnCheckpoint,
|
|
49
49
|
startActiveTurn,
|
|
50
50
|
upsertConversationMessage
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-STZVUVMS.js";
|
|
52
52
|
import {
|
|
53
53
|
normalizeSlackConversationId
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-MNY5M7RB.js";
|
|
55
55
|
import {
|
|
56
56
|
getConversationEventStore,
|
|
57
57
|
getConversationStore
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-U2XOBFDK.js";
|
|
59
59
|
import {
|
|
60
60
|
getSlackBotToken
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-RVENVPNO.js";
|
|
62
62
|
import {
|
|
63
63
|
credentialContextForActor
|
|
64
64
|
} from "./chunk-BDUENQD3.js";
|
|
@@ -67,7 +67,7 @@ import {
|
|
|
67
67
|
logWarn,
|
|
68
68
|
setTags,
|
|
69
69
|
withLogContext
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-DNSIU27S.js";
|
|
71
71
|
|
|
72
72
|
// src/handlers/health.ts
|
|
73
73
|
function readHealthReport() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getTurnRequestDeadline
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IRHX2S46.js";
|
|
4
4
|
import {
|
|
5
5
|
CONVERSATION_WORK_CHECK_IN_INTERVAL_MS,
|
|
6
6
|
CONVERSATION_WORK_MAX_RETRIES,
|
|
@@ -21,20 +21,20 @@ import {
|
|
|
21
21
|
releaseConversationWork,
|
|
22
22
|
requestAnotherSlice,
|
|
23
23
|
startConversationWork
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-G35DUPNB.js";
|
|
25
25
|
import {
|
|
26
26
|
ConversationQueueMessageRejectedError
|
|
27
27
|
} from "./chunk-JAL3CH4G.js";
|
|
28
28
|
import {
|
|
29
29
|
getChatConfig,
|
|
30
30
|
isProviderRetryError
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-RVENVPNO.js";
|
|
32
32
|
import {
|
|
33
33
|
logException,
|
|
34
34
|
logInfo,
|
|
35
35
|
logWarn,
|
|
36
36
|
withLogContext
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-DNSIU27S.js";
|
|
38
38
|
|
|
39
39
|
// src/chat/task-execution/worker.ts
|
|
40
40
|
var CONVERSATION_WORK_DEFER_DELAY_MS = 15e3;
|