@sentry/junior 0.234.0 → 0.235.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.
Files changed (55) hide show
  1. package/dist/{agent-hooks-BcH6E48y.js → agent-hooks-DS7k0ZWY.js} +17 -10
  2. package/dist/{agent-runner-DUkGlK89.js → agent-runner-BlDI1zV2.js} +150 -64
  3. package/dist/api/schema.d.ts +66 -1
  4. package/dist/api/schema.js +3 -3
  5. package/dist/api.js +138 -54
  6. package/dist/{app-xk2-Id1T.d.ts → app-pGsR__aT.d.ts} +1 -1
  7. package/dist/app.d.ts +1 -1
  8. package/dist/app.js +23 -21
  9. package/dist/{briefs-lyAQbDxJ.js → briefs-C3jhszOz.js} +4 -4
  10. package/dist/{catalog-runtime-BSgsPVnr.js → catalog-runtime-B9u_3-GW.js} +1 -1
  11. package/dist/{checkpoint-BNfXlq_1.js → checkpoint-DLcJ5mKL.js} +6 -6
  12. package/dist/cli/chat.js +13 -13
  13. package/dist/cli/check.js +3 -3
  14. package/dist/cli/main.js +1 -1
  15. package/dist/cli/plugins.js +3 -3
  16. package/dist/cli/snapshot-create.js +3 -3
  17. package/dist/cli/upgrade.js +3 -3
  18. package/dist/{client-BX5lJRqW.js → client-BSnNHO0R.js} +2 -2
  19. package/dist/{config-DuCzUoCo.js → config-Bmw4xTPK.js} +2 -2
  20. package/dist/{conversation-CPjHYOV5.js → conversation-C_aYrISI.js} +1 -0
  21. package/dist/{conversation-privacy-CSxvdSoV.js → conversation-privacy-BV2dtba2.js} +1 -1
  22. package/dist/{credential-sync-BO4DfH9a.js → credential-sync-CukzQJ1x.js} +13 -13
  23. package/dist/{executor--jWf-Nnm.js → executor-B9ksWZCv.js} +33 -1
  24. package/dist/{images-BaL19wFC.js → images-CEXcQ0Id.js} +3 -3
  25. package/dist/instrumentation.js +2 -2
  26. package/dist/{job-queue-cwHVOwVZ.js → job-queue-CY1L2YRn.js} +1 -1
  27. package/dist/{logging-Cox1Mgcv.js → logging-F--48Q7Q.js} +1 -1
  28. package/dist/nitro.d.ts +1 -1
  29. package/dist/nitro.js +3 -3
  30. package/dist/{oauth-authorization-CC8a1JKP.js → oauth-authorization-LasSG3Qc.js} +1 -1
  31. package/dist/{oauth-callback-server-Z7QSt416.js → oauth-callback-server-D07ZzVMs.js} +2 -2
  32. package/dist/{pending-auth-DQhC3eSR.js → pending-auth-DrG9Mkje.js} +1 -1
  33. package/dist/{profile-BdApelHS.js → profile-DZ2DUdd1.js} +4 -4
  34. package/dist/{prompt-3D0sSbTC.js → prompt-BM_5mAU3.js} +1 -1
  35. package/dist/{registry-DiY6B8CN.js → registry-_JLY0x7b.js} +1 -1
  36. package/dist/{resolve-VpJoiDpc.js → resolve-Cuoj3MML.js} +2 -2
  37. package/dist/{runner-BIMegnPE.js → runner-BfelmbMv.js} +9 -9
  38. package/dist/{sandbox-egress-signals-Cbtxe492.js → sandbox-egress-signals-D5QUIO7Z.js} +1 -1
  39. package/dist/{schema-CxwnlTDN.js → schema-CrdDxGbx.js} +24 -2
  40. package/dist/{skills-WttpPJUy.js → skills-DAegjk5Y.js} +2 -2
  41. package/dist/{spawn-DhfMKt4y.js → spawn-DCfV7zGK.js} +2 -2
  42. package/dist/{task-queue-CZqUNJD0.js → task-queue-GcuFtzor.js} +3 -3
  43. package/dist/{task-runner-BZaqoUCT.js → task-runner-B0-P_3aq.js} +9 -9
  44. package/dist/{thread-state-8tXZhu0y.js → thread-state-TezcEhuH.js} +5 -5
  45. package/dist/{turn-failure-response-DFJ9L9NQ.js → turn-failure-response-Drhj_-t4.js} +8 -8
  46. package/dist/{turn-lifecycle-WbpTUQ_r.js → turn-lifecycle-BpIW3zOx.js} +1 -1
  47. package/dist/{turn-session-routing--EhI76rH.js → turn-session-routing-Dg8GDgyc.js} +1 -1
  48. package/dist/{validation-0F9IgG3b.js → validation-DAkYeKDT.js} +1 -1
  49. package/dist/{version-A7-RRBOE.js → version-9CB4Z-J4.js} +1 -1
  50. package/dist/version.js +1 -1
  51. package/dist/{web-authorization-BJggXofy.js → web-authorization-Cu33voNg.js} +6 -6
  52. package/dist/{web-input-B-siN5Dr.js → web-input-B3k0J7WB.js} +22 -22
  53. package/dist/{work-CNc0ejGG.js → work-PmkvcY9l.js} +7 -7
  54. package/dist/{worker-BHbqpUAu.js → worker-COcaq2J6.js} +5 -5
  55. package/package.json +5 -5
package/dist/api.js CHANGED
@@ -1,20 +1,20 @@
1
- import { Dt as cancelHumanFacingPendingMessages, J as editEventAutomation, L as editScheduledAutomation, Lt as getConversation, M as parseSlackThreadId, St as pluginEventCatalog, U as readScheduledAutomation, W as saveScheduledAutomation, X as eventAutomationTriggerAvailable, Y as AutomationEditError, at as saveEventAutomation, b as readStats, bt as getEventCatalog, ct as automationRevision, et as eventAutomationBelongsToUser, k as readLiveAttachment, lt as requireAutomationRevision, nt as getEventAutomation, ot as setEventAutomationStatus, st as AutomationConflictError } from "./agent-runner-DUkGlK89.js";
2
- import { d as logException, p as logWarn } from "./logging-Cox1Mgcv.js";
1
+ import { Dt as cancelHumanFacingPendingMessages, J as editEventAutomation, L as editScheduledAutomation, Lt as getConversation, M as parseSlackThreadId, St as pluginEventCatalog, U as readScheduledAutomation, W as saveScheduledAutomation, X as eventAutomationTriggerAvailable, Y as AutomationEditError, at as saveEventAutomation, bt as getEventCatalog, ct as automationRevision, et as eventAutomationBelongsToUser, g as readStats, k as readLiveAttachment, lt as requireAutomationRevision, nt as getEventAutomation, ot as setEventAutomationStatus, st as AutomationConflictError } from "./agent-runner-BlDI1zV2.js";
2
+ import { d as logException, p as logWarn } from "./logging-F--48Q7Q.js";
3
3
  import { b as parseSlackMessageTs, h as parseSlackTeamId, p as parseSlackChannelId } from "./context-0Et9iVSB.js";
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-BcH6E48y.js";
4
+ import { At as conversationHasParticipantUser, C as WorkspaceValidationError, Dt as conversationArchivedForEmail, Et as conversationArchiveTimes, Ft as readLatestConversationBrief, Gt as listConversationAnnotations, It as readConversationEventPage, Kt as listConversationAnnotationsById, Lt as buildSentryConversationUrl, M as workspaceRepoCheckoutPath, Mt as conversationNotArchivedForUser, Nt as viewerConversationMembership, O as SANDBOX_RUNTIME, Ot as conversationArchivedForUser, Q as findUserByEmail, S as updateWorkspace, Tt as readConversationAccessFromSql, W as getSlackClient, Y as withSlackRetries, _ as deleteWorkspace, b as listWorkspaces, cn as parseSessionSource, en as getConversationStore, et as resolveViewerUser, fn as agentTurnUsageSchema, g as createWorkspace, jt as conversationNotArchivedForEmail, kt as conversationHasParticipantEmail, mn as resolveRootConversationId, nn as getSqlExecutor, on as locationFromRow, pn as hasAgentTurnUsage, tn as getDb, tt as updateViewerDisplayName, u as getPlugins, v as getWorkspace, wt as createPluginLogger, x as listWorkspacesByRepository } from "./agent-hooks-DS7k0ZWY.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--jWf-Nnm.js";
7
- import { D as createConversationBodySchema, M 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, j as readMessageAttachments, m as conversationEventsQuerySchema, o as cancelConversationPendingMessagesResponseSchema, p as conversationEventPageSchema, r as archiveConversationBodySchema, t as acceptedConversationMessageSchema, u as conversationDetailQuerySchema, x as conversationPendingMessagesReportSchema } from "./conversation-CPjHYOV5.js";
8
- import { n as hash, t as create } from "./profile-BdApelHS.js";
9
- import { t as getCachedSnapshot } from "./resolve-VpJoiDpc.js";
10
- import { a as getVercelConversationWorkQueue } from "./job-queue-cwHVOwVZ.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-B9ksWZCv.js";
7
+ import { D as createConversationBodySchema, M 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, j as readMessageAttachments, m as conversationEventsQuerySchema, o as cancelConversationPendingMessagesResponseSchema, p as conversationEventPageSchema, r as archiveConversationBodySchema, t as acceptedConversationMessageSchema, u as conversationDetailQuerySchema, x as conversationPendingMessagesReportSchema } from "./conversation-C_aYrISI.js";
8
+ import { n as hash, t as create } from "./profile-DZ2DUdd1.js";
9
+ import { t as getCachedSnapshot } from "./resolve-Cuoj3MML.js";
10
+ import { a as getVercelConversationWorkQueue } from "./job-queue-CY1L2YRn.js";
11
11
  import { c as ScheduleIntentError, d as getFirstRunAtMs, l as compileScheduleIntent } from "./types-Du-HbEun.js";
12
12
  import { A as automationSummarySchema, B as pluginsSchema, C as automationListSchema, F as pluginOperationalReportFeedSchema, O as automationScheduleIntentSchema, P as healthReportSchema, S as automationListQuerySchema, T as automationRunListSchema, U as skillReportsSchema, V as runtimeInfoReportSchema, _ as automationExecutionListSchema, a as fillUtcHours, c as sumUtcHoursIntoSixHours, d as trailingUtcSixHourWindow, f as utcDayKey, g as automationEventCatalogSchema, h as automationEditSchema, i as fillUtcDays, j as automationUpdateSchema, k as automationSchedulePreviewSchema, l as trailingUtcDayWindow, m as automationEditErrorSchema, n as DAY_MS$1, o as fillUtcSixHours, p as utcHourKey, r as HOUR_MS$1, s as startOfUtcHour, u as trailingUtcHourWindow, w as automationParamsSchema, x as automationLifecycleSchema } from "./web-message-id-CVVCTWUb.js";
13
- import { F as createVercelAttachmentStorage, _ as readViewerAutomations, a as webActorFromEmail, b as clearSlackPendingReactions, c as getProductionSlackAdapter, d as ViewerTaskNotFoundError, f as deleteViewerTask, g as readViewerAutomationSummary, 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-B-siN5Dr.js";
14
- import { A as conversationAggregateColumns, j as conversationRangeColumns, k as conversationActiveDaysColumn } from "./task-runner-BZaqoUCT.js";
15
- import { r as getWebAuthorization } from "./web-authorization-BJggXofy.js";
16
- import { t as decodeInputImages } from "./images-BaL19wFC.js";
17
- import { C as locationParamsSchema, E as activitySixHours$1, M as codePersonReportSchema, P as apiErrorSchema, S as locationDirectoryReportSchema, T as activityHours$1, _ as actorProfileReportSchema, a as workspaceBodySchema, d as createdPersonalTokenSchema, f as personalTokenListSchema, g as actorDirectoryReportSchema, h as revokePersonalTokenResponseSchema, i as deleteWorkspaceResponseSchema, j as codeOverviewReportSchema, l as workspaceSchema, m as personalTokenParamsSchema, n as statsReportSchema, o as workspaceListSchema, s as workspaceParamsSchema, u as createPersonalTokenBodySchema, v as personParamsSchema, w as activityDays$1, x as locationDetailReportSchema, y as personalSpendReportSchema } from "./schema-CxwnlTDN.js";
13
+ import { F as createVercelAttachmentStorage, _ as readViewerAutomations, a as webActorFromEmail, b as clearSlackPendingReactions, c as getProductionSlackAdapter, d as ViewerTaskNotFoundError, f as deleteViewerTask, g as readViewerAutomationSummary, 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-B3k0J7WB.js";
14
+ import { A as conversationAggregateColumns, j as conversationRangeColumns, k as conversationActiveDaysColumn } from "./task-runner-B0-P_3aq.js";
15
+ import { r as getWebAuthorization } from "./web-authorization-Cu33voNg.js";
16
+ import { t as decodeInputImages } from "./images-CEXcQ0Id.js";
17
+ import { C as locationParamsSchema, E as activitySixHours$1, I as apiErrorSchema, M as codePersonReportSchema, N as codeRepositoryParamsSchema, P as codeRepositoryReportSchema, S as locationDirectoryReportSchema, T as activityHours$1, _ as actorProfileReportSchema, a as workspaceBodySchema, d as createdPersonalTokenSchema, f as personalTokenListSchema, g as actorDirectoryReportSchema, h as revokePersonalTokenResponseSchema, i as deleteWorkspaceResponseSchema, j as codeOverviewReportSchema, l as workspaceSchema, m as personalTokenParamsSchema, n as statsReportSchema, o as workspaceListSchema, s as workspaceParamsSchema, u as createPersonalTokenBodySchema, v as personParamsSchema, w as activityDays$1, x as locationDetailReportSchema, y as personalSpendReportSchema } from "./schema-CrdDxGbx.js";
18
18
  import { Hono } from "hono";
19
19
  import path from "node:path";
20
20
  import { z } from "zod";
@@ -997,7 +997,26 @@ function conversationFeedMembershipFilter(status, filter) {
997
997
  participantMatch: conversationHasParticipantEmail(filter.email)
998
998
  }), status === "archived" ? conversationArchivedForEmail(filter.email) : status === "all" ? void 0 : conversationNotArchivedForEmail(filter.email));
999
999
  }
1000
- async function conversationRows(db, limit, status, filter, query, includePrivateBriefs = false) {
1000
+ /**
1001
+ * Keep root conversations linked to one code repository. A code change can
1002
+ * link a child conversation, so linked ids resolve to their root. Private
1003
+ * roots stay visible only to their members.
1004
+ */
1005
+ function conversationCodeRepositoryFilter(repositoryId, viewerUserId) {
1006
+ return and(sql`${juniorConversations.conversationId} IN (
1007
+ SELECT coalesce(linked.root_conversation_id, linked.conversation_id)
1008
+ FROM ${juniorConversations} AS linked
1009
+ WHERE linked.conversation_id IN (
1010
+ SELECT unnest(${juniorCodeChanges.conversationIds})
1011
+ FROM ${juniorCodeChanges}
1012
+ WHERE ${juniorCodeChanges.repositoryId} = ${repositoryId}
1013
+ )
1014
+ )`, or(eq(juniorDestinations.visibility, "public"), viewerUserId ? viewerConversationMembership({
1015
+ actorMatch: eq(juniorIdentities.userId, viewerUserId),
1016
+ participantMatch: conversationHasParticipantUser(viewerUserId)
1017
+ }) : void 0));
1018
+ }
1019
+ async function conversationRows(db, limit, status, filter, query, includePrivateBriefs = false, codeRepository) {
1001
1020
  return db.select({
1002
1021
  conversation: conversationReadColumns(),
1003
1022
  location: juniorDestinations,
@@ -1008,7 +1027,7 @@ async function conversationRows(db, limit, status, filter, query, includePrivate
1008
1027
  identitySubjectId: juniorIdentities.providerSubjectId,
1009
1028
  identityTenantId: juniorIdentities.providerTenantId,
1010
1029
  userDisplayName: juniorUsers.displayName
1011
- }).from(juniorConversations).leftJoin(juniorDestinations, eq(juniorDestinations.id, juniorConversations.destinationId)).leftJoin(juniorIdentities, eq(juniorIdentities.id, juniorConversations.actorIdentityId)).leftJoin(juniorUsers, eq(juniorUsers.id, juniorIdentities.userId)).where(and(isNull(juniorConversations.parentConversationId), conversationFeedMembershipFilter(status, filter), query ? or(sql`strpos(lower(coalesce(${juniorConversations.title}, '')), ${query}) > 0`, sql`exists (
1030
+ }).from(juniorConversations).leftJoin(juniorDestinations, eq(juniorDestinations.id, juniorConversations.destinationId)).leftJoin(juniorIdentities, eq(juniorIdentities.id, juniorConversations.actorIdentityId)).leftJoin(juniorUsers, eq(juniorUsers.id, juniorIdentities.userId)).where(and(isNull(juniorConversations.parentConversationId), conversationFeedMembershipFilter(status, filter), codeRepository ? conversationCodeRepositoryFilter(codeRepository.id, codeRepository.viewerUserId) : void 0, query ? or(sql`strpos(lower(coalesce(${juniorConversations.title}, '')), ${query}) > 0`, sql`exists (
1012
1031
  select 1
1013
1032
  from ${juniorConversationBriefs}
1014
1033
  where ${juniorConversationBriefs.conversationId} = ${juniorConversations.conversationId}
@@ -1092,13 +1111,20 @@ function conversationFeedFilter(options) {
1092
1111
  * Build a bounded dashboard feed. Prefer the viewer user when present; otherwise
1093
1112
  * keep only roots linked to actorEmail before applying the limit. Membership is
1094
1113
  * root-actor ownership or a materialized participant row for that person.
1114
+ *
1115
+ * `codeRepositoryId` replaces membership with every root linked to that
1116
+ * repository's code changes. Private roots appear only for their members, and
1117
+ * per-person archive state does not hide rows.
1095
1118
  */
1096
1119
  async function readConversationFeedFromSql(options = {}) {
1097
1120
  const nowMs = Date.now();
1098
1121
  const db = getDb();
1099
- const filter = conversationFeedFilter(options);
1122
+ const filter = options.codeRepositoryId ? void 0 : conversationFeedFilter(options);
1100
1123
  const query = options.q?.trim().toLowerCase() || void 0;
1101
- const rows = await conversationRows(db, options.limit ?? CONVERSATION_FEED_LIMIT, query ? "all" : options.status ?? "active", filter, query, filter?.kind === "viewer");
1124
+ const rows = await conversationRows(db, options.limit ?? CONVERSATION_FEED_LIMIT, query || options.codeRepositoryId ? "all" : options.status ?? "active", filter, query, filter?.kind === "viewer", options.codeRepositoryId ? {
1125
+ id: options.codeRepositoryId,
1126
+ ...options.viewer ? { viewerUserId: options.viewer.id } : void 0
1127
+ } : void 0);
1102
1128
  const conversations = rows.map((row) => conversationFromRow(row));
1103
1129
  const conversationIds = conversations.map((conversation) => conversation.conversationId);
1104
1130
  const [accessByConversation, archiveTimesByConversation, annotationsByConversation, auxiliaryCostsByRoot, metricsByRoot, participantsByConversation, teamDomainByTeamId, conversationWork, lastUserMessageAtByConversation, activityPreviewByConversation] = await Promise.all([
@@ -1820,10 +1846,11 @@ function createConversationRoutes(options) {
1820
1846
  }
1821
1847
  });
1822
1848
  app.get("/", validateRequest("query", conversationFeedQuerySchema, "Invalid query parameters."), async (context) => {
1823
- const { actorEmail, q, status } = context.req.valid("query");
1849
+ const { actorEmail, codeRepositoryId, q, status } = context.req.valid("query");
1824
1850
  const viewer = context.get("viewer");
1825
1851
  return jsonResponse(conversationFeedSchema, await readConversationFeed({
1826
1852
  ...actorEmail ? { actorEmail } : void 0,
1853
+ ...codeRepositoryId ? { codeRepositoryId } : void 0,
1827
1854
  ...q ? { q } : void 0,
1828
1855
  status,
1829
1856
  ...viewer ? { viewer } : void 0
@@ -1994,17 +2021,18 @@ function ownedByUserSql(conversationIds, userId) {
1994
2021
  WHERE identities.user_id = ${userId}
1995
2022
  )`;
1996
2023
  }
1997
- function ownershipFilter(userId) {
1998
- if (!userId) return void 0;
1999
- return ownedByUserSql(sql`${juniorCodeChanges.conversationIds}`, userId);
2024
+ /** Limit code changes to one person's conversations or one repository. */
2025
+ function changeScopeFilter(args) {
2026
+ return and(args.userId ? ownedByUserSql(sql`${juniorCodeChanges.conversationIds}`, args.userId) : void 0, args.repositoryId ? eq(juniorCodeChanges.repositoryId, args.repositoryId) : void 0);
2000
2027
  }
2028
+ /** Read windowed code summary and activity buckets for an optional scope. */
2001
2029
  async function readCodeWindows(args) {
2002
2030
  const db = getDb();
2003
2031
  const windowEnd = new Date(args.nowMs);
2004
2032
  const windowStart = /* @__PURE__ */ new Date(args.nowMs - WINDOW_DAYS * DAY_MS);
2005
2033
  const activityStart = startOfUtcDay(args.nowMs - 89 * DAY_MS);
2006
2034
  const changes = juniorCodeChanges;
2007
- const ownership = ownershipFilter(args.userId);
2035
+ const scope = changeScopeFilter(args);
2008
2036
  const conversationTreeCost = conversationTreeCostExpr();
2009
2037
  const activityHourEnd = new Date(args.nowMs);
2010
2038
  activityHourEnd.setUTCMinutes(0, 0, 0);
@@ -2020,7 +2048,7 @@ async function readCodeWindows(args) {
2020
2048
  ${changes.state},
2021
2049
  ${changes.conversationIds} AS conversation_ids
2022
2050
  FROM ${changes}
2023
- ${ownership ? sql`WHERE ${ownership}` : sql``}
2051
+ ${scope ? sql`WHERE ${scope}` : sql``}
2024
2052
  ), change_costs AS (
2025
2053
  SELECT
2026
2054
  recent_changes.id,
@@ -2086,18 +2114,18 @@ async function readCodeWindows(args) {
2086
2114
  SELECT ${changes.openedAt} AS event_at, 'created'::text AS kind
2087
2115
  FROM ${changes}
2088
2116
  WHERE ${changes.openedAt} >= ${activityStart}
2089
- ${ownership ? sql`AND ${ownership}` : sql``}
2117
+ ${scope ? sql`AND ${scope}` : sql``}
2090
2118
  UNION ALL
2091
2119
  SELECT ${changes.mergedAt} AS event_at, 'merged'::text AS kind
2092
2120
  FROM ${changes}
2093
2121
  WHERE ${changes.mergedAt} >= ${activityStart}
2094
- ${ownership ? sql`AND ${ownership}` : sql``}
2122
+ ${scope ? sql`AND ${scope}` : sql``}
2095
2123
  UNION ALL
2096
2124
  SELECT ${changes.closedAt} AS event_at, 'closed'::text AS kind
2097
2125
  FROM ${changes}
2098
2126
  WHERE ${changes.state} = 'closed'
2099
2127
  AND ${changes.closedAt} >= ${activityStart}
2100
- ${ownership ? sql`AND ${ownership}` : sql``}
2128
+ ${scope ? sql`AND ${scope}` : sql``}
2101
2129
  ) AS events
2102
2130
  GROUP BY date_trunc('day', event_at AT TIME ZONE 'UTC')
2103
2131
  )
@@ -2127,18 +2155,18 @@ async function readCodeWindows(args) {
2127
2155
  SELECT ${changes.openedAt} AS event_at, 'created'::text AS kind
2128
2156
  FROM ${changes}
2129
2157
  WHERE ${changes.openedAt} >= ${activityHourStart}
2130
- ${ownership ? sql`AND ${ownership}` : sql``}
2158
+ ${scope ? sql`AND ${scope}` : sql``}
2131
2159
  UNION ALL
2132
2160
  SELECT ${changes.mergedAt} AS event_at, 'merged'::text AS kind
2133
2161
  FROM ${changes}
2134
2162
  WHERE ${changes.mergedAt} >= ${activityHourStart}
2135
- ${ownership ? sql`AND ${ownership}` : sql``}
2163
+ ${scope ? sql`AND ${scope}` : sql``}
2136
2164
  UNION ALL
2137
2165
  SELECT ${changes.closedAt} AS event_at, 'closed'::text AS kind
2138
2166
  FROM ${changes}
2139
2167
  WHERE ${changes.state} = 'closed'
2140
2168
  AND ${changes.closedAt} >= ${activityHourStart}
2141
- ${ownership ? sql`AND ${ownership}` : sql``}
2169
+ ${scope ? sql`AND ${scope}` : sql``}
2142
2170
  ) AS events
2143
2171
  GROUP BY date_trunc('hour', event_at AT TIME ZONE 'UTC')
2144
2172
  )
@@ -2183,6 +2211,30 @@ async function readCodeWindows(args) {
2183
2211
  windowStart
2184
2212
  };
2185
2213
  }
2214
+ /** Columns read for one code change report row. */
2215
+ const codeChangeReportColumns = {
2216
+ closedAt: juniorCodeChanges.closedAt,
2217
+ id: juniorCodeChanges.id,
2218
+ mergedAt: juniorCodeChanges.mergedAt,
2219
+ number: juniorCodeChanges.number,
2220
+ openedAt: juniorCodeChanges.openedAt,
2221
+ provider: juniorCodeChanges.provider,
2222
+ repository: juniorCodeRepositories.name,
2223
+ state: juniorCodeChanges.state,
2224
+ title: juniorCodeChanges.title,
2225
+ url: juniorCodeChanges.url
2226
+ };
2227
+ /** Convert one code change row to its report shape. */
2228
+ function codeChangeReport(change) {
2229
+ return {
2230
+ ...change,
2231
+ closedAt: change.closedAt?.toISOString(),
2232
+ mergedAt: change.mergedAt?.toISOString(),
2233
+ openedAt: change.openedAt.toISOString(),
2234
+ title: change.title ?? void 0,
2235
+ url: change.url ?? void 0
2236
+ };
2237
+ }
2186
2238
  /** Read code activity created by Junior across installed code plugins. */
2187
2239
  async function readCodeOverview(nowMs = Date.now()) {
2188
2240
  const db = getDb();
@@ -2248,30 +2300,12 @@ async function readCodeOverview(nowMs = Date.now()) {
2248
2300
  GROUP BY ${repositories.id}
2249
2301
  ORDER BY "merged" DESC, "created" DESC, ${repositories.name} ASC
2250
2302
  LIMIT 25
2251
- `), db.select({
2252
- closedAt: changes.closedAt,
2253
- id: changes.id,
2254
- mergedAt: changes.mergedAt,
2255
- number: changes.number,
2256
- openedAt: changes.openedAt,
2257
- provider: changes.provider,
2258
- repository: repositories.name,
2259
- state: changes.state,
2260
- title: changes.title,
2261
- url: changes.url
2262
- }).from(changes).innerJoin(repositories, eq(changes.repositoryId, repositories.id)).where(or(gte(changes.openedAt, windows.windowStart), gte(changes.mergedAt, windows.windowStart), gte(changes.closedAt, windows.windowStart), eq(changes.state, "open"))).orderBy(desc(changes.updatedAt)).limit(25)]);
2303
+ `), db.select(codeChangeReportColumns).from(changes).innerJoin(repositories, eq(changes.repositoryId, repositories.id)).where(or(gte(changes.openedAt, windows.windowStart), gte(changes.mergedAt, windows.windowStart), gte(changes.closedAt, windows.windowStart), eq(changes.state, "open"))).orderBy(desc(changes.updatedAt)).limit(25)]);
2263
2304
  return codeOverviewReportSchema.parse({
2264
2305
  activityDays: windows.activityDays,
2265
2306
  activityHours: windows.activityHours,
2266
2307
  activitySixHours: windows.activitySixHours,
2267
- changes: recentChanges.map((change) => ({
2268
- ...change,
2269
- closedAt: change.closedAt?.toISOString(),
2270
- mergedAt: change.mergedAt?.toISOString(),
2271
- openedAt: change.openedAt.toISOString(),
2272
- title: change.title ?? void 0,
2273
- url: change.url ?? void 0
2274
- })),
2308
+ changes: recentChanges.map(codeChangeReport),
2275
2309
  generatedAt: windows.windowEnd.toISOString(),
2276
2310
  repositories: z.array(repositoryRowSchema).parse(queryRows(repositoryResult)).map((repository) => ({
2277
2311
  ...repository,
@@ -2303,11 +2337,61 @@ async function readPersonCodeOverview(args) {
2303
2337
  });
2304
2338
  }
2305
2339
  //#endregion
2340
+ //#region src/api/code/repository.ts
2341
+ /** Most recent code changes listed on one repository page. */
2342
+ const REPOSITORY_CHANGE_LIMIT = 100;
2343
+ /**
2344
+ * Read code activity for one repository: windowed summary, activity buckets,
2345
+ * recent code changes, and the Workspaces that include it.
2346
+ */
2347
+ async function readCodeRepository(repositoryId, nowMs = Date.now()) {
2348
+ const db = getDb();
2349
+ const [repository] = await db.select({
2350
+ id: juniorCodeRepositories.id,
2351
+ name: juniorCodeRepositories.name,
2352
+ provider: juniorCodeRepositories.provider,
2353
+ url: juniorCodeRepositories.url
2354
+ }).from(juniorCodeRepositories).where(eq(juniorCodeRepositories.id, repositoryId)).limit(1);
2355
+ if (!repository) return void 0;
2356
+ const [windows, changes, workspaces] = await Promise.all([
2357
+ readCodeWindows({
2358
+ nowMs,
2359
+ repositoryId
2360
+ }),
2361
+ db.select(codeChangeReportColumns).from(juniorCodeChanges).innerJoin(juniorCodeRepositories, eq(juniorCodeChanges.repositoryId, juniorCodeRepositories.id)).where(eq(juniorCodeChanges.repositoryId, repositoryId)).orderBy(desc(juniorCodeChanges.updatedAt)).limit(REPOSITORY_CHANGE_LIMIT),
2362
+ listWorkspacesByRepository(db, {
2363
+ provider: repository.provider,
2364
+ repo: repository.name
2365
+ })
2366
+ ]);
2367
+ return codeRepositoryReportSchema.parse({
2368
+ activityDays: windows.activityDays,
2369
+ activityHours: windows.activityHours,
2370
+ activitySixHours: windows.activitySixHours,
2371
+ changes: changes.map(codeChangeReport),
2372
+ generatedAt: windows.windowEnd.toISOString(),
2373
+ repository: {
2374
+ ...repository,
2375
+ url: repository.url ?? void 0
2376
+ },
2377
+ summary: windows.summary,
2378
+ windowEnd: windows.windowEnd.toISOString(),
2379
+ windowStart: windows.windowStart.toISOString(),
2380
+ workspaces
2381
+ });
2382
+ }
2383
+ //#endregion
2306
2384
  //#region src/api/code/routes.ts
2307
2385
  /** Create the code analytics API. */
2308
2386
  function createCodeRoutes() {
2309
2387
  const app = new Hono();
2310
2388
  app.get("/", async () => jsonResponse(codeOverviewReportSchema, await readCodeOverview()));
2389
+ app.get("/repositories/:repositoryId", validateRequest("param", codeRepositoryParamsSchema, "Invalid route parameters."), async (context) => {
2390
+ const { repositoryId } = context.req.valid("param");
2391
+ const report = await readCodeRepository(repositoryId);
2392
+ if (!report) throwApiError(404, "Repository not found.");
2393
+ return jsonResponse(codeRepositoryReportSchema, report);
2394
+ });
2311
2395
  return app;
2312
2396
  }
2313
2397
  //#endregion
@@ -3060,7 +3144,7 @@ async function readPeoplePluginReports(args) {
3060
3144
  reports: [],
3061
3145
  source: "plugins"
3062
3146
  });
3063
- const { getPluginProfileReports } = await import("./agent-hooks-BcH6E48y.js").then((n) => n.t);
3147
+ const { getPluginProfileReports } = await import("./agent-hooks-DS7k0ZWY.js").then((n) => n.t);
3064
3148
  return pluginOperationalReportFeedSchema.parse({
3065
3149
  generatedAt: new Date(nowMs).toISOString(),
3066
3150
  reports: await getPluginProfileReports({
@@ -3879,7 +3963,7 @@ function readDescriptionText(home) {
3879
3963
  }
3880
3964
  /** Read discovered skill names for authenticated runtime diagnostics. */
3881
3965
  async function readSkillReports() {
3882
- const { discoverSkills } = await import("./skills-WttpPJUy.js").then((n) => n.o);
3966
+ const { discoverSkills } = await import("./skills-DAegjk5Y.js").then((n) => n.o);
3883
3967
  const skills = await discoverSkills();
3884
3968
  return skillReportsSchema.parse(skills.map((skill) => ({
3885
3969
  name: skill.name,
@@ -3888,7 +3972,7 @@ async function readSkillReports() {
3888
3972
  }
3889
3973
  /** Read safe configured plugin metadata for authenticated runtime diagnostics. */
3890
3974
  async function readPlugins() {
3891
- const { pluginCatalogRuntime } = await import("./catalog-runtime-BSgsPVnr.js").then((n) => n.t);
3975
+ const { pluginCatalogRuntime } = await import("./catalog-runtime-B9u_3-GW.js").then((n) => n.t);
3892
3976
  return pluginsSchema.parse(pluginCatalogRuntime.getProviders().map((plugin) => ({
3893
3977
  configKeys: plugin.manifest.configKeys ?? [],
3894
3978
  description: plugin.manifest.description,
@@ -3900,7 +3984,7 @@ async function readPlugins() {
3900
3984
  async function readRuntimeInfoReport() {
3901
3985
  const [{ homeDir }, { pluginCatalogRuntime }, plugins, skills] = await Promise.all([
3902
3986
  import("./package-discovery-7a9YqLhE.js").then((n) => n.r),
3903
- import("./catalog-runtime-BSgsPVnr.js").then((n) => n.t),
3987
+ import("./catalog-runtime-B9u_3-GW.js").then((n) => n.t),
3904
3988
  readPlugins(),
3905
3989
  readSkillReports()
3906
3990
  ]);
@@ -3917,7 +4001,7 @@ async function readRuntimeInfoReport() {
3917
4001
  /** Read sanitized operational summaries contributed by plugins. */
3918
4002
  async function readPluginOperationalReportFeed() {
3919
4003
  const nowMs = Date.now();
3920
- const { getPluginOperationalReports } = await import("./agent-hooks-BcH6E48y.js").then((n) => n.t);
4004
+ const { getPluginOperationalReports } = await import("./agent-hooks-DS7k0ZWY.js").then((n) => n.t);
3921
4005
  return pluginOperationalReportFeedSchema.parse({
3922
4006
  source: "plugins",
3923
4007
  generatedAt: new Date(nowMs).toISOString(),
@@ -54,7 +54,7 @@ interface BotModelConfig {
54
54
  * Add new keys here as features graduate from private experiments; remove them
55
55
  * once they become stable defaults.
56
56
  */
57
- declare const EXPERIMENTAL_FEATURES: readonly ["passive-routing", "subagents"];
57
+ declare const EXPERIMENTAL_FEATURES: readonly ["operator-tools", "passive-routing", "subagents"];
58
58
  /** One known experimental feature name. */
59
59
  type ExperimentalFeature = (typeof EXPERIMENTAL_FEATURES)[number];
60
60
  /** App-level opt-ins for unstable product features. */
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-xk2-Id1T.js";
1
+ import { i as ModelProfileInput, n as JuniorDashboardOptions, r as createApp, t as JuniorAppOptions } from "./app-pGsR__aT.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,29 +1,29 @@
1
- import { A as requestAttachmentDeletion, At as clearExpiredConversationLease, B as listScheduledAutomations, Bt as listActiveConversationIds, C as readPublicArtifact, Dn as createUserTokenStore, En as slackExternalRefIdSchema, Fn as setConfigDefaults, G as saveScheduledAutomationInLock, It as ensureConversationWake, Jt as stopConversationWork, K as scheduledRunId, Kt as requestConversationWork, Lt as getConversation, M as parseSlackThreadId, O as collectAttachmentGarbage, Pn as getConfigDefaults, Q as collectEventAutomationMatchKeys, Qt as hasRunnableConversationWork$1, R as logScheduledAutomationRunSkipped, Rt as getConversationWorkState, S as publicArtifactHeaders, T as lookupSlackUserProfile, Tn as slackEntitySchema, Tt as appendAndEnqueueInboundMessage, U as readScheduledAutomation, V as listScheduledAutomationsForTeam, Wt as removeActiveConversation, Xt as CONVERSATION_WORK_STALE_ENQUEUE_MS, Z as effectiveTaskOutcomes, _t as ingestEvent, a as isExperimentalFeatureEnabled, an as normalizeSandboxEgressTracePropagationDomains, bt as getEventCatalog, cn as clearSandboxEgressSignals, dn as parseSandboxEgressCredentialToken, en as isInvalidConversationRecordError, f as deleteMcpAuthSessionsForUserProvider, gn as startOAuthFlow, gt as processWorkspaceSnapshotJob, i as getExperimentalFeatures, in as resolveSandboxEgressProviderForHost, l as executeCredentialedEgressRequest, ln as consumeSandboxEgressAuthRequiredSignal, m as deleteMcpStoredOAuthCredentials, o as setExperimentalFeatures, on as shouldPropagateSandboxEgressTrace, p as deleteMcpServerSessionId, pn as formatProviderLabel, q as withScheduledAutomationLock, s as executeAgentRun, sn as SANDBOX_EGRESS_PROXY_PATH, t as createAgentRunner, tn as renderTaskInput, tt as findMatchingEventAutomations, un as consumeSandboxEgressPermissionDeniedSignal, w as unpublishedArtifactHeaders, xt as eventGuidance, z as scheduledAutomationRunAttributes, zt as hasRunnableConversationWork } from "./agent-runner-DUkGlK89.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-Cox1Mgcv.js";
1
+ import { A as requestAttachmentDeletion, At as clearExpiredConversationLease, B as listScheduledAutomations, Bt as listActiveConversationIds, C as isExperimentalFeatureEnabled, Dn as createUserTokenStore, En as slackExternalRefIdSchema, Fn as setConfigDefaults, G as saveScheduledAutomationInLock, It as ensureConversationWake, Jt as stopConversationWork, K as scheduledRunId, Kt as requestConversationWork, Lt as getConversation, M as parseSlackThreadId, O as collectAttachmentGarbage, Pn as getConfigDefaults, Q as collectEventAutomationMatchKeys, Qt as hasRunnableConversationWork$1, R as logScheduledAutomationRunSkipped, Rt as getConversationWorkState, S as getExperimentalFeatures, T as lookupSlackUserProfile, Tn as slackEntitySchema, Tt as appendAndEnqueueInboundMessage, U as readScheduledAutomation, V as listScheduledAutomationsForTeam, Wt as removeActiveConversation, Xt as CONVERSATION_WORK_STALE_ENQUEUE_MS, Z as effectiveTaskOutcomes, _t as ingestEvent, a as executeCredentialedEgressRequest, an as normalizeSandboxEgressTracePropagationDomains, b as unpublishedArtifactHeaders, bt as getEventCatalog, c as deleteMcpAuthSessionsForUserProvider, cn as clearSandboxEgressSignals, dn as parseSandboxEgressCredentialToken, en as isInvalidConversationRecordError, gn as startOAuthFlow, gt as processWorkspaceSnapshotJob, in as resolveSandboxEgressProviderForHost, l as deleteMcpServerSessionId, ln as consumeSandboxEgressAuthRequiredSignal, on as shouldPropagateSandboxEgressTrace, pn as formatProviderLabel, q as withScheduledAutomationLock, r as executeAgentRun, sn as SANDBOX_EGRESS_PROXY_PATH, t as createAgentRunner, tn as renderTaskInput, tt as findMatchingEventAutomations, u as deleteMcpStoredOAuthCredentials, un as consumeSandboxEgressPermissionDeniedSignal, v as publicArtifactHeaders, w as setExperimentalFeatures, xt as eventGuidance, y as readPublicArtifact, z as scheduledAutomationRunAttributes, zt as hasRunnableConversationWork } from "./agent-runner-BlDI1zV2.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-F--48Q7Q.js";
3
3
  import { r as continueTrace } from "./sentry-CgWZM_kV.js";
4
- import { t as JUNIOR_VERSION } from "./version-A7-RRBOE.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-DuCzUoCo.js";
4
+ import { t as JUNIOR_VERSION } from "./version-9CB4Z-J4.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-Bmw4xTPK.js";
6
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-BcH6E48y.js";
7
+ import { $ as readActorIdentity, F as bindScheduledAutomationCredentialSubject, Gt as listConversationAnnotations, Ht as resolveRootVisibility, I as bindSlackDirectCredentialSubject, K as isDmChannel, L as verifyEventAutomationCredentialSubject, P as bindEventAutomationCredentialSubject, Qt as getConversationEventStore, R as verifyScheduledAutomationCredentialSubject, Tt as readConversationAccessFromSql, W as getSlackClient, X as getWorkspaceTeamId, Z as runWithWorkspaceTeamId, _t as getDashboardConversationLink, a as getPluginRoutes, an as withConversationMutationLock, bt as setDashboardConversationLinkOptions, d as setPlugins, en as getConversationStore, f as validatePlugins, h as setBriefsConfig, hn as deleteProviderIdentityForSlackUser, ht as takeDueTimerWatches, i as getPluginApiRoutes, in as withConversationEventLock, lt as collectEventMatchKeys, nn as getSqlExecutor, pt as findMatchingWatches, st as cancelSubscriptions, tn as getDb, u as getPlugins, wt as createPluginLogger, xt as createPluginState, yt as getDashboardTaskLink, z as verifySlackDirectCredentialSubject } from "./agent-hooks-DS7k0ZWY.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--jWf-Nnm.js";
10
- import { z as annotationCard } from "./conversation-CPjHYOV5.js";
11
- import { n as pluginCatalogRuntime } from "./catalog-runtime-BSgsPVnr.js";
12
- import { X as projectConversationMessages, q as appendConversationMessages } from "./checkpoint-BNfXlq_1.js";
13
- import { O as withLock$1, w as getStateAdapter } from "./profile-BdApelHS.js";
14
- import { f as setSandboxResourceConfig, u as getSandboxResourceConfig } from "./resolve-VpJoiDpc.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-cwHVOwVZ.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-B9ksWZCv.js";
10
+ import { z as annotationCard } from "./conversation-C_aYrISI.js";
11
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-B9u_3-GW.js";
12
+ import { X as projectConversationMessages, q as appendConversationMessages } from "./checkpoint-DLcJ5mKL.js";
13
+ import { O as withLock$1, w as getStateAdapter } from "./profile-DZ2DUdd1.js";
14
+ import { f as setSandboxResourceConfig, u as getSandboxResourceConfig } from "./resolve-Cuoj3MML.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-CY1L2YRn.js";
16
16
  import { f as getNextRunAtMs, r as scheduledRunSchema } from "./types-Du-HbEun.js";
17
- import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-0F9IgG3b.js";
17
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-DAkYeKDT.js";
18
18
  import { a as pluginRuntimeRegistrationsFromPluginSet, n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "./plugins-egKWjgue.js";
19
- 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-B-siN5Dr.js";
20
- 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-BZaqoUCT.js";
21
- import { c as listPendingAgentInvocationMailboxAppends, r as enqueueAgentInvocation } from "./work-CNc0ejGG.js";
22
- import { s as coerceThreadConversationState } from "./thread-state-8tXZhu0y.js";
23
- import { a as GET$4, i as publishAppHomeView, r as GET$5, t as receiveLocalOAuthCredential } from "./credential-sync-BO4DfH9a.js";
24
- import { a as registerVercelPluginTaskDevConsumer, n as createVercelPluginTaskCallback, s as queueCallback } from "./task-queue-CZqUNJD0.js";
25
- import { t as processConversationWork } from "./worker-BHbqpUAu.js";
26
- import { t as bindSpawnAgent } from "./spawn-DhfMKt4y.js";
19
+ 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-B3k0J7WB.js";
20
+ 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-B0-P_3aq.js";
21
+ import { c as listPendingAgentInvocationMailboxAppends, r as enqueueAgentInvocation } from "./work-PmkvcY9l.js";
22
+ import { s as coerceThreadConversationState } from "./thread-state-TezcEhuH.js";
23
+ import { a as GET$4, i as publishAppHomeView, r as GET$5, t as receiveLocalOAuthCredential } from "./credential-sync-CukzQJ1x.js";
24
+ import { a as registerVercelPluginTaskDevConsumer, n as createVercelPluginTaskCallback, s as queueCallback } from "./task-queue-GcuFtzor.js";
25
+ import { t as processConversationWork } from "./worker-COcaq2J6.js";
26
+ import { t as bindSpawnAgent } from "./spawn-DCfV7zGK.js";
27
27
  import { createRequire } from "node:module";
28
28
  import { pathToFileURL } from "node:url";
29
29
  import { Hono } from "hono";
@@ -4920,6 +4920,7 @@ function dashboardHostRoutePaths(dashboard, authenticatedRoutes = []) {
4920
4920
  const pagePaths = [
4921
4921
  basePath,
4922
4922
  pagePath("code"),
4923
+ `${pagePath("code")}/*`,
4923
4924
  conversationsPath,
4924
4925
  `${conversationsPath}/*`,
4925
4926
  pagePath("locations"),
@@ -4962,6 +4963,7 @@ function dashboardHostRoutePaths(dashboard, authenticatedRoutes = []) {
4962
4963
  "/api/automations/*",
4963
4964
  "/api/skills",
4964
4965
  "/api/code",
4966
+ "/api/code/*",
4965
4967
  "/api/stats",
4966
4968
  "/api/conversations",
4967
4969
  "/api/conversations/*",
@@ -1,7 +1,7 @@
1
- import { r as completeObject } from "./client-BX5lJRqW.js";
1
+ import { r as completeObject } from "./client-BSnNHO0R.js";
2
2
  import { r as defaultModelId } from "./model-profile-BwU8mqwD.js";
3
- import { P as briefCodeChangeSchema, R as parseBriefInput, d as conversationDetailReportSchema, p as conversationEventPageSchema } from "./conversation-CPjHYOV5.js";
4
- import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-3D0sSbTC.js";
3
+ import { P as briefCodeChangeSchema, R as parseBriefInput, d as conversationDetailReportSchema, p as conversationEventPageSchema } from "./conversation-C_aYrISI.js";
4
+ import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-BM_5mAU3.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-DuCzUoCo.js").then((n) => n.r);
272
+ const { botConfig } = await import("./config-Bmw4xTPK.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-DiY6B8CN.js";
2
+ import { t as createPluginCatalogRuntime } from "./registry-_JLY0x7b.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 { d as unwrapCurrentInstruction, f as escapeXml, i as completeText, o as resolveGatewayModel } from "./client-BX5lJRqW.js";
2
- import { d as logException, o as getActiveTraceId, p as logWarn, t as buildTurnFailureResponse, v as setSpanAttributes } from "./logging-Cox1Mgcv.js";
3
- import { n as botConfig } from "./config-DuCzUoCo.js";
1
+ import { d as unwrapCurrentInstruction, f as escapeXml, i as completeText, o as resolveGatewayModel } from "./client-BSnNHO0R.js";
2
+ import { d as logException, o as getActiveTraceId, p as logWarn, t as buildTurnFailureResponse, v as setSpanAttributes } from "./logging-F--48Q7Q.js";
3
+ import { n as botConfig } from "./config-Bmw4xTPK.js";
4
4
  import { b as parseSlackMessageTs, f as toStoredSlackActor } from "./context-0Et9iVSB.js";
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-BcH6E48y.js";
6
- import { B as messageCardRef, K as agentHistoryItemSchema, et as contextProvenance, nt as instructionProvenanceFor, tt as instructionActors } from "./conversation-CPjHYOV5.js";
7
- import { D as fenceLock, O as withLock, T as MUTATION_LOCK_TTL_MS, k as sleep, w as getStateAdapter } from "./profile-BdApelHS.js";
5
+ import { Jt as agentsInstructionsUpdatedEvent, Qt as getConversationEventStore, Xt as authenticationUnlinkedEvent, Yt as authenticationLinkedEvent, en as getConversationStore, in as withConversationEventLock, ln as addAgentTurnUsage, nn as getSqlExecutor, qt as JUNIOR_NATIVE_EVENT_NAMESPACE, rn as createSqlConversationEventStore, sn as bindProviderConversation } from "./agent-hooks-DS7k0ZWY.js";
6
+ import { B as messageCardRef, K as agentHistoryItemSchema, et as contextProvenance, nt as instructionProvenanceFor, tt as instructionActors } from "./conversation-C_aYrISI.js";
7
+ import { D as fenceLock, O as withLock, T as MUTATION_LOCK_TTL_MS, k as sleep, w as getStateAdapter } from "./profile-DZ2DUdd1.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-DUkGlK89.js";
1
+ import { r as executeAgentRun, t as createAgentRunner } from "../agent-runner-BlDI1zV2.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-BcH6E48y.js").then((n) => n.t),
104
- import("../catalog-runtime-BSgsPVnr.js").then((n) => n.t),
105
- import("../validation-0F9IgG3b.js").then((n) => n.r),
106
- import("../agent-hooks-BcH6E48y.js").then((n) => n.Xt)
103
+ import("../agent-hooks-DS7k0ZWY.js").then((n) => n.t),
104
+ import("../catalog-runtime-B9u_3-GW.js").then((n) => n.t),
105
+ import("../validation-DAkYeKDT.js").then((n) => n.r),
106
+ import("../agent-hooks-DS7k0ZWY.js").then((n) => n.Zt)
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-DUkGlK89.js").then((n) => n.r);
156
+ const { setExperimentalFeatures } = await import("../agent-runner-BlDI1zV2.js").then((n) => n.x);
157
157
  setExperimentalFeatures({ subagents: true });
158
- const { setBriefsConfig } = await import("../agent-hooks-BcH6E48y.js").then((n) => n.m);
158
+ const { setBriefsConfig } = await import("../agent-hooks-DS7k0ZWY.js").then((n) => n.m);
159
159
  setBriefsConfig({ enabled: true });
160
- const { runLocalAgentTurn } = await import("../runner-BIMegnPE.js");
161
- const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-Z7QSt416.js");
160
+ const { runLocalAgentTurn } = await import("../runner-BfelmbMv.js");
161
+ const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-D07ZzVMs.js");
162
162
  const { createLocalOAuthState } = await import("../oauth-relay-CdCnu80W.js").then((n) => n.t);
163
- const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-Cbtxe492.js");
164
- const { bindSpawnAgent } = await import("../spawn-DhfMKt4y.js").then((n) => n.n);
165
- const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-CNc0ejGG.js").then((n) => n.a);
163
+ const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-D5QUIO7Z.js");
164
+ const { bindSpawnAgent } = await import("../spawn-DCfV7zGK.js").then((n) => n.n);
165
+ const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-PmkvcY9l.js").then((n) => n.a);
166
166
  const { createLocalConversationWork } = await import("../conversation-work-C6y3T5Hx.js");
167
- const { processConversationWork } = await import("../worker-BHbqpUAu.js").then((n) => n.n);
167
+ const { processConversationWork } = await import("../worker-COcaq2J6.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-Cox1Mgcv.js";
2
- import { f as parseInlinePluginManifest, p as parsePluginManifest } from "../registry-DiY6B8CN.js";
3
- import { i as parseSkillFile } from "../skills-WttpPJUy.js";
1
+ import { D as JUNIOR_HEARTBEAT_ROUTE, M as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, T as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-F--48Q7Q.js";
2
+ import { f as parseInlinePluginManifest, p as parsePluginManifest } from "../registry-_JLY0x7b.js";
3
+ import { i as parseSkillFile } from "../skills-DAegjk5Y.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-lyAQbDxJ.js")).runBriefs(argv);
28
+ return await (await import("../briefs-C3jhszOz.js")).runBriefs(argv);
29
29
  }
30
30
  function topLevelCommand(argv) {
31
31
  return (argv[0] === "--" ? argv.slice(1) : argv)[0];
@@ -1,6 +1,6 @@
1
- import { Ct as createPluginLogger, d as setPlugins, en as getDb, f as validatePlugins } from "../agent-hooks-BcH6E48y.js";
2
- import { n as pluginCatalogRuntime } from "../catalog-runtime-BSgsPVnr.js";
3
- import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-0F9IgG3b.js";
1
+ import { d as setPlugins, f as validatePlugins, tn as getDb, wt as createPluginLogger } from "../agent-hooks-DS7k0ZWY.js";
2
+ import { n as pluginCatalogRuntime } from "../catalog-runtime-B9u_3-GW.js";
3
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-DAkYeKDT.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-BSgsPVnr.js";
2
- import { S as disconnectStateAdapter, t as create } from "../profile-BdApelHS.js";
3
- import { r as resolve } from "../resolve-VpJoiDpc.js";
1
+ import { n as pluginCatalogRuntime } from "../catalog-runtime-B9u_3-GW.js";
2
+ import { S as disconnectStateAdapter, t as create } from "../profile-DZ2DUdd1.js";
3
+ import { r as resolve } from "../resolve-Cuoj3MML.js";
4
4
  //#region src/cli/snapshot-create.ts
5
5
  const DEFAULT_RUNTIME = "node22";
6
6
  const DEFAULT_TIMEOUT_MS = 6e5;