@sentry/junior 0.227.0 → 0.228.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-bEwEJhlg.js → agent-hooks-DUQ3ASdp.js} +18 -10
- package/dist/{agent-runner-BGDSjciH.js → agent-runner-CIesujf5.js} +27 -22
- package/dist/api/schema.d.ts +139 -27
- package/dist/api/schema.js +2 -2
- package/dist/api.js +71 -54
- package/dist/{app-CjRIKZb5.d.ts → app-BRZB3MuD.d.ts} +1 -1
- package/dist/app.d.ts +1 -1
- package/dist/app.js +94 -28
- package/dist/{briefs-BkM_ZW4B.js → briefs-BTrVMqUg.js} +4 -4
- package/dist/{catalog-runtime-Cw9V2jpn.js → catalog-runtime-NOBDOyJi.js} +1 -1
- package/dist/{checkpoint-oZYD3-Ar.js → checkpoint-CzN3gXoB.js} +6 -6
- package/dist/cli/chat.js +13 -13
- package/dist/cli/check.js +3 -3
- package/dist/cli/main.js +1 -1
- package/dist/cli/plugins.js +3 -3
- package/dist/cli/snapshot-create.js +3 -3
- package/dist/cli/upgrade.js +3 -3
- package/dist/{client-Pcxo3lGn.js → client-C6VUBzL_.js} +2 -2
- package/dist/{config-CYvEow1F.js → config-BLPaWN1Q.js} +2 -2
- package/dist/{conversation-BnhOMfEB.js → conversation-DOI6Y60M.js} +3 -2
- package/dist/{conversation-privacy-hQmyZbOC.js → conversation-privacy-DJ88ECSq.js} +1 -1
- package/dist/{credential-sync-CUGbiiCM.js → credential-sync-OKs419AB.js} +13 -13
- package/dist/{executor-BXMlFrV6.js → executor-DZVZBfmX.js} +1 -1
- package/dist/{history-nukv1YN8.d.ts → history-H-SI5Dej.d.ts} +1 -0
- package/dist/{images-8siTAUNW.js → images-D3x6EemU.js} +3 -3
- package/dist/instrumentation.js +2 -2
- package/dist/{job-queue-AI0_QAgc.js → job-queue-BuSPM0cX.js} +1 -1
- package/dist/{logging-BPBx6WF-.js → logging-Blgn76r3.js} +1 -1
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-authorization-Cq1GaLIP.js → oauth-authorization-t-NPqTNB.js} +1 -1
- package/dist/{oauth-callback-server-CnF03VYh.js → oauth-callback-server-BP7SgTcu.js} +2 -2
- package/dist/{pending-auth-CHUjr_6d.js → pending-auth-CXLwmDaG.js} +1 -1
- package/dist/{profile-upzC-wN1.js → profile-a5xmeUHf.js} +4 -4
- package/dist/{prompt-CZIQcPHy.js → prompt-9C-wUwwx.js} +1 -1
- package/dist/{registry-DM5aMhjm.js → registry-BUbczT2k.js} +1 -1
- package/dist/{resolve-sF6Lg7Ay.js → resolve-3PhWSiEF.js} +2 -2
- package/dist/{runner-Bu2wYpK8.js → runner-CsnuKcsq.js} +9 -9
- package/dist/{sandbox-egress-signals-Dgerhizb.js → sandbox-egress-signals-D34sI4J6.js} +1 -1
- package/dist/{schema-BSiwcvjm.js → schema-CXmCvVLn.js} +1 -1
- package/dist/{skills-CAI5s___.js → skills-CLgyYrgF.js} +2 -2
- package/dist/{spawn-DRK9TBgY.js → spawn-CS56i7Nm.js} +2 -2
- package/dist/{task-queue-iuDAqfZg.js → task-queue-C2sTDXqQ.js} +3 -3
- package/dist/{task-runner-S3QtH38c.js → task-runner-uSodiP4v.js} +9 -9
- package/dist/{thread-state-C_arVuaN.js → thread-state-BurqeqMv.js} +5 -5
- package/dist/{turn-failure-response-DarwGYgC.js → turn-failure-response-Bshcqa0a.js} +8 -8
- package/dist/{turn-lifecycle-CdiIejXH.js → turn-lifecycle-foKlVl_T.js} +1 -1
- package/dist/{turn-session-routing-DyLGd_wU.js → turn-session-routing-DDUMJ2GY.js} +1 -1
- package/dist/{validation-BMig74Zp.js → validation-DZc56dXw.js} +1 -1
- package/dist/{version-lhQSfLjx.js → version-y4cRp5Y2.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{web-authorization-r2lKYKJ2.js → web-authorization-BfVYx0t1.js} +6 -6
- package/dist/{web-input-BU-Fu7iq.js → web-input-B6FZlrgg.js} +50 -28
- package/dist/{work-B9koS8sW.js → work-Dy8sW9MZ.js} +7 -7
- package/dist/{worker-C_iJSRgG.js → worker-BH0RP7Hj.js} +5 -5
- package/package.json +4 -4
package/dist/api.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { Ct as cancelHumanFacingPendingMessages, M as parseSlackThreadId, Nt as getConversation, b as readStats, k as readLiveAttachment } from "./agent-runner-
|
|
2
|
-
import { d as logException, p as logWarn } from "./logging-
|
|
1
|
+
import { Ct as cancelHumanFacingPendingMessages, M as parseSlackThreadId, Nt as getConversation, b as readStats, k as readLiveAttachment } from "./agent-runner-CIesujf5.js";
|
|
2
|
+
import { d as logException, p as logWarn } from "./logging-Blgn76r3.js";
|
|
3
3
|
import { b as parseSlackMessageTs, h as parseSlackTeamId, p as parseSlackChannelId } from "./context-0Et9iVSB.js";
|
|
4
|
-
import { $ as resolveViewerUser, $t as
|
|
4
|
+
import { $ as resolveViewerUser, $t as getConversationStore, At as conversationNotArchivedForEmail, Ct as createPluginLogger, D as SANDBOX_RUNTIME, Dt as conversationArchivedForUser, Et as conversationArchivedForEmail, Ft as readConversationEventPage, Gt as listConversationAnnotationsById, It as buildSentryConversationUrl, J as withSlackRetries, Mt as viewerConversationMembership, Ot as conversationHasParticipantEmail, Pt as readLatestConversationBrief, S as WorkspaceValidationError, Tt as conversationArchiveTimes, U as getSlackClient, Wt as listConversationAnnotations, Z as findUserByEmail, _ as deleteWorkspace, an as locationFromRow, b as listWorkspaces, dn as agentTurnUsageSchema, en as getDb, et as updateViewerDisplayName, fn as hasAgentTurnUsage, g as createWorkspace, j as workspaceRepoCheckoutPath, jt as conversationNotArchivedForUser, kt as conversationHasParticipantUser, pn as resolveRootConversationId, sn as parseSessionSource, tn as getSqlExecutor, u as getPlugins, v as getWorkspace, wt as readConversationAccessFromSql, x as updateWorkspace } from "./agent-hooks-DUQ3ASdp.js";
|
|
5
5
|
import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
|
|
6
|
-
import { C as juniorCodeRepositories, D as juniorIdentities, E as juniorConversations, O as juniorUsers, S as juniorCodeChanges, T as conversationReadColumns, b as juniorApiTokens, g as juniorConversationBriefs, m as juniorConversationParticipants, v as juniorConversationMetrics, y as juniorConversationEvents } from "./executor-
|
|
7
|
-
import { D as createConversationBodySchema, I as readMessageAttachments, L as INPUT_IMAGE_TYPES, O as createConversationMessageBodySchema, T as conversationStatsReportSchema, _ as conversationParamsSchema, a as cancelConversationPendingMessagesBodySchema, c as conversationAttachmentParamsSchema, d as conversationDetailReportSchema, g as conversationFeedSchema, h as conversationFeedQuerySchema, i as archiveConversationResponseSchema, m as conversationEventsQuerySchema, o as cancelConversationPendingMessagesResponseSchema, p as conversationEventPageSchema, r as archiveConversationBodySchema, t as acceptedConversationMessageSchema, u as conversationDetailQuerySchema, x as conversationPendingMessagesReportSchema } from "./conversation-
|
|
8
|
-
import { n as hash, t as create } from "./profile-
|
|
9
|
-
import { t as getCachedSnapshot } from "./resolve-
|
|
10
|
-
import { a as getVercelConversationWorkQueue } from "./job-queue-
|
|
6
|
+
import { C as juniorCodeRepositories, D as juniorIdentities, E as juniorConversations, O as juniorUsers, S as juniorCodeChanges, T as conversationReadColumns, b as juniorApiTokens, g as juniorConversationBriefs, m as juniorConversationParticipants, v as juniorConversationMetrics, y as juniorConversationEvents } from "./executor-DZVZBfmX.js";
|
|
7
|
+
import { D as createConversationBodySchema, I as readMessageAttachments, L as INPUT_IMAGE_TYPES, O as createConversationMessageBodySchema, T as conversationStatsReportSchema, _ as conversationParamsSchema, a as cancelConversationPendingMessagesBodySchema, c as conversationAttachmentParamsSchema, d as conversationDetailReportSchema, g as conversationFeedSchema, h as conversationFeedQuerySchema, i as archiveConversationResponseSchema, m as conversationEventsQuerySchema, o as cancelConversationPendingMessagesResponseSchema, p as conversationEventPageSchema, r as archiveConversationBodySchema, t as acceptedConversationMessageSchema, u as conversationDetailQuerySchema, x as conversationPendingMessagesReportSchema } from "./conversation-DOI6Y60M.js";
|
|
8
|
+
import { n as hash, t as create } from "./profile-a5xmeUHf.js";
|
|
9
|
+
import { t as getCachedSnapshot } from "./resolve-3PhWSiEF.js";
|
|
10
|
+
import { a as getVercelConversationWorkQueue } from "./job-queue-BuSPM0cX.js";
|
|
11
11
|
import { C as skillReportsSchema, a as fillUtcHours, b as pluginsSchema, c as sumUtcHoursIntoSixHours, d as trailingUtcSixHourWindow, f as utcDayKey, h as pluginOperationalReportFeedSchema, i as fillUtcDays, l as trailingUtcDayWindow, m as healthReportSchema, n as DAY_MS$1, o as fillUtcSixHours, p as utcHourKey, r as HOUR_MS$1, s as startOfUtcHour, u as trailingUtcHourWindow, x as runtimeInfoReportSchema } from "./web-message-id-xPI_EFSC.js";
|
|
12
|
-
import { F as createVercelAttachmentStorage, _ as readViewerAutomations, a as webActorFromEmail, b as clearSlackPendingReactions, c as getProductionSlackAdapter, d as ViewerTaskNotFoundError, f as deleteViewerTask, h as readViewerAutomationRuns, k as legacyWebMailboxMetadataSchema, l as formatSlackConversationRedactedLabel, m as readViewerAutomationExecutions, p as readConversationSourceTask, r as createAndEnqueueConversation, t as appendAndEnqueueWebMessage, u as resolveSlackConversationContextFromThreadId, x as lookupSlackUser, z as readHealthReport } from "./web-input-
|
|
13
|
-
import { A as conversationAggregateColumns, j as conversationRangeColumns, k as conversationActiveDaysColumn } from "./task-runner-
|
|
14
|
-
import { r as getWebAuthorization } from "./web-authorization-
|
|
15
|
-
import { t as decodeInputImages } from "./images-
|
|
16
|
-
import { A as actorProfileReportSchema, C as createPersonalTokenBodySchema, D as personalTokenParamsSchema, F as locationDirectoryReportSchema, G as codePersonReportSchema, I as locationParamsSchema, L as activityDays$1, M as personalSpendReportSchema, O as revokePersonalTokenResponseSchema, P as locationDetailReportSchema, R as activityHours$1, T as personalTokenListSchema, W as codeOverviewReportSchema, _ as automationRunListSchema, a as workspaceBodySchema, g as automationParamsSchema, h as automationListSchema, i as deleteWorkspaceResponseSchema, j as personParamsSchema, k as actorDirectoryReportSchema, l as workspaceSchema, m as automationListQuerySchema, n as statsReportSchema, o as workspaceListSchema, q as apiErrorSchema, s as workspaceParamsSchema, u as automationExecutionListSchema, w as createdPersonalTokenSchema, z as activitySixHours$1 } from "./schema-
|
|
12
|
+
import { F as createVercelAttachmentStorage, _ as readViewerAutomations, a as webActorFromEmail, b as clearSlackPendingReactions, c as getProductionSlackAdapter, d as ViewerTaskNotFoundError, f as deleteViewerTask, h as readViewerAutomationRuns, k as legacyWebMailboxMetadataSchema, l as formatSlackConversationRedactedLabel, m as readViewerAutomationExecutions, p as readConversationSourceTask, r as createAndEnqueueConversation, t as appendAndEnqueueWebMessage, u as resolveSlackConversationContextFromThreadId, x as lookupSlackUser, z as readHealthReport } from "./web-input-B6FZlrgg.js";
|
|
13
|
+
import { A as conversationAggregateColumns, j as conversationRangeColumns, k as conversationActiveDaysColumn } from "./task-runner-uSodiP4v.js";
|
|
14
|
+
import { r as getWebAuthorization } from "./web-authorization-BfVYx0t1.js";
|
|
15
|
+
import { t as decodeInputImages } from "./images-D3x6EemU.js";
|
|
16
|
+
import { A as actorProfileReportSchema, C as createPersonalTokenBodySchema, D as personalTokenParamsSchema, F as locationDirectoryReportSchema, G as codePersonReportSchema, I as locationParamsSchema, L as activityDays$1, M as personalSpendReportSchema, O as revokePersonalTokenResponseSchema, P as locationDetailReportSchema, R as activityHours$1, T as personalTokenListSchema, W as codeOverviewReportSchema, _ as automationRunListSchema, a as workspaceBodySchema, g as automationParamsSchema, h as automationListSchema, i as deleteWorkspaceResponseSchema, j as personParamsSchema, k as actorDirectoryReportSchema, l as workspaceSchema, m as automationListQuerySchema, n as statsReportSchema, o as workspaceListSchema, q as apiErrorSchema, s as workspaceParamsSchema, u as automationExecutionListSchema, w as createdPersonalTokenSchema, z as activitySixHours$1 } from "./schema-CXmCvVLn.js";
|
|
17
17
|
import { Hono } from "hono";
|
|
18
18
|
import path from "node:path";
|
|
19
19
|
import { z } from "zod";
|
|
@@ -228,6 +228,56 @@ async function appendConversationMessageForViewer(viewer, conversationId, body,
|
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
230
|
//#endregion
|
|
231
|
+
//#region src/chat/plugins/conversation-sidebar.ts
|
|
232
|
+
/** Show native objects by default and let plugins select compact sidebar labels. */
|
|
233
|
+
async function listConversationSidebarAnnotations(conversationIds, annotationsByConversation) {
|
|
234
|
+
const candidates = new Set(conversationIds);
|
|
235
|
+
const selected = {};
|
|
236
|
+
const plugins = getPlugins();
|
|
237
|
+
const customOwners = new Set(plugins.filter((plugin) => plugin.hooks?.conversationSidebar).map((plugin) => plugin.manifest.name));
|
|
238
|
+
for (const conversationId of conversationIds) {
|
|
239
|
+
const objects = (annotationsByConversation.get(conversationId) ?? []).flatMap((annotation) => {
|
|
240
|
+
if (customOwners.has(annotation.plugin) || !annotation.objectType) return [];
|
|
241
|
+
return [{
|
|
242
|
+
key: annotation.key,
|
|
243
|
+
label: annotation.label,
|
|
244
|
+
objectType: annotation.objectType === "item" && annotation.kind === "object" && annotation.facts?.type === "deployment" ? "deployment" : annotation.objectType,
|
|
245
|
+
status: annotation.status
|
|
246
|
+
}];
|
|
247
|
+
});
|
|
248
|
+
if (objects.length) selected[conversationId] = objects;
|
|
249
|
+
}
|
|
250
|
+
for (const plugin of plugins) {
|
|
251
|
+
const hook = plugin.hooks?.conversationSidebar;
|
|
252
|
+
if (!hook) continue;
|
|
253
|
+
const annotationsByConversationId = Object.fromEntries(conversationIds.flatMap((conversationId) => {
|
|
254
|
+
const annotations = (annotationsByConversation.get(conversationId) ?? []).filter((annotation) => annotation.plugin === plugin.manifest.name);
|
|
255
|
+
return annotations.length > 0 ? [[conversationId, annotations]] : [];
|
|
256
|
+
}));
|
|
257
|
+
try {
|
|
258
|
+
const result = await hook({
|
|
259
|
+
annotationsByConversationId,
|
|
260
|
+
conversationIds,
|
|
261
|
+
db: getDb(),
|
|
262
|
+
log: createPluginLogger(plugin.manifest.name),
|
|
263
|
+
plugin: { name: plugin.manifest.name }
|
|
264
|
+
});
|
|
265
|
+
for (const [conversationId, annotations] of Object.entries(result.annotationsByConversationId)) {
|
|
266
|
+
if (!candidates.has(conversationId)) continue;
|
|
267
|
+
const parsed = conversationSidebarAnnotationSchema.array().safeParse(annotations);
|
|
268
|
+
if (!parsed.success || parsed.data.length === 0) continue;
|
|
269
|
+
selected[conversationId] = [...selected[conversationId] ?? [], ...parsed.data];
|
|
270
|
+
}
|
|
271
|
+
} catch (error) {
|
|
272
|
+
logWarn("plugin.conversation_sidebar.hook.failed", {
|
|
273
|
+
"app.plugin.name": plugin.manifest.name,
|
|
274
|
+
"exception.message": error instanceof Error ? error.message : String(error)
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
return selected;
|
|
279
|
+
}
|
|
280
|
+
//#endregion
|
|
231
281
|
//#region src/chat/slack/location-url.ts
|
|
232
282
|
/** Parse a Slack workspace subdomain used in `https://{domain}.slack.com` URLs. */
|
|
233
283
|
function parseSlackTeamDomain(value) {
|
|
@@ -762,42 +812,6 @@ async function readConversationAuxiliaryCostsFromSql(db, conversationIds, option
|
|
|
762
812
|
return result;
|
|
763
813
|
}
|
|
764
814
|
//#endregion
|
|
765
|
-
//#region src/chat/plugins/conversation-sidebar.ts
|
|
766
|
-
/** Return plugin-selected sidebar annotations for candidate conversations. */
|
|
767
|
-
async function listConversationSidebarAnnotations(conversationIds, annotationsByConversation) {
|
|
768
|
-
const candidates = new Set(conversationIds);
|
|
769
|
-
const selected = {};
|
|
770
|
-
for (const plugin of getPlugins()) {
|
|
771
|
-
const hook = plugin.hooks?.conversationSidebar;
|
|
772
|
-
if (!hook) continue;
|
|
773
|
-
const annotationsByConversationId = Object.fromEntries(conversationIds.flatMap((conversationId) => {
|
|
774
|
-
const annotations = (annotationsByConversation.get(conversationId) ?? []).filter((annotation) => annotation.plugin === plugin.manifest.name);
|
|
775
|
-
return annotations.length > 0 ? [[conversationId, annotations]] : [];
|
|
776
|
-
}));
|
|
777
|
-
try {
|
|
778
|
-
const result = await hook({
|
|
779
|
-
annotationsByConversationId,
|
|
780
|
-
conversationIds,
|
|
781
|
-
db: getDb(),
|
|
782
|
-
log: createPluginLogger(plugin.manifest.name),
|
|
783
|
-
plugin: { name: plugin.manifest.name }
|
|
784
|
-
});
|
|
785
|
-
for (const [conversationId, annotations] of Object.entries(result.annotationsByConversationId)) {
|
|
786
|
-
if (!candidates.has(conversationId)) continue;
|
|
787
|
-
const parsed = conversationSidebarAnnotationSchema.array().safeParse(annotations);
|
|
788
|
-
if (!parsed.success || parsed.data.length === 0) continue;
|
|
789
|
-
selected[conversationId] = [...selected[conversationId] ?? [], ...parsed.data];
|
|
790
|
-
}
|
|
791
|
-
} catch (error) {
|
|
792
|
-
logWarn("plugin.conversation_sidebar.hook.failed", {
|
|
793
|
-
"app.plugin.name": plugin.manifest.name,
|
|
794
|
-
"exception.message": error instanceof Error ? error.message : String(error)
|
|
795
|
-
});
|
|
796
|
-
}
|
|
797
|
-
}
|
|
798
|
-
return selected;
|
|
799
|
-
}
|
|
800
|
-
//#endregion
|
|
801
815
|
//#region src/chat/plugins/unfinished-work.ts
|
|
802
816
|
/**
|
|
803
817
|
* Return assigned and unfinished plugin work for the candidate conversations.
|
|
@@ -1172,6 +1186,7 @@ function projectConversationDetail(args) {
|
|
|
1172
1186
|
usage: args.usage
|
|
1173
1187
|
}),
|
|
1174
1188
|
annotations: canExposePayload ? args.annotations : [],
|
|
1189
|
+
sidebarAnnotations: canExposePayload ? args.sidebarAnnotations : void 0,
|
|
1175
1190
|
...canExposePayload && args.brief ? { brief: args.brief } : void 0,
|
|
1176
1191
|
events: args.events,
|
|
1177
1192
|
...canExposePayload && args.participants.length > 0 ? { participants: args.participants } : void 0,
|
|
@@ -1213,6 +1228,7 @@ async function readConversationDetailFromSql(conversationId, options) {
|
|
|
1213
1228
|
resolveSlackTeamDomains(record.conversation.location?.provider === "slack" ? [record.conversation.location.teamId] : [])
|
|
1214
1229
|
]);
|
|
1215
1230
|
const access = accessByConversation.get(conversationId);
|
|
1231
|
+
const sidebarAnnotations = access?.canViewPrivateContent ? (await listConversationSidebarAnnotations([conversationId], /* @__PURE__ */ new Map([[conversationId, annotations]])))[conversationId] : void 0;
|
|
1216
1232
|
const page = record.conversation.transcriptPurgedAtMs === void 0 ? await readConversationEventPage(executor, {
|
|
1217
1233
|
canExposePayload: access?.canViewPrivateContent ?? false,
|
|
1218
1234
|
conversationId,
|
|
@@ -1224,6 +1240,7 @@ async function readConversationDetailFromSql(conversationId, options) {
|
|
|
1224
1240
|
access,
|
|
1225
1241
|
...archivedAtMs === void 0 ? void 0 : { archivedAtMs },
|
|
1226
1242
|
annotations,
|
|
1243
|
+
sidebarAnnotations,
|
|
1227
1244
|
auxiliaryCosts: auxiliaryCostsByConversation.get(conversationId),
|
|
1228
1245
|
...briefVersion ? { brief: {
|
|
1229
1246
|
content: briefVersion.content,
|
|
@@ -3042,7 +3059,7 @@ async function readPeoplePluginReports(args) {
|
|
|
3042
3059
|
reports: [],
|
|
3043
3060
|
source: "plugins"
|
|
3044
3061
|
});
|
|
3045
|
-
const { getPluginProfileReports } = await import("./agent-hooks-
|
|
3062
|
+
const { getPluginProfileReports } = await import("./agent-hooks-DUQ3ASdp.js").then((n) => n.t);
|
|
3046
3063
|
return pluginOperationalReportFeedSchema.parse({
|
|
3047
3064
|
generatedAt: new Date(nowMs).toISOString(),
|
|
3048
3065
|
reports: await getPluginProfileReports({
|
|
@@ -3651,7 +3668,7 @@ function readDescriptionText(home) {
|
|
|
3651
3668
|
}
|
|
3652
3669
|
/** Read discovered skill names for authenticated runtime diagnostics. */
|
|
3653
3670
|
async function readSkillReports() {
|
|
3654
|
-
const { discoverSkills } = await import("./skills-
|
|
3671
|
+
const { discoverSkills } = await import("./skills-CLgyYrgF.js").then((n) => n.o);
|
|
3655
3672
|
const skills = await discoverSkills();
|
|
3656
3673
|
return skillReportsSchema.parse(skills.map((skill) => ({
|
|
3657
3674
|
name: skill.name,
|
|
@@ -3660,7 +3677,7 @@ async function readSkillReports() {
|
|
|
3660
3677
|
}
|
|
3661
3678
|
/** Read safe configured plugin metadata for authenticated runtime diagnostics. */
|
|
3662
3679
|
async function readPlugins() {
|
|
3663
|
-
const { pluginCatalogRuntime } = await import("./catalog-runtime-
|
|
3680
|
+
const { pluginCatalogRuntime } = await import("./catalog-runtime-NOBDOyJi.js").then((n) => n.t);
|
|
3664
3681
|
return pluginsSchema.parse(pluginCatalogRuntime.getProviders().map((plugin) => ({
|
|
3665
3682
|
configKeys: plugin.manifest.configKeys ?? [],
|
|
3666
3683
|
description: plugin.manifest.description,
|
|
@@ -3672,7 +3689,7 @@ async function readPlugins() {
|
|
|
3672
3689
|
async function readRuntimeInfoReport() {
|
|
3673
3690
|
const [{ homeDir }, { pluginCatalogRuntime }, plugins, skills] = await Promise.all([
|
|
3674
3691
|
import("./package-discovery-7a9YqLhE.js").then((n) => n.r),
|
|
3675
|
-
import("./catalog-runtime-
|
|
3692
|
+
import("./catalog-runtime-NOBDOyJi.js").then((n) => n.t),
|
|
3676
3693
|
readPlugins(),
|
|
3677
3694
|
readSkillReports()
|
|
3678
3695
|
]);
|
|
@@ -3689,7 +3706,7 @@ async function readRuntimeInfoReport() {
|
|
|
3689
3706
|
/** Read sanitized operational summaries contributed by plugins. */
|
|
3690
3707
|
async function readPluginOperationalReportFeed() {
|
|
3691
3708
|
const nowMs = Date.now();
|
|
3692
|
-
const { getPluginOperationalReports } = await import("./agent-hooks-
|
|
3709
|
+
const { getPluginOperationalReports } = await import("./agent-hooks-DUQ3ASdp.js").then((n) => n.t);
|
|
3693
3710
|
return pluginOperationalReportFeedSchema.parse({
|
|
3694
3711
|
source: "plugins",
|
|
3695
3712
|
generatedAt: new Date(nowMs).toISOString(),
|
package/dist/app.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as ModelProfileInput, n as JuniorDashboardOptions, r as createApp, t as JuniorAppOptions } from "./app-
|
|
1
|
+
import { i as ModelProfileInput, n as JuniorDashboardOptions, r as createApp, t as JuniorAppOptions } from "./app-BRZB3MuD.js";
|
|
2
2
|
import { i as defineJuniorPlugins, n as JuniorPluginSet, r as JuniorPluginSetOptions, t as JuniorPluginInput } from "./plugins-BT2l4We3.js";
|
|
3
3
|
import { t as JUNIOR_VERSION } from "./version-CnXZ614E.js";
|
|
4
4
|
export { JUNIOR_VERSION, JuniorAppOptions, JuniorDashboardOptions, type JuniorPluginInput, type JuniorPluginSet, type JuniorPluginSetOptions, type ModelProfileInput, createApp, defineJuniorPlugins };
|
package/dist/app.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { $ as collectEventAutomationMatchKeys, A as requestAttachmentDeletion, An as getConfigDefaults, Bt as removeActiveConversation, C as readPublicArtifact, Cn as createUserTokenStore, Et as clearExpiredConversationLease, Ft as hasRunnableConversationWork, G as readScheduledAutomation, H as listScheduledAutomations, Ht as requestConversationWork, It as listActiveConversationIds, J as scheduledRunId, Jt as hasRunnableConversationWork$1, Kt as CONVERSATION_WORK_STALE_ENQUEUE_MS, L as logScheduledAutomationRunSkipped, M as parseSlackThreadId, Mt as ensureConversationWake, Nt as getConversation, O as collectAttachmentGarbage, Pt as getConversationWorkState, Q as effectiveTaskOutcomes, R as scheduledAutomationRunAttributes, S as publicArtifactHeaders, Sn as slackExternalRefIdSchema, U as listScheduledAutomationsForTeam, Wt as stopConversationWork, X as scheduledRunSchema, Xt as isInvalidConversationRecordError, Y as withScheduledAutomationLock, Zt as renderTaskInput, _t as getEventCatalog, a as isExperimentalFeatureEnabled, an as consumeSandboxEgressAuthRequiredSignal, en as resolveSandboxEgressProviderForHost, f as deleteMcpAuthSessionsForUserProvider, fn as startOAuthFlow, i as getExperimentalFeatures, in as clearSandboxEgressSignals, jn as setConfigDefaults, l as executeCredentialedEgressRequest, ln as formatProviderLabel, m as deleteMcpStoredOAuthCredentials, mt as ingestEvent, nn as shouldPropagateSandboxEgressTrace, nt as findMatchingEventAutomations, o as setExperimentalFeatures, on as consumeSandboxEgressPermissionDeniedSignal, p as deleteMcpServerSessionId, pt as processWorkspaceSnapshotJob, q as saveScheduledAutomationInLock, rn as SANDBOX_EGRESS_PROXY_PATH, s as executeAgentRun, sn as parseSandboxEgressCredentialToken, t as createAgentRunner, tn as normalizeSandboxEgressTracePropagationDomains, vt as eventGuidance, w as unpublishedArtifactHeaders, xn as slackEntitySchema, xt as appendAndEnqueueInboundMessage, z as getNextRunAtMs } from "./agent-runner-
|
|
2
|
-
import { C as withLogContext, O as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, S as withContext, d as logException, f as logInfo, j as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, p as logWarn, r as createRequestContext, v as setSpanAttributes, w as withSpan, y as setSpanStatus } from "./logging-
|
|
1
|
+
import { $ as collectEventAutomationMatchKeys, A as requestAttachmentDeletion, An as getConfigDefaults, Bt as removeActiveConversation, C as readPublicArtifact, Cn as createUserTokenStore, Et as clearExpiredConversationLease, Ft as hasRunnableConversationWork, G as readScheduledAutomation, H as listScheduledAutomations, Ht as requestConversationWork, It as listActiveConversationIds, J as scheduledRunId, Jt as hasRunnableConversationWork$1, Kt as CONVERSATION_WORK_STALE_ENQUEUE_MS, L as logScheduledAutomationRunSkipped, M as parseSlackThreadId, Mt as ensureConversationWake, Nt as getConversation, O as collectAttachmentGarbage, Pt as getConversationWorkState, Q as effectiveTaskOutcomes, R as scheduledAutomationRunAttributes, S as publicArtifactHeaders, Sn as slackExternalRefIdSchema, T as lookupSlackUserProfile, U as listScheduledAutomationsForTeam, Wt as stopConversationWork, X as scheduledRunSchema, Xt as isInvalidConversationRecordError, Y as withScheduledAutomationLock, Zt as renderTaskInput, _t as getEventCatalog, a as isExperimentalFeatureEnabled, an as consumeSandboxEgressAuthRequiredSignal, en as resolveSandboxEgressProviderForHost, f as deleteMcpAuthSessionsForUserProvider, fn as startOAuthFlow, i as getExperimentalFeatures, in as clearSandboxEgressSignals, jn as setConfigDefaults, l as executeCredentialedEgressRequest, ln as formatProviderLabel, m as deleteMcpStoredOAuthCredentials, mt as ingestEvent, nn as shouldPropagateSandboxEgressTrace, nt as findMatchingEventAutomations, o as setExperimentalFeatures, on as consumeSandboxEgressPermissionDeniedSignal, p as deleteMcpServerSessionId, pt as processWorkspaceSnapshotJob, q as saveScheduledAutomationInLock, rn as SANDBOX_EGRESS_PROXY_PATH, s as executeAgentRun, sn as parseSandboxEgressCredentialToken, t as createAgentRunner, tn as normalizeSandboxEgressTracePropagationDomains, vt as eventGuidance, w as unpublishedArtifactHeaders, xn as slackEntitySchema, xt as appendAndEnqueueInboundMessage, z as getNextRunAtMs } from "./agent-runner-CIesujf5.js";
|
|
2
|
+
import { C as withLogContext, O as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, S as withContext, d as logException, f as logInfo, j as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, p as logWarn, r as createRequestContext, v as setSpanAttributes, w as withSpan, y as setSpanStatus } from "./logging-Blgn76r3.js";
|
|
3
3
|
import { r as continueTrace } from "./sentry-CgWZM_kV.js";
|
|
4
|
-
import { t as JUNIOR_VERSION } from "./version-
|
|
5
|
-
import { a as getChatConfig, f as setBotModelConfig, i as configureFunctionMaxDurationSeconds, m as setSlackReactionConfig, n as botConfig, p as setProfiles, s as getSlackBotToken, u as getSlackReactionConfig } from "./config-
|
|
6
|
-
import { _ as slackChannelIdSchema, u as parseActorUserId, v as slackTeamIdSchema, x as slackMessageTsSchema, y as slackUserIdSchema } from "./context-0Et9iVSB.js";
|
|
7
|
-
import { $t as
|
|
4
|
+
import { t as JUNIOR_VERSION } from "./version-y4cRp5Y2.js";
|
|
5
|
+
import { a as getChatConfig, f as setBotModelConfig, i as configureFunctionMaxDurationSeconds, m as setSlackReactionConfig, n as botConfig, p as setProfiles, s as getSlackBotToken, u as getSlackReactionConfig } from "./config-BLPaWN1Q.js";
|
|
6
|
+
import { _ as slackChannelIdSchema, g as parseSlackUserId, h as parseSlackTeamId, u as parseActorUserId, v as slackTeamIdSchema, x as slackMessageTsSchema, y as slackUserIdSchema } from "./context-0Et9iVSB.js";
|
|
7
|
+
import { $t as getConversationStore, Ct as createPluginLogger, F as bindSlackDirectCredentialSubject, G as isDmChannel, I as verifyEventAutomationCredentialSubject, L as verifyScheduledAutomationCredentialSubject, N as bindEventAutomationCredentialSubject, P as bindScheduledAutomationCredentialSubject, Q as readActorIdentity, R as verifySlackDirectCredentialSubject, U as getSlackClient, Vt as resolveRootVisibility, Wt as listConversationAnnotations, X as runWithWorkspaceTeamId, Y as getWorkspaceTeamId, Zt as getConversationEventStore, a as getPluginRoutes, bt as createPluginState, ct as collectEventMatchKeys, d as setPlugins, en as getDb, f as validatePlugins, ft as findMatchingWatches, gt as getDashboardConversationLink, h as setBriefsConfig, i as getPluginApiRoutes, in as withConversationMutationLock, mn as deleteProviderIdentityForSlackUser, mt as takeDueTimerWatches, ot as cancelSubscriptions, rn as withConversationEventLock, tn as getSqlExecutor, u as getPlugins, vt as getDashboardTaskLink, wt as readConversationAccessFromSql, yt as setDashboardConversationLinkOptions } from "./agent-hooks-DUQ3ASdp.js";
|
|
8
8
|
import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
|
|
9
|
-
import { E as juniorConversations, a as juniorSchedulerRuns, f as juniorAgentBindings, g as juniorConversationBriefs, o as juniorSchedulerTasks, p as juniorAgentInvocations, y as juniorConversationEvents } from "./executor-
|
|
10
|
-
import { k as annotationCard } from "./conversation-
|
|
11
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
12
|
-
import { X as projectConversationMessages, q as appendConversationMessages } from "./checkpoint-
|
|
13
|
-
import { O as withLock$1, w as getStateAdapter } from "./profile-
|
|
14
|
-
import { f as setSandboxResourceConfig, u as getSandboxResourceConfig } from "./resolve-
|
|
15
|
-
import { a as getVercelConversationWorkQueue, g as isConversationQueueMessageRejectedError, h as conversationQueueMessageSchema, i as verifyWorkspaceSnapshotJobMessage, o as resolveConversationWorkQueueTopic, s as verifyConversationQueueMessage, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-
|
|
16
|
-
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-
|
|
9
|
+
import { E as juniorConversations, a as juniorSchedulerRuns, f as juniorAgentBindings, g as juniorConversationBriefs, o as juniorSchedulerTasks, p as juniorAgentInvocations, y as juniorConversationEvents } from "./executor-DZVZBfmX.js";
|
|
10
|
+
import { k as annotationCard } from "./conversation-DOI6Y60M.js";
|
|
11
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-NOBDOyJi.js";
|
|
12
|
+
import { X as projectConversationMessages, q as appendConversationMessages } from "./checkpoint-CzN3gXoB.js";
|
|
13
|
+
import { O as withLock$1, w as getStateAdapter } from "./profile-a5xmeUHf.js";
|
|
14
|
+
import { f as setSandboxResourceConfig, u as getSandboxResourceConfig } from "./resolve-3PhWSiEF.js";
|
|
15
|
+
import { a as getVercelConversationWorkQueue, g as isConversationQueueMessageRejectedError, h as conversationQueueMessageSchema, i as verifyWorkspaceSnapshotJobMessage, o as resolveConversationWorkQueueTopic, s as verifyConversationQueueMessage, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-BuSPM0cX.js";
|
|
16
|
+
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-DZc56dXw.js";
|
|
17
17
|
import { a as pluginRuntimeRegistrationsFromPluginSet, n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "./plugins-egKWjgue.js";
|
|
18
|
-
import { A as THREAD_OPTOUT_ACK, C as verifySlackSignature, D as withNormalizedThreadId, E as normalizeIncomingSlackThreadId, F as createVercelAttachmentStorage, L as enqueueAgentDispatch, M as parseContent, N as getThreadStopDecision, O as getAuthPausedConversationTurnId, P as renderSlackObjectCard, R as GET$3, S as runWithSlackInstallation, T as stopSlackThread, a as webActorFromEmail, b as clearSlackPendingReactions, c as getProductionSlackAdapter, g as readViewerAutomationSummary, i as recordWebConversationActivity, j as startProcessingReaction, n as conversationTurnIdForMessage, o as createProductionConversationWorkOptions, s as createProductionSlackWebhookServices, t as appendAndEnqueueWebMessage, v as recordSkippedConversationMessage, w as isSlackMessageStopped, y as buildSlackInboundMessage } from "./web-input-
|
|
19
|
-
import { O as recordAutomationExecution, _ as markDispatchFailed, a as confirmDispatchMailboxAppend, d as getPluginDispatchProjection, f as isTerminalDispatchStatus, l as getDispatchRecord, o as createOrGetDispatch, p as listPendingDispatchMailboxAppends, s as getDispatchConversationId } from "./task-runner-
|
|
20
|
-
import { c as listPendingAgentInvocationMailboxAppends, r as enqueueAgentInvocation } from "./work-
|
|
21
|
-
import { s as coerceThreadConversationState } from "./thread-state-
|
|
22
|
-
import { a as GET$4, i as publishAppHomeView, r as GET$5, t as receiveLocalOAuthCredential } from "./credential-sync-
|
|
23
|
-
import { a as registerVercelPluginTaskDevConsumer, n as createVercelPluginTaskCallback, s as queueCallback } from "./task-queue-
|
|
24
|
-
import { t as processConversationWork } from "./worker-
|
|
25
|
-
import { t as bindSpawnAgent } from "./spawn-
|
|
18
|
+
import { A as THREAD_OPTOUT_ACK, C as verifySlackSignature, D as withNormalizedThreadId, E as normalizeIncomingSlackThreadId, F as createVercelAttachmentStorage, L as enqueueAgentDispatch, M as parseContent, N as getThreadStopDecision, O as getAuthPausedConversationTurnId, P as renderSlackObjectCard, R as GET$3, S as runWithSlackInstallation, T as stopSlackThread, a as webActorFromEmail, b as clearSlackPendingReactions, c as getProductionSlackAdapter, g as readViewerAutomationSummary, i as recordWebConversationActivity, j as startProcessingReaction, n as conversationTurnIdForMessage, o as createProductionConversationWorkOptions, s as createProductionSlackWebhookServices, t as appendAndEnqueueWebMessage, v as recordSkippedConversationMessage, w as isSlackMessageStopped, y as buildSlackInboundMessage } from "./web-input-B6FZlrgg.js";
|
|
19
|
+
import { O as recordAutomationExecution, _ as markDispatchFailed, a as confirmDispatchMailboxAppend, d as getPluginDispatchProjection, f as isTerminalDispatchStatus, l as getDispatchRecord, o as createOrGetDispatch, p as listPendingDispatchMailboxAppends, s as getDispatchConversationId } from "./task-runner-uSodiP4v.js";
|
|
20
|
+
import { c as listPendingAgentInvocationMailboxAppends, r as enqueueAgentInvocation } from "./work-Dy8sW9MZ.js";
|
|
21
|
+
import { s as coerceThreadConversationState } from "./thread-state-BurqeqMv.js";
|
|
22
|
+
import { a as GET$4, i as publishAppHomeView, r as GET$5, t as receiveLocalOAuthCredential } from "./credential-sync-OKs419AB.js";
|
|
23
|
+
import { a as registerVercelPluginTaskDevConsumer, n as createVercelPluginTaskCallback, s as queueCallback } from "./task-queue-C2sTDXqQ.js";
|
|
24
|
+
import { t as processConversationWork } from "./worker-BH0RP7Hj.js";
|
|
25
|
+
import { t as bindSpawnAgent } from "./spawn-CS56i7Nm.js";
|
|
26
26
|
import { createRequire } from "node:module";
|
|
27
27
|
import { pathToFileURL } from "node:url";
|
|
28
28
|
import { Hono } from "hono";
|
|
@@ -1843,6 +1843,8 @@ const slackEventSchema = z.looseObject({
|
|
|
1843
1843
|
user: z.string().optional()
|
|
1844
1844
|
});
|
|
1845
1845
|
const slackEventEnvelopeSchema = z.object({
|
|
1846
|
+
event_id: z.unknown().optional(),
|
|
1847
|
+
is_ext_shared_channel: z.unknown().optional(),
|
|
1846
1848
|
enterprise_id: z.string().optional(),
|
|
1847
1849
|
event: slackEventSchema.optional(),
|
|
1848
1850
|
is_enterprise_install: z.boolean().optional(),
|
|
@@ -1980,17 +1982,75 @@ function textMentionsBot(text, botUserId) {
|
|
|
1980
1982
|
}
|
|
1981
1983
|
//#endregion
|
|
1982
1984
|
//#region src/chat/ingress/workspace-membership.ts
|
|
1985
|
+
const MEMBER_TTL_MS = 3e5;
|
|
1986
|
+
const NON_MEMBER_TTL_MS = 3e4;
|
|
1983
1987
|
const authorTeamSchema = z.object({
|
|
1984
1988
|
user_team: z.string().optional(),
|
|
1985
|
-
source_team: z.string().optional()
|
|
1989
|
+
source_team: z.string().optional(),
|
|
1990
|
+
user: z.unknown().optional()
|
|
1986
1991
|
});
|
|
1987
|
-
/** Accept only
|
|
1988
|
-
function isSlackWorkspaceMember(raw) {
|
|
1992
|
+
/** Accept only verified workspace authors, reusing recent membership lookups. */
|
|
1993
|
+
async function isSlackWorkspaceMember(raw, state) {
|
|
1989
1994
|
const workspaceTeamId = getWorkspaceTeamId();
|
|
1990
1995
|
if (!workspaceTeamId) return false;
|
|
1991
1996
|
const parsed = authorTeamSchema.safeParse(raw);
|
|
1992
1997
|
if (!parsed.success) return false;
|
|
1993
|
-
|
|
1998
|
+
const event = parsed.data;
|
|
1999
|
+
const userId = parseSlackUserId(event.user);
|
|
2000
|
+
if (!userId) return false;
|
|
2001
|
+
const key = `slack:membership:${workspaceTeamId}:${userId}`;
|
|
2002
|
+
const authorTeam = parseSlackTeamId(event.user_team);
|
|
2003
|
+
if (authorTeam === workspaceTeamId) return true;
|
|
2004
|
+
if (event.user_team !== void 0 && !authorTeam && !/^E[A-Z0-9]+$/.test(event.user_team)) return false;
|
|
2005
|
+
const explicitlyExternal = authorTeam !== void 0;
|
|
2006
|
+
if (!explicitlyExternal) {
|
|
2007
|
+
const cached = await state.get(key);
|
|
2008
|
+
if (typeof cached === "boolean") return cached;
|
|
2009
|
+
}
|
|
2010
|
+
const result = await withLock$1(state, `${key}:lookup`, async () => {
|
|
2011
|
+
if (explicitlyExternal) {
|
|
2012
|
+
await state.set(key, false, NON_MEMBER_TTL_MS);
|
|
2013
|
+
return false;
|
|
2014
|
+
}
|
|
2015
|
+
const cached = await state.get(key);
|
|
2016
|
+
if (typeof cached === "boolean") return cached;
|
|
2017
|
+
const user = await lookupSlackUserProfile(userId);
|
|
2018
|
+
const authorTeam = parseSlackTeamId(user.team_id);
|
|
2019
|
+
if (user.id !== userId || !authorTeam) return false;
|
|
2020
|
+
const member = authorTeam === workspaceTeamId && !user.is_deleted;
|
|
2021
|
+
await state.set(key, member, member ? MEMBER_TTL_MS : NON_MEMBER_TTL_MS);
|
|
2022
|
+
return member;
|
|
2023
|
+
}, {
|
|
2024
|
+
keepAlive: true,
|
|
2025
|
+
waitMs: 1e4
|
|
2026
|
+
});
|
|
2027
|
+
if (!result.acquired) throw new Error("Could not acquire Slack membership lookup lock");
|
|
2028
|
+
return result.value;
|
|
2029
|
+
}
|
|
2030
|
+
//#endregion
|
|
2031
|
+
//#region src/chat/ingress/slack-message-telemetry.ts
|
|
2032
|
+
function field(value, pattern) {
|
|
2033
|
+
if (value === void 0) return "missing";
|
|
2034
|
+
return typeof value === "string" && value.length <= 64 && pattern.test(value) ? value : "invalid";
|
|
2035
|
+
}
|
|
2036
|
+
/** Record Slack's identity fields separately from the membership decision. */
|
|
2037
|
+
function slackMessageAttributes(body) {
|
|
2038
|
+
const event = body.event;
|
|
2039
|
+
const teamId = /^[TE][A-Z0-9]+$/;
|
|
2040
|
+
return {
|
|
2041
|
+
"messaging.message.id": event?.ts,
|
|
2042
|
+
"app.slack.event_id": field(body.event_id, /^Ev[A-Z0-9]+$/),
|
|
2043
|
+
"app.slack.event_type": field(event?.type, /^[a-z_]+$/),
|
|
2044
|
+
"app.slack.event_subtype": field(event?.subtype, /^[a-z_]+$/),
|
|
2045
|
+
"app.slack.user_id": field(event?.user, /^[UW][A-Z0-9]+$/),
|
|
2046
|
+
"app.slack.bot_id": field(event?.bot_id, /^B[A-Z0-9]+$/),
|
|
2047
|
+
"app.slack.team_id": field(body.team_id, /^T[A-Z0-9]+$/),
|
|
2048
|
+
"app.slack.enterprise_id": field(body.enterprise_id, /^E[A-Z0-9]+$/),
|
|
2049
|
+
"app.slack.user_team": field(event?.user_team, teamId),
|
|
2050
|
+
"app.slack.source_team": field(event?.source_team, teamId),
|
|
2051
|
+
"app.slack.event_team": field(event?.team, teamId),
|
|
2052
|
+
"app.slack.is_ext_shared_channel": typeof body.is_ext_shared_channel === "boolean" ? body.is_ext_shared_channel : body.is_ext_shared_channel === void 0 ? "missing" : "invalid"
|
|
2053
|
+
};
|
|
1994
2054
|
}
|
|
1995
2055
|
//#endregion
|
|
1996
2056
|
//#region src/chat/credentials/unlink-provider.ts
|
|
@@ -2491,7 +2551,9 @@ async function handleSlackEvent(args) {
|
|
|
2491
2551
|
return;
|
|
2492
2552
|
}
|
|
2493
2553
|
if ((event.type === "message" || event.type === "app_mention") && !shouldIgnoreMessageSubtype(event) && event.channel && event.ts) {
|
|
2494
|
-
|
|
2554
|
+
const member = await isSlackWorkspaceMember(event, state);
|
|
2555
|
+
setSpanAttributes({ "app.slack.membership": member ? "verified" : "unverified" });
|
|
2556
|
+
if (!member) return;
|
|
2495
2557
|
const message = adapter.parseMessage(event);
|
|
2496
2558
|
if (!(await withLock$1(state, `slack:ingress:${normalizeMessageThreadId(message).threadId}`, () => routeParsedMessage({
|
|
2497
2559
|
adapter,
|
|
@@ -2630,9 +2692,12 @@ async function handleSlackWebhook(args) {
|
|
|
2630
2692
|
if (shouldPersistBeforeAck(parsed)) {
|
|
2631
2693
|
const failureResponse = await withLogContext(eventLogContext, async () => {
|
|
2632
2694
|
try {
|
|
2633
|
-
await handleSlackEvent({
|
|
2695
|
+
await withSpan("slack.message.ingress", "slack.message.ingress", eventLogContext, () => handleSlackEvent({
|
|
2634
2696
|
body: parsed,
|
|
2635
2697
|
services: args.services
|
|
2698
|
+
}), {
|
|
2699
|
+
...slackMessageAttributes(parsed),
|
|
2700
|
+
"app.slack.membership": "not_checked"
|
|
2636
2701
|
});
|
|
2637
2702
|
} catch (error) {
|
|
2638
2703
|
if (error instanceof SlackEventPersistenceError) logException(error.cause, "slack.event.persist.failed");
|
|
@@ -4870,6 +4935,7 @@ function dashboardHostRoutePaths(dashboard, authenticatedRoutes = []) {
|
|
|
4870
4935
|
...pagePaths,
|
|
4871
4936
|
"/favicon.ico",
|
|
4872
4937
|
"/_junior/dashboard/avatar.png",
|
|
4938
|
+
"/_junior/dashboard/object-icons/*",
|
|
4873
4939
|
"/_junior/dashboard/client.js",
|
|
4874
4940
|
"/_junior/dashboard/icon-512.png",
|
|
4875
4941
|
"/_junior/dashboard/manifest.webmanifest",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { r as completeObject } from "./client-
|
|
1
|
+
import { r as completeObject } from "./client-C6VUBzL_.js";
|
|
2
2
|
import { r as defaultModelId } from "./model-profile-BwU8mqwD.js";
|
|
3
|
-
import { U as parseBriefInput, d as conversationDetailReportSchema, p as conversationEventPageSchema, z as briefCodeChangeSchema } from "./conversation-
|
|
4
|
-
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-
|
|
3
|
+
import { U as parseBriefInput, d as conversationDetailReportSchema, p as conversationEventPageSchema, z as briefCodeChangeSchema } from "./conversation-DOI6Y60M.js";
|
|
4
|
+
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-9C-wUwwx.js";
|
|
5
5
|
import { CLI_USAGE } from "./cli/run.js";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import { z } from "zod";
|
|
@@ -269,7 +269,7 @@ async function parseRunOptions(argv) {
|
|
|
269
269
|
* `DATABASE_URL` at import, and `briefs pull` must work with only a token.
|
|
270
270
|
*/
|
|
271
271
|
async function configuredDefaultModelId() {
|
|
272
|
-
const { botConfig } = await import("./config-
|
|
272
|
+
const { botConfig } = await import("./config-BLPaWN1Q.js").then((n) => n.r);
|
|
273
273
|
return defaultModelId(botConfig);
|
|
274
274
|
}
|
|
275
275
|
function apiUrl(baseUrl, pathname) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { t as createPluginCatalogRuntime } from "./registry-
|
|
2
|
+
import { t as createPluginCatalogRuntime } from "./registry-BUbczT2k.js";
|
|
3
3
|
//#region src/chat/plugins/catalog-runtime.ts
|
|
4
4
|
var catalog_runtime_exports = /* @__PURE__ */ __exportAll({ pluginCatalogRuntime: () => pluginCatalogRuntime });
|
|
5
5
|
const pluginCatalogRuntime = createPluginCatalogRuntime();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { i as completeText, m as escapeXml, o as resolveGatewayModel, p as unwrapCurrentInstruction } from "./client-
|
|
2
|
-
import { d as logException, o as getActiveTraceId, p as logWarn, t as buildTurnFailureResponse, v as setSpanAttributes } from "./logging-
|
|
3
|
-
import { n as botConfig } from "./config-
|
|
1
|
+
import { i as completeText, m as escapeXml, o as resolveGatewayModel, p as unwrapCurrentInstruction } from "./client-C6VUBzL_.js";
|
|
2
|
+
import { d as logException, o as getActiveTraceId, p as logWarn, t as buildTurnFailureResponse, v as setSpanAttributes } from "./logging-Blgn76r3.js";
|
|
3
|
+
import { n as botConfig } from "./config-BLPaWN1Q.js";
|
|
4
4
|
import { b as parseSlackMessageTs, f as toStoredSlackActor } from "./context-0Et9iVSB.js";
|
|
5
|
-
import {
|
|
6
|
-
import { $ as contextProvenance, G as agentHistoryItemSchema, et as instructionActors, tt as instructionProvenanceFor } from "./conversation-
|
|
7
|
-
import { D as fenceLock, O as withLock, T as MUTATION_LOCK_TTL_MS, k as sleep, w as getStateAdapter } from "./profile-
|
|
5
|
+
import { $t as getConversationStore, Jt as authenticationLinkedEvent, Kt as JUNIOR_NATIVE_EVENT_NAMESPACE, Yt as authenticationUnlinkedEvent, Zt as getConversationEventStore, cn as addAgentTurnUsage, nn as createSqlConversationEventStore, on as bindProviderConversation, qt as agentsInstructionsUpdatedEvent, rn as withConversationEventLock, tn as getSqlExecutor } from "./agent-hooks-DUQ3ASdp.js";
|
|
6
|
+
import { $ as contextProvenance, G as agentHistoryItemSchema, et as instructionActors, tt as instructionProvenanceFor } from "./conversation-DOI6Y60M.js";
|
|
7
|
+
import { D as fenceLock, O as withLock, T as MUTATION_LOCK_TTL_MS, k as sleep, w as getStateAdapter } from "./profile-a5xmeUHf.js";
|
|
8
8
|
import { isDeepStrictEqual } from "node:util";
|
|
9
9
|
import { z } from "zod";
|
|
10
10
|
import { createHash } from "node:crypto";
|
package/dist/cli/chat.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as executeAgentRun, t as createAgentRunner } from "../agent-runner-
|
|
1
|
+
import { s as executeAgentRun, t as createAgentRunner } from "../agent-runner-CIesujf5.js";
|
|
2
2
|
import { t as loadAppPluginSet } from "../plugin-module-BKGOXca2.js";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { createHash, randomUUID } from "node:crypto";
|
|
@@ -100,10 +100,10 @@ async function loadLocalPluginSet() {
|
|
|
100
100
|
async function configureLocalChatPlugins(pluginSet) {
|
|
101
101
|
const [pluginsModule, agentHooksModule, catalogRuntimeModule, validationModule, databaseModule] = await Promise.all([
|
|
102
102
|
import("../plugins-egKWjgue.js").then((n) => n.o),
|
|
103
|
-
import("../agent-hooks-
|
|
104
|
-
import("../catalog-runtime-
|
|
105
|
-
import("../validation-
|
|
106
|
-
import("../agent-hooks-
|
|
103
|
+
import("../agent-hooks-DUQ3ASdp.js").then((n) => n.t),
|
|
104
|
+
import("../catalog-runtime-NOBDOyJi.js").then((n) => n.t),
|
|
105
|
+
import("../validation-DZc56dXw.js").then((n) => n.r),
|
|
106
|
+
import("../agent-hooks-DUQ3ASdp.js").then((n) => n.Xt)
|
|
107
107
|
]);
|
|
108
108
|
const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
|
|
109
109
|
const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
|
|
@@ -153,18 +153,18 @@ function localDevServerUrl() {
|
|
|
153
153
|
async function prepareLocalChatRun(io, pluginSet) {
|
|
154
154
|
defaultStateAdapterForLocalChat();
|
|
155
155
|
await configureLocalChatPlugins(pluginSet);
|
|
156
|
-
const { setExperimentalFeatures } = await import("../agent-runner-
|
|
156
|
+
const { setExperimentalFeatures } = await import("../agent-runner-CIesujf5.js").then((n) => n.r);
|
|
157
157
|
setExperimentalFeatures({ subagents: true });
|
|
158
|
-
const { setBriefsConfig } = await import("../agent-hooks-
|
|
158
|
+
const { setBriefsConfig } = await import("../agent-hooks-DUQ3ASdp.js").then((n) => n.m);
|
|
159
159
|
setBriefsConfig({ enabled: true });
|
|
160
|
-
const { runLocalAgentTurn } = await import("../runner-
|
|
161
|
-
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-
|
|
160
|
+
const { runLocalAgentTurn } = await import("../runner-CsnuKcsq.js");
|
|
161
|
+
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-BP7SgTcu.js");
|
|
162
162
|
const { createLocalOAuthState } = await import("../oauth-relay-CdCnu80W.js").then((n) => n.t);
|
|
163
|
-
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-
|
|
164
|
-
const { bindSpawnAgent } = await import("../spawn-
|
|
165
|
-
const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-
|
|
163
|
+
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-D34sI4J6.js");
|
|
164
|
+
const { bindSpawnAgent } = await import("../spawn-CS56i7Nm.js").then((n) => n.n);
|
|
165
|
+
const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-Dy8sW9MZ.js").then((n) => n.a);
|
|
166
166
|
const { createLocalConversationWork } = await import("../conversation-work-C6y3T5Hx.js");
|
|
167
|
-
const { processConversationWork } = await import("../worker-
|
|
167
|
+
const { processConversationWork } = await import("../worker-BH0RP7Hj.js").then((n) => n.n);
|
|
168
168
|
let agentRunner;
|
|
169
169
|
const localConversationWork = createLocalConversationWork(async (message) => {
|
|
170
170
|
if (!agentRunner) throw new Error("Local agent runner is not ready");
|
package/dist/cli/check.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { D as JUNIOR_HEARTBEAT_ROUTE, M as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, T as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-
|
|
2
|
-
import { f as parseInlinePluginManifest, p as parsePluginManifest } from "../registry-
|
|
3
|
-
import { i as parseSkillFile } from "../skills-
|
|
1
|
+
import { D as JUNIOR_HEARTBEAT_ROUTE, M as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, T as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-Blgn76r3.js";
|
|
2
|
+
import { f as parseInlinePluginManifest, p as parsePluginManifest } from "../registry-BUbczT2k.js";
|
|
3
|
+
import { i as parseSkillFile } from "../skills-CLgyYrgF.js";
|
|
4
4
|
import { pathToFileURL } from "node:url";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import fs from "node:fs/promises";
|
package/dist/cli/main.js
CHANGED
|
@@ -25,7 +25,7 @@ async function runChat(argv, pluginSet) {
|
|
|
25
25
|
return await (await import("./chat.js")).runChat(argv, void 0, { pluginSet });
|
|
26
26
|
}
|
|
27
27
|
async function runBriefs(argv) {
|
|
28
|
-
return await (await import("../briefs-
|
|
28
|
+
return await (await import("../briefs-BTrVMqUg.js")).runBriefs(argv);
|
|
29
29
|
}
|
|
30
30
|
function topLevelCommand(argv) {
|
|
31
31
|
return (argv[0] === "--" ? argv.slice(1) : argv)[0];
|
package/dist/cli/plugins.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as pluginCatalogRuntime } from "../catalog-runtime-
|
|
3
|
-
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-
|
|
1
|
+
import { Ct as createPluginLogger, d as setPlugins, en as getDb, f as validatePlugins } from "../agent-hooks-DUQ3ASdp.js";
|
|
2
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime-NOBDOyJi.js";
|
|
3
|
+
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-DZc56dXw.js";
|
|
4
4
|
import { a as pluginRuntimeRegistrationsFromPluginSet, i as pluginCliRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "../plugins-egKWjgue.js";
|
|
5
5
|
import { t as loadAppPluginSet } from "../plugin-module-BKGOXca2.js";
|
|
6
6
|
import { stderr, stdout } from "node:process";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as pluginCatalogRuntime } from "../catalog-runtime-
|
|
2
|
-
import { S as disconnectStateAdapter, t as create } from "../profile-
|
|
3
|
-
import { r as resolve } from "../resolve-
|
|
1
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime-NOBDOyJi.js";
|
|
2
|
+
import { S as disconnectStateAdapter, t as create } from "../profile-a5xmeUHf.js";
|
|
3
|
+
import { r as resolve } from "../resolve-3PhWSiEF.js";
|
|
4
4
|
//#region src/cli/snapshot-create.ts
|
|
5
5
|
const DEFAULT_RUNTIME = "node22";
|
|
6
6
|
const DEFAULT_TIMEOUT_MS = 6e5;
|
package/dist/cli/upgrade.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as getChatConfig } from "../config-
|
|
2
|
-
import { t as createJuniorSqlExecutor } from "../executor-
|
|
3
|
-
import { t as createPluginCatalogRuntime } from "../registry-
|
|
1
|
+
import { a as getChatConfig } from "../config-BLPaWN1Q.js";
|
|
2
|
+
import { t as createJuniorSqlExecutor } from "../executor-DZVZBfmX.js";
|
|
3
|
+
import { t as createPluginCatalogRuntime } from "../registry-BUbczT2k.js";
|
|
4
4
|
import { n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "../plugins-egKWjgue.js";
|
|
5
5
|
import { t as loadAppPluginSet } from "../plugin-module-BKGOXca2.js";
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as logException, g as serializeGenAiAttribute, i as extractGenAiUsageAttributes, m as normalizeGenAiFinishReason, p as logWarn, w as withSpan } from "./logging-
|
|
2
|
-
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-
|
|
1
|
+
import { d as logException, g as serializeGenAiAttribute, i as extractGenAiUsageAttributes, m as normalizeGenAiFinishReason, p as logWarn, w as withSpan } from "./logging-Blgn76r3.js";
|
|
2
|
+
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-DJ88ECSq.js";
|
|
3
3
|
import { calculateCost, completeSimple, getEnvApiKey, getModels, registerApiProvider } from "@earendil-works/pi-ai/compat";
|
|
4
4
|
import { stream as streamAnthropic, streamSimple as streamSimpleAnthropic } from "@earendil-works/pi-ai/api/anthropic-messages";
|
|
5
5
|
import { createGatewayProvider } from "@ai-sdk/gateway";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { o as resolveGatewayModel, w as toOptionalTrimmed } from "./client-
|
|
3
|
-
import { p as logWarn } from "./logging-
|
|
2
|
+
import { o as resolveGatewayModel, w as toOptionalTrimmed } from "./client-C6VUBzL_.js";
|
|
3
|
+
import { p as logWarn } from "./logging-Blgn76r3.js";
|
|
4
4
|
import { l as TURN_REASONING_LEVELS, s as modelProfileSchema, t as DEFAULT_MODEL_PROFILES, u as parseTurnReasoningLevel } from "./model-profile-BwU8mqwD.js";
|
|
5
5
|
//#region src/chat/slack/emoji.ts
|
|
6
6
|
const SLACK_EMOJI_NAME_RE = /^(?:[a-z0-9_+-]+)(?:::(?:skin-tone-[2-6]))?$/;
|