@sentry/junior 0.237.0 → 0.238.1

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 (70) hide show
  1. package/dist/{context-0Et9iVSB.js → actor-BTtLaeWy.js} +1 -96
  2. package/dist/admin-leAJ2k0P.js +33 -0
  3. package/dist/{agent-hooks-otHGbhBx.js → agent-hooks-p3UA9FI1.js} +1423 -2973
  4. package/dist/{agent-runner-DMAsnPb9.js → agent-runner-DjQSEVuD.js} +171 -139
  5. package/dist/api/schema.d.ts +4 -0
  6. package/dist/api/schema.js +3 -2
  7. package/dist/api.d.ts +1 -1
  8. package/dist/api.js +31 -24
  9. package/dist/{app-MEd7wbF0.d.ts → app-FB2hmHpZ.d.ts} +1 -1
  10. package/dist/app.d.ts +1 -1
  11. package/dist/app.js +26 -22
  12. package/dist/{briefs-DDA1ugXk.js → briefs-mzUaJkBX.js} +4 -4
  13. package/dist/{catalog-runtime-DlXuhrmk.js → catalog-runtime-xq-njrMs.js} +1 -1
  14. package/dist/{checkpoint-BlIIiHG5.js → checkpoint-C37Xgtj-.js} +19 -10
  15. package/dist/cli/chat.js +13 -13
  16. package/dist/cli/check.js +3 -3
  17. package/dist/cli/main.js +6 -2
  18. package/dist/cli/plugins.js +5 -3
  19. package/dist/cli/run.d.ts +2 -1
  20. package/dist/cli/run.js +2 -1
  21. package/dist/cli/snapshot-create.js +3 -3
  22. package/dist/cli/upgrade.d.ts +1 -1
  23. package/dist/cli/upgrade.js +3 -3
  24. package/dist/{client-CPMbTmJU.js → client-BZdqKg6S.js} +2 -2
  25. package/dist/{config-CxpPG6nR.js → config-CGK_VplU.js} +2 -2
  26. package/dist/{conversation-9Fxa1Zbq.js → conversation-DwD-vquD.js} +3 -517
  27. package/dist/{conversation-privacy-Dbkdvozu.js → conversation-privacy-Ci3QLNOb.js} +1 -1
  28. package/dist/{credential-sync-D9yGg3q5.js → credential-sync-BBeYpK4k.js} +15 -14
  29. package/dist/{db-Ca9Nt5ci.d.ts → db-CWZP77Ex.d.ts} +1 -1
  30. package/dist/{executor-BNxfDS1V.js → executor-DmIad4GI.js} +4 -2
  31. package/dist/experimental-Qn9rKLgx.js +50 -0
  32. package/dist/history-BLTUgFYO.js +518 -0
  33. package/dist/{images-D6Y3FJDQ.js → images-1xUjTHGf.js} +3 -3
  34. package/dist/instrumentation.js +2 -2
  35. package/dist/{job-queue-Dq5_zt_l.js → job-queue-CXpx6KfD.js} +1 -1
  36. package/dist/{logging-rB_ngE_R.js → logging-Bne7JUXI.js} +1 -1
  37. package/dist/nitro.d.ts +1 -1
  38. package/dist/nitro.js +3 -3
  39. package/dist/{oauth-authorization-5T1S1v_1.js → oauth-authorization-O8N3knp9.js} +1 -1
  40. package/dist/{oauth-callback-server-Csw7RssK.js → oauth-callback-server-Cb-HPZPS.js} +2 -2
  41. package/dist/pending-auth-C6w4Gwve.js +433 -0
  42. package/dist/{profile-D6apIG2N.js → profile-DIcHBAxe.js} +5 -7
  43. package/dist/{prompt-Ctwy6hSI.js → prompt-CMU-B4FA.js} +1 -1
  44. package/dist/{registry-zfTzTHe6.js → registry-VSrEYeaD.js} +111 -3
  45. package/dist/{resolve-sJtTzuBO.js → resolve-BkpWmZgN.js} +2 -2
  46. package/dist/{runner-DkCk8cbc.js → runner-52ezCnZF.js} +10 -10
  47. package/dist/{sandbox-egress-signals-tSQ8OEcw.js → sandbox-egress-signals-Cmhf3P6Y.js} +1 -1
  48. package/dist/{schema-C5bgOpRg.js → schema-CxWAN2zq.js} +1 -1
  49. package/dist/{skills-BVpr_Gnv.js → skills-PHvy-ZgH.js} +2 -2
  50. package/dist/{spawn-CJhmyE4E.js → spawn-CY34_HCm.js} +2 -2
  51. package/dist/{store-DoewL5mG.d.ts → store-BxxbxBlm.d.ts} +7 -0
  52. package/dist/{task-queue-BAiZ7_CF.js → task-queue-B9uJqkal.js} +3 -3
  53. package/dist/{task-runner-Bh8XONXT.js → task-runner-BZUoctJ1.js} +20 -10
  54. package/dist/{thread-state-BnQln4jO.js → thread-state-SnFcB9Rk.js} +6 -5
  55. package/dist/{turn-failure-response-Ba7_kItn.js → turn-failure-response-CrSc1Vtn.js} +10 -9
  56. package/dist/{turn-lifecycle-D6CTbkb9.js → turn-lifecycle-D49hJbjm.js} +1 -1
  57. package/dist/{turn-session-routing-DNevs9H7.js → turn-session-routing-cMvumCLK.js} +1 -1
  58. package/dist/{validation-BNPhuAvt.js → validation-DsLyiOfn.js} +1 -1
  59. package/dist/{version-EQ4MWuUJ.js → version-Dayi_ng2.js} +1 -1
  60. package/dist/version.js +1 -1
  61. package/dist/viewer-DF3HTfW5.js +1636 -0
  62. package/dist/{web-authorization-DDt4FZld.js → web-authorization-Dg_R1tMc.js} +6 -6
  63. package/dist/{web-input-C56ivZuH.js → web-input-qVi8134S.js} +63 -433
  64. package/dist/{work-DJ7hb9Ul.js → work-BbcghZZp.js} +9 -10
  65. package/dist/{worker-DiiV8Lba.js → worker-B-uRQzKw.js} +5 -5
  66. package/migrations/0048_user_admin.sql +1 -0
  67. package/migrations/meta/0048_snapshot.json +3720 -0
  68. package/migrations/meta/_journal.json +7 -0
  69. package/package.json +5 -5
  70. package/dist/pending-auth-moCA2mTc.js +0 -59
@@ -4344,6 +4344,10 @@ type AutomationUpdate = z.output<typeof automationUpdateSchema>;
4344
4344
  /** Catalog metadata only; callbacks and provider connections stay on the server. */
4345
4345
  export declare const automationEventCatalogSchema: z.ZodArray<z.ZodObject<{
4346
4346
  type: z.ZodString;
4347
+ identifier: z.ZodOptional<z.ZodObject<{
4348
+ format: z.ZodString;
4349
+ pattern: z.ZodCustom<RegExp, RegExp>;
4350
+ }, z.core.$strict>>;
4347
4351
  supportedEvents: z.ZodArray<z.ZodString>;
4348
4352
  suggestedEvents: z.ZodOptional<z.ZodArray<z.ZodString>>;
4349
4353
  matchFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
@@ -1,5 +1,6 @@
1
- import { A as forkConversationResponseSchema, C as conversationReportEventSchema, D as createConversationBodySchema, E as conversationSummaryReportSchema, K as resolveMessageCards, M as MAX_INPUT_IMAGE_BYTES, O as createConversationMessageBodySchema, P as INPUT_IMAGE_TYPES, S as conversationReportEventDataSchema, T as conversationStatsReportSchema, U as messageCardText, X as conversationTurnFailureCodeSchema, Z as conversationTurnFailureReasonSchema, _ as conversationParamsSchema, a as cancelConversationPendingMessagesBodySchema, b as conversationPendingMessageSchema, d as conversationDetailReportSchema, f as conversationEventHistorySchema, g as conversationFeedSchema, h as conversationFeedQuerySchema, i as archiveConversationResponseSchema, j as MAX_INPUT_IMAGES, k as forkConversationBodySchema, l as conversationAuxiliaryCostsSchema, m as conversationEventsQuerySchema, o as cancelConversationPendingMessagesResponseSchema, p as conversationEventPageSchema, r as archiveConversationBodySchema, s as conversationActivityPreviewSchema, t as acceptedConversationMessageSchema, u as conversationDetailQuerySchema, v as conversationPendingAuthorizationSchema, x as conversationPendingMessagesReportSchema, y as conversationPendingMessageDeliverySchema } from "../conversation-9Fxa1Zbq.js";
1
+ import { a as conversationTurnFailureReasonSchema, i as conversationTurnFailureCodeSchema } from "../history-BLTUgFYO.js";
2
+ import { A as forkConversationResponseSchema, C as conversationReportEventSchema, D as createConversationBodySchema, E as conversationSummaryReportSchema, K as resolveMessageCards, M as MAX_INPUT_IMAGE_BYTES, O as createConversationMessageBodySchema, P as INPUT_IMAGE_TYPES, S as conversationReportEventDataSchema, T as conversationStatsReportSchema, U as messageCardText, _ as conversationParamsSchema, a as cancelConversationPendingMessagesBodySchema, b as conversationPendingMessageSchema, d as conversationDetailReportSchema, f as conversationEventHistorySchema, g as conversationFeedSchema, h as conversationFeedQuerySchema, i as archiveConversationResponseSchema, j as MAX_INPUT_IMAGES, k as forkConversationBodySchema, l as conversationAuxiliaryCostsSchema, m as conversationEventsQuerySchema, o as cancelConversationPendingMessagesResponseSchema, p as conversationEventPageSchema, r as archiveConversationBodySchema, s as conversationActivityPreviewSchema, t as acceptedConversationMessageSchema, u as conversationDetailQuerySchema, v as conversationPendingAuthorizationSchema, x as conversationPendingMessagesReportSchema, y as conversationPendingMessageDeliverySchema } from "../conversation-DwD-vquD.js";
2
3
  import { C as eventAutomationSummarySchema, S as automationVersionSchema, _ as automationSummarySchema, a as automationExecutionSchema, b as automationVersionListSchema, d as automationParamsSchema, f as automationRunListSchema, g as automationSchedulePreviewSchema, h as automationScheduleIntentSchema, i as automationExecutionListSchema, l as automationListQuerySchema, m as automationRunWindowsSchema, n as automationEditSchema, o as automationExecutionStatusDaySchema, p as automationRunSchema, r as automationEventCatalogSchema, s as automationExecutionStatusSchema, t as automationEditErrorSchema, u as automationListSchema, v as automationUpdateSchema, w as scheduledAutomationSummarySchema, x as automationVersionParamsSchema, y as automationVersionActivateSchema } from "../automation-CrQGQ2MT.js";
3
4
  import { C as skillReportsSchema, S as skillReportSchema, _ as pluginPackageContentItemReportSchema, b as pluginsSchema, g as pluginOperationalReportSchema, h as pluginOperationalReportFeedSchema, m as healthReportSchema, t as webMessageId, v as pluginPackageContentReportSchema, x as runtimeInfoReportSchema, y as pluginSchema } from "../web-message-id-xPI_EFSC.js";
4
- import { A as codeChangeSummarySchema, C as locationParamsSchema, D as dailyConversationActivitySchema, F as codeRepositorySummarySchema, I as apiErrorSchema, M as codePersonReportSchema, N as codeRepositoryParamsSchema, O as codeActivityDaySchema, P as codeRepositoryReportSchema, S as locationDirectoryReportSchema, _ as actorProfileReportSchema, a as workspaceBodySchema, b as locationActivityDayReportSchema, c as workspaceRepoSchema, d as createdPersonalTokenSchema, f as personalTokenListSchema, g as actorDirectoryReportSchema, h as revokePersonalTokenResponseSchema, i as deleteWorkspaceResponseSchema, j as codeOverviewReportSchema, k as codeChangeSummaryReportSchema, l as workspaceSchema, m as personalTokenParamsSchema, n as statsReportSchema, o as workspaceListSchema, p as personalTokenMetadataSchema, r as baselineSnapshotSchema, s as workspaceParamsSchema, t as statSchema, u as createPersonalTokenBodySchema, v as personParamsSchema, x as locationDetailReportSchema, y as personalSpendReportSchema } from "../schema-C5bgOpRg.js";
5
+ import { A as codeChangeSummarySchema, C as locationParamsSchema, D as dailyConversationActivitySchema, F as codeRepositorySummarySchema, I as apiErrorSchema, M as codePersonReportSchema, N as codeRepositoryParamsSchema, O as codeActivityDaySchema, P as codeRepositoryReportSchema, S as locationDirectoryReportSchema, _ as actorProfileReportSchema, a as workspaceBodySchema, b as locationActivityDayReportSchema, c as workspaceRepoSchema, d as createdPersonalTokenSchema, f as personalTokenListSchema, g as actorDirectoryReportSchema, h as revokePersonalTokenResponseSchema, i as deleteWorkspaceResponseSchema, j as codeOverviewReportSchema, k as codeChangeSummaryReportSchema, l as workspaceSchema, m as personalTokenParamsSchema, n as statsReportSchema, o as workspaceListSchema, p as personalTokenMetadataSchema, r as baselineSnapshotSchema, s as workspaceParamsSchema, t as statSchema, u as createPersonalTokenBodySchema, v as personParamsSchema, x as locationDetailReportSchema, y as personalSpendReportSchema } from "../schema-CxWAN2zq.js";
5
6
  export { INPUT_IMAGE_TYPES, MAX_INPUT_IMAGES, MAX_INPUT_IMAGE_BYTES, acceptedConversationMessageSchema, actorDirectoryReportSchema, actorProfileReportSchema, apiErrorSchema, archiveConversationBodySchema, archiveConversationResponseSchema, automationEditErrorSchema, automationEditSchema, automationEventCatalogSchema, automationExecutionListSchema, automationExecutionSchema, automationExecutionStatusDaySchema, automationExecutionStatusSchema, automationListQuerySchema, automationListSchema, automationParamsSchema, automationRunListSchema, automationRunSchema, automationRunWindowsSchema, automationScheduleIntentSchema, automationSchedulePreviewSchema, automationSummarySchema, automationUpdateSchema, automationVersionActivateSchema, automationVersionListSchema, automationVersionParamsSchema, automationVersionSchema, baselineSnapshotSchema, cancelConversationPendingMessagesBodySchema, cancelConversationPendingMessagesResponseSchema, codeActivityDaySchema, codeChangeSummaryReportSchema, codeChangeSummarySchema, codeOverviewReportSchema, codePersonReportSchema, codeRepositoryParamsSchema, codeRepositoryReportSchema, codeRepositorySummarySchema, conversationActivityPreviewSchema, conversationAuxiliaryCostsSchema, conversationDetailQuerySchema, conversationDetailReportSchema, conversationEventHistorySchema, conversationEventPageSchema, conversationEventsQuerySchema, conversationFeedQuerySchema, conversationFeedSchema, conversationParamsSchema, conversationPendingAuthorizationSchema, conversationPendingMessageDeliverySchema, conversationPendingMessageSchema, conversationPendingMessagesReportSchema, conversationReportEventDataSchema, conversationReportEventSchema, conversationStatsReportSchema, conversationSummaryReportSchema, conversationTurnFailureCodeSchema, conversationTurnFailureReasonSchema, createConversationBodySchema, createConversationMessageBodySchema, createPersonalTokenBodySchema, createdPersonalTokenSchema, dailyConversationActivitySchema, deleteWorkspaceResponseSchema, eventAutomationSummarySchema, forkConversationBodySchema, forkConversationResponseSchema, healthReportSchema, locationActivityDayReportSchema, locationDetailReportSchema, locationDirectoryReportSchema, locationParamsSchema, messageCardText, personParamsSchema, personalSpendReportSchema, personalTokenListSchema, personalTokenMetadataSchema, personalTokenParamsSchema, pluginOperationalReportFeedSchema, pluginOperationalReportSchema, pluginPackageContentItemReportSchema, pluginPackageContentReportSchema, pluginSchema, pluginsSchema, resolveMessageCards, revokePersonalTokenResponseSchema, runtimeInfoReportSchema, scheduledAutomationSummarySchema, skillReportSchema, skillReportsSchema, statSchema, statsReportSchema, webMessageId, workspaceBodySchema, workspaceListSchema, workspaceParamsSchema, workspaceRepoSchema, workspaceSchema };
package/dist/api.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { n as ConversationWorkQueue } from "./queue-B5SnqRln.js";
2
- import "./db-Ca9Nt5ci.js";
2
+ import "./db-CWZP77Ex.js";
3
3
  import { Hono } from "hono";
4
4
  import { z } from "zod";
5
5
  import { User } from "@sentry/junior-plugin-api";
package/dist/api.js CHANGED
@@ -1,21 +1,23 @@
1
- import { Dt as getEventCatalog, G as readScheduledAutomation, K as saveScheduledAutomation, M as parseSlackThreadId, Pt as cancelHumanFacingPendingMessages, Q as eventAutomationTriggerAvailable, R as editScheduledAutomation, Wt as getConversation, X as editEventAutomation, Z as AutomationEditError, at as getEventAutomation, ct as saveEventAutomation, et as resolveTaskOutcomes, ft as readAutomationVersion, g as readStats, gt as requireAutomationRevision, ht as automationRevision, k as readLiveAttachment, kt as pluginEventCatalog, lt as setEventAutomationStatus, mt as AutomationConflictError, pt as sameDefinitionValue, rt as eventAutomationBelongsToUser, ut as automationDefinition, z as lookupSlackUser } from "./agent-runner-DMAsnPb9.js";
2
- import { d as logException, p as logWarn } from "./logging-rB_ngE_R.js";
3
- import { b as parseSlackMessageTs, h as parseSlackTeamId, p as parseSlackChannelId } from "./context-0Et9iVSB.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, Qt as getConversationEventStore, 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, in as withConversationEventLock, 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-otHGbhBx.js";
1
+ import { $ as eventAutomationBelongsToUser, Et as pluginEventCatalog, F as lookupSlackUser, H as saveScheduledAutomation, J as eventAutomationTriggerAvailable, K as editEventAutomation, O as parseSlackThreadId, P as editScheduledAutomation, T as readLiveAttachment, V as readScheduledAutomation, Vt as getConversation, X as resolveTaskOutcomes, at as setEventAutomationStatus, ct as readAutomationVersion, dt as automationRevision, ft as requireAutomationRevision, g as readStats, it as saveEventAutomation, jt as cancelHumanFacingPendingMessages, lt as sameDefinitionValue, ot as automationDefinition, q as AutomationEditError, tt as getEventAutomation, ut as AutomationConflictError, wt as getEventCatalog } from "./agent-runner-DjQSEVuD.js";
2
+ import { d as logException, p as logWarn } from "./logging-Bne7JUXI.js";
3
+ import { d as parseSlackTeamId, g as parseSlackMessageTs, l as parseSlackChannelId } from "./actor-BTtLaeWy.js";
4
+ import { C as agentTurnUsageSchema, T as resolveRootConversationId, _ as locationFromRow, c as getConversationEventStore, d as getDb, f as getSqlExecutor, i as resolveViewerUser, m as withConversationEventLock, o as updateViewerDisplayName, t as findUserByEmail, u as getConversationStore, w as hasAgentTurnUsage, y as parseSessionSource } from "./viewer-DF3HTfW5.js";
5
5
  import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
6
- import { C as juniorCodeChanges, D as juniorConversations, E as conversationReadColumns, O as juniorIdentities, _ as juniorConversationBriefs, b as juniorConversationEvents, h as juniorConversationParticipants, k as juniorUsers, w as juniorCodeRepositories, x as juniorApiTokens, y as juniorConversationMetrics } from "./executor-BNxfDS1V.js";
7
- import { A as forkConversationResponseSchema, D as createConversationBodySchema, N as readMessageAttachments, O as createConversationMessageBodySchema, P as INPUT_IMAGE_TYPES, T as conversationStatsReportSchema, _ as conversationParamsSchema, a as cancelConversationPendingMessagesBodySchema, c as conversationAttachmentParamsSchema, d as conversationDetailReportSchema, g as conversationFeedSchema, h as conversationFeedQuerySchema, i as archiveConversationResponseSchema, k as forkConversationBodySchema, m as conversationEventsQuerySchema, nt as contextProvenance, o as cancelConversationPendingMessagesResponseSchema, p as conversationEventPageSchema, r as archiveConversationBodySchema, t as acceptedConversationMessageSchema, u as conversationDetailQuerySchema, x as conversationPendingMessagesReportSchema } from "./conversation-9Fxa1Zbq.js";
8
- import { F as loadTurnProjection, vt as piMessageFromHistoryItem } from "./checkpoint-BlIIiHG5.js";
9
- import { n as hash, t as create } from "./profile-D6apIG2N.js";
10
- import { t as getCachedSnapshot } from "./resolve-sJtTzuBO.js";
11
- import { a as getVercelConversationWorkQueue } from "./job-queue-Dq5_zt_l.js";
6
+ import { C as juniorCodeChanges, D as juniorConversations, E as conversationReadColumns, O as juniorIdentities, _ as juniorConversationBriefs, b as juniorConversationEvents, h as juniorConversationParticipants, k as juniorUsers, w as juniorCodeRepositories, x as juniorApiTokens, y as juniorConversationMetrics } from "./executor-DmIad4GI.js";
7
+ import { u as contextProvenance } from "./history-BLTUgFYO.js";
8
+ import { F as loadTurnProjection, vt as piMessageFromHistoryItem } from "./checkpoint-C37Xgtj-.js";
9
+ import { At as viewerConversationMembership, C as WorkspaceValidationError, Ct as conversationArchiveTimes, Dt as conversationHasParticipantUser, Et as conversationHasParticipantEmail, Ht as listConversationAnnotations, M as workspaceRepoCheckoutPath, Mt as readLatestConversationBrief, Nt as readConversationEventPage, O as SANDBOX_RUNTIME, Ot as conversationNotArchivedForEmail, Pt as buildSentryConversationUrl, S as updateWorkspace, St as readConversationAccessFromSql, Tt as conversationArchivedForUser, Ut as listConversationAnnotationsById, _ as deleteWorkspace, at as getSlackClient, b as listWorkspaces, g as createWorkspace, kt as conversationNotArchivedForUser, u as getPlugins, ut as withSlackRetries, v as getWorkspace, wt as conversationArchivedForEmail, x as listWorkspacesByRepository, xt as createPluginLogger } from "./agent-hooks-p3UA9FI1.js";
10
+ import { A as forkConversationResponseSchema, D as createConversationBodySchema, N as readMessageAttachments, O as createConversationMessageBodySchema, P as INPUT_IMAGE_TYPES, T as conversationStatsReportSchema, _ as conversationParamsSchema, a as cancelConversationPendingMessagesBodySchema, c as conversationAttachmentParamsSchema, d as conversationDetailReportSchema, g as conversationFeedSchema, h as conversationFeedQuerySchema, i as archiveConversationResponseSchema, k as forkConversationBodySchema, m as conversationEventsQuerySchema, o as cancelConversationPendingMessagesResponseSchema, p as conversationEventPageSchema, r as archiveConversationBodySchema, t as acceptedConversationMessageSchema, u as conversationDetailQuerySchema, x as conversationPendingMessagesReportSchema } from "./conversation-DwD-vquD.js";
11
+ import { n as hash, t as create } from "./profile-DIcHBAxe.js";
12
+ import { t as getCachedSnapshot } from "./resolve-BkpWmZgN.js";
13
+ import { a as getVercelConversationWorkQueue } from "./job-queue-CXpx6KfD.js";
12
14
  import { F as weekdaySchema, I as getFirstRunAtMs, M as compileScheduleIntent, _ as automationSummarySchema, b as automationVersionListSchema, c as automationLifecycleSchema, d as automationParamsSchema, f as automationRunListSchema, g as automationSchedulePreviewSchema, h as automationScheduleIntentSchema, i as automationExecutionListSchema, j as ScheduleIntentError, l as automationListQuerySchema, n as automationEditSchema, r as automationEventCatalogSchema, t as automationEditErrorSchema, u as automationListSchema, v as automationUpdateSchema, x as automationVersionParamsSchema, y as automationVersionActivateSchema } from "./automation-CrQGQ2MT.js";
13
15
  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";
14
- import { C as clearSlackPendingReactions, L as createVercelAttachmentStorage, V as readHealthReport, _ as readViewerAutomationSummary, a as recordWebConversationActivity, b as resolveViewerTaskCandidate, d as resolveSlackConversationContextFromThreadId, f as ViewerTaskNotFoundError, g as readViewerAutomationRuns, h as readViewerAutomationExecutions, i as createConversationId, j as legacyWebMailboxMetadataSchema, l as getProductionSlackAdapter, m as readConversationSourceTask, o as webActorFromEmail, p as deleteViewerTask, r as createAndEnqueueConversation, t as appendAndEnqueueWebMessage, u as formatSlackConversationRedactedLabel, v as readViewerAutomationVersions, y as readViewerAutomations } from "./web-input-C56ivZuH.js";
15
- import { A as conversationAggregateColumns, j as conversationRangeColumns, k as conversationActiveDaysColumn } from "./task-runner-Bh8XONXT.js";
16
- import { r as getWebAuthorization } from "./web-authorization-DDt4FZld.js";
17
- import { t as decodeInputImages } from "./images-D6Y3FJDQ.js";
18
- 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-C5bgOpRg.js";
16
+ import { B as readHealthReport, C as clearSlackPendingReactions, I as createVercelAttachmentStorage, _ as readViewerAutomationSummary, a as recordWebConversationActivity, b as resolveViewerTaskCandidate, d as resolveSlackConversationContextFromThreadId, f as ViewerTaskNotFoundError, g as readViewerAutomationRuns, h as readViewerAutomationExecutions, i as createConversationId, j as legacyWebMailboxMetadataSchema, l as getProductionSlackAdapter, m as readConversationSourceTask, o as webActorFromEmail, p as deleteViewerTask, r as createAndEnqueueConversation, t as appendAndEnqueueWebMessage, u as formatSlackConversationRedactedLabel, v as readViewerAutomationVersions, y as readViewerAutomations } from "./web-input-qVi8134S.js";
17
+ import { A as conversationAggregateColumns, j as conversationRangeColumns, k as conversationActiveDaysColumn } from "./task-runner-BZUoctJ1.js";
18
+ import { r as getWebAuthorization } from "./web-authorization-Dg_R1tMc.js";
19
+ import { t as decodeInputImages } from "./images-1xUjTHGf.js";
20
+ 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-CxWAN2zq.js";
19
21
  import { Hono } from "hono";
20
22
  import path from "node:path";
21
23
  import { z } from "zod";
@@ -3354,7 +3356,7 @@ async function readPeoplePluginReports(args) {
3354
3356
  reports: [],
3355
3357
  source: "plugins"
3356
3358
  });
3357
- const { getPluginProfileReports } = await import("./agent-hooks-otHGbhBx.js").then((n) => n.t);
3359
+ const { getPluginProfileReports } = await import("./agent-hooks-p3UA9FI1.js").then((n) => n.t);
3358
3360
  return pluginOperationalReportFeedSchema.parse({
3359
3361
  generatedAt: new Date(nowMs).toISOString(),
3360
3362
  reports: await getPluginProfileReports({
@@ -3742,9 +3744,13 @@ function createPersonalTokenRoutes() {
3742
3744
  * This module joins registered readers with the authenticated viewer and
3743
3745
  * validates every plugin response before it reaches the dashboard.
3744
3746
  */
3745
- /** List safe navigation metadata for registered plugin user pages. */
3746
- function readPluginUserPageLinks() {
3747
- return pluginUserPageLinksSchema.parse(getPlugins().flatMap((plugin) => (plugin.userPages ?? []).map((page) => ({
3747
+ /** Admin pages are hidden from everyone except Junior admins. */
3748
+ function viewerCanSeePage(page, viewer) {
3749
+ return page.navigation !== "admin" || viewer?.isAdmin === true;
3750
+ }
3751
+ /** List safe navigation metadata for the plugin user pages one viewer can see. */
3752
+ function readPluginUserPageLinks(viewer) {
3753
+ return pluginUserPageLinksSchema.parse(getPlugins().flatMap((plugin) => (plugin.userPages ?? []).filter((page) => viewerCanSeePage(page, viewer)).map((page) => ({
3748
3754
  description: page.description,
3749
3755
  id: page.id,
3750
3756
  label: page.label,
@@ -3764,6 +3770,7 @@ async function readPluginUserPage(input) {
3764
3770
  if (!plugin || !page) return void 0;
3765
3771
  const viewer = await resolveViewerUser(input.email);
3766
3772
  if (!viewer) throw new Error("Authenticated viewer user could not be resolved");
3773
+ if (!viewerCanSeePage(page, viewer)) return void 0;
3767
3774
  const content = pluginUserPageContentSchema.parse(await page.read({
3768
3775
  db: getDb(),
3769
3776
  log: createPluginLogger(plugin.manifest.name),
@@ -3784,7 +3791,7 @@ const userPageQuerySchema = z.object({
3784
3791
  /** Create authenticated discovery and read routes for plugin user pages. */
3785
3792
  function createUserPageRoutes() {
3786
3793
  const app = new Hono();
3787
- app.get("/", () => jsonResponse(pluginUserPageLinksSchema, readPluginUserPageLinks()));
3794
+ app.get("/", (context) => jsonResponse(pluginUserPageLinksSchema, readPluginUserPageLinks(context.get("viewer"))));
3788
3795
  app.get("/:pluginName/:pageId", requireViewer, validateRequest("query", userPageQuerySchema, "Invalid user page query."), async (context) => {
3789
3796
  const viewer = context.get("viewer");
3790
3797
  const { q, ...query } = context.req.valid("query");
@@ -4317,7 +4324,7 @@ function readDescriptionText(home) {
4317
4324
  }
4318
4325
  /** Read discovered skill names for authenticated runtime diagnostics. */
4319
4326
  async function readSkillReports() {
4320
- const { discoverSkills } = await import("./skills-BVpr_Gnv.js").then((n) => n.o);
4327
+ const { discoverSkills } = await import("./skills-PHvy-ZgH.js").then((n) => n.o);
4321
4328
  const skills = await discoverSkills();
4322
4329
  return skillReportsSchema.parse(skills.map((skill) => ({
4323
4330
  name: skill.name,
@@ -4326,7 +4333,7 @@ async function readSkillReports() {
4326
4333
  }
4327
4334
  /** Read safe configured plugin metadata for authenticated runtime diagnostics. */
4328
4335
  async function readPlugins() {
4329
- const { pluginCatalogRuntime } = await import("./catalog-runtime-DlXuhrmk.js").then((n) => n.t);
4336
+ const { pluginCatalogRuntime } = await import("./catalog-runtime-xq-njrMs.js").then((n) => n.t);
4330
4337
  return pluginsSchema.parse(pluginCatalogRuntime.getProviders().map((plugin) => ({
4331
4338
  configKeys: plugin.manifest.configKeys ?? [],
4332
4339
  description: plugin.manifest.description,
@@ -4338,7 +4345,7 @@ async function readPlugins() {
4338
4345
  async function readRuntimeInfoReport() {
4339
4346
  const [{ homeDir }, { pluginCatalogRuntime }, plugins, skills] = await Promise.all([
4340
4347
  import("./package-discovery-BVvSnQBB.js").then((n) => n.r),
4341
- import("./catalog-runtime-DlXuhrmk.js").then((n) => n.t),
4348
+ import("./catalog-runtime-xq-njrMs.js").then((n) => n.t),
4342
4349
  readPlugins(),
4343
4350
  readSkillReports()
4344
4351
  ]);
@@ -4355,7 +4362,7 @@ async function readRuntimeInfoReport() {
4355
4362
  /** Read sanitized operational summaries contributed by plugins. */
4356
4363
  async function readPluginOperationalReportFeed() {
4357
4364
  const nowMs = Date.now();
4358
- const { getPluginOperationalReports } = await import("./agent-hooks-otHGbhBx.js").then((n) => n.t);
4365
+ const { getPluginOperationalReports } = await import("./agent-hooks-p3UA9FI1.js").then((n) => n.t);
4359
4366
  return pluginOperationalReportFeedSchema.parse({
4360
4367
  source: "plugins",
4361
4368
  generatedAt: new Date(nowMs).toISOString(),
@@ -1,5 +1,5 @@
1
1
  import { n as ConversationWorkQueue, t as ConversationQueueMessage } from "./queue-B5SnqRln.js";
2
- import { t as ConversationStore } from "./store-DoewL5mG.js";
2
+ import { t as ConversationStore } from "./store-BxxbxBlm.js";
3
3
  import "./history-DvqWZlYX.js";
4
4
  import { n as JuniorPluginSet } from "./plugins-CjfUP5gJ.js";
5
5
  import { Hono } from "hono";
package/dist/app.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { i as ModelProfileInput, n as createApp, r as JuniorDashboardOptions, t as JuniorAppOptions } from "./app-MEd7wbF0.js";
1
+ import { i as ModelProfileInput, n as createApp, r as JuniorDashboardOptions, t as JuniorAppOptions } from "./app-FB2hmHpZ.js";
2
2
  import { i as defineJuniorPlugins, n as JuniorPluginSet, r as JuniorPluginSetOptions, t as JuniorPluginInput } from "./plugins-CjfUP5gJ.js";
3
3
  import { t as JUNIOR_VERSION } from "./version-CnXZ614E.js";
4
4
  export { JUNIOR_VERSION, JuniorAppOptions, type JuniorDashboardOptions, type JuniorPluginInput, type JuniorPluginSet, type JuniorPluginSetOptions, type ModelProfileInput, createApp, defineJuniorPlugins };
package/dist/app.js CHANGED
@@ -1,29 +1,32 @@
1
- import { $ as effectiveTaskOutcomes, $t as requestConversationWork, A as requestAttachmentDeletion, B as logScheduledAutomationRunSkipped, C as isExperimentalFeatureEnabled, Cn as startOAuthFlow, Ct as processWorkspaceSnapshotJob, Dt as getEventCatalog, Fn as createUserTokenStore, G as readScheduledAutomation, Gt as getConversationWorkState, H as listScheduledAutomations, Hn as getConfigDefaults, J as scheduledRunId, Kt as hasRunnableConversationWork, Lt as clearExpiredConversationLease, M as parseSlackThreadId, Mt as appendAndEnqueueInboundMessage, Nn as slackEntitySchema, O as collectAttachmentGarbage, On as slackMention, Ot as eventGuidance, Pn as slackExternalRefIdSchema, S as getExperimentalFeatures, T as lookupSlackUserProfile, U as listScheduledAutomationsForTeam, Un as setConfigDefaults, Ut as ensureConversationWake, V as scheduledAutomationRunAttributes, Wt as getConversation, Y as withScheduledAutomationLock, Zt as removeActiveConversation, _n as consumeSandboxEgressPermissionDeniedSignal, a as executeCredentialedEgressRequest, an as hasRunnableConversationWork$1, b as unpublishedArtifactHeaders, bn as formatProviderLabel, c as deleteMcpAuthSessionsForUserProvider, cn as renderTaskInput, dn as resolveSandboxEgressProviderForHost, fn as normalizeSandboxEgressTracePropagationDomains, gn as consumeSandboxEgressAuthRequiredSignal, hn as clearSandboxEgressSignals, it as findMatchingEventAutomations, l as deleteMcpServerSessionId, mn as SANDBOX_EGRESS_PROXY_PATH, pn as shouldPropagateSandboxEgressTrace, q as saveScheduledAutomationInLock, qt as listActiveConversationIds, r as executeAgentRun, rn as CONVERSATION_WORK_STALE_ENQUEUE_MS, sn as isInvalidConversationRecordError, t as createAgentRunner, tn as stopConversationWork, tt as collectEventAutomationMatchKeys, u as deleteMcpStoredOAuthCredentials, v as publicArtifactHeaders, vn as parseSandboxEgressCredentialToken, w as setExperimentalFeatures, wt as ingestEvent, y as readPublicArtifact } from "./agent-runner-DMAsnPb9.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-rB_ngE_R.js";
1
+ import { An as slackEntitySchema, Bn as setConfigDefaults, Bt as ensureConversationWake, E as requestAttachmentDeletion, G as withScheduledAutomationLock, Ht as getConversationWorkState, I as logScheduledAutomationRunSkipped, Jt as removeActiveConversation, L as scheduledAutomationRunAttributes, Mn as createUserTokenStore, O as parseSlackThreadId, Pt as clearExpiredConversationLease, Qt as stopConversationWork, R as listScheduledAutomations, Tn as slackMention, Tt as eventGuidance, U as saveScheduledAutomationInLock, Ut as hasRunnableConversationWork, V as readScheduledAutomation, Vt as getConversation, W as scheduledRunId, Wt as listActiveConversationIds, Xt as requestConversationWork, Y as effectiveTaskOutcomes, Z as collectEventAutomationMatchKeys, _n as formatProviderLabel, an as renderTaskInput, b as unpublishedArtifactHeaders, bn as startOAuthFlow, bt as ingestEvent, c as deleteMcpAuthSessionsForUserProvider, cn as resolveSandboxEgressProviderForHost, dn as SANDBOX_EGRESS_PROXY_PATH, en as CONVERSATION_WORK_STALE_ENQUEUE_MS, et as findMatchingEventAutomations, fn as clearSandboxEgressSignals, hn as parseSandboxEgressCredentialToken, i as executeCredentialedEgressRequest, in as isInvalidConversationRecordError, jn as slackExternalRefIdSchema, kt as appendAndEnqueueInboundMessage, l as deleteMcpServerSessionId, ln as normalizeSandboxEgressTracePropagationDomains, mn as consumeSandboxEgressPermissionDeniedSignal, n as executeAgentRun, nn as hasRunnableConversationWork$1, pn as consumeSandboxEgressAuthRequiredSignal, t as createAgentRunner, u as deleteMcpStoredOAuthCredentials, un as shouldPropagateSandboxEgressTrace, v as publicArtifactHeaders, w as collectAttachmentGarbage, wt as getEventCatalog, x as lookupSlackUserProfile, y as readPublicArtifact, yt as processWorkspaceSnapshotJob, z as listScheduledAutomationsForTeam, zn as getConfigDefaults } from "./agent-runner-DjQSEVuD.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-Bne7JUXI.js";
3
3
  import { r as continueTrace } from "./sentry-CgWZM_kV.js";
4
- import { t as JUNIOR_VERSION } from "./version-EQ4MWuUJ.js";
5
- import { _ as snapshotRuntimeConfig, d as restoreRuntimeConfig, f as setBotModelConfig, g as setSlackReactionConfig, h as setRuntimeLimits, i as getChatConfig, m as setProfiles, n as botConfig, o as getSlackBotToken, p as setCrossActorMidRunMode, u as resetRuntimeConfig } from "./config-CxpPG6nR.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 { $ 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-otHGbhBx.js";
4
+ import { t as JUNIOR_VERSION } from "./version-Dayi_ng2.js";
5
+ import { _ as snapshotRuntimeConfig, d as restoreRuntimeConfig, f as setBotModelConfig, g as setSlackReactionConfig, h as setRuntimeLimits, i as getChatConfig, m as setProfiles, n as botConfig, o as getSlackBotToken, p as setCrossActorMidRunMode, u as resetRuntimeConfig } from "./config-CGK_VplU.js";
6
+ import { _ as slackMessageTsSchema, d as parseSlackTeamId, f as parseSlackUserId, h as slackUserIdSchema, m as slackTeamIdSchema, o as parseActorUserId, p as slackChannelIdSchema } from "./actor-BTtLaeWy.js";
7
+ import { E as deleteProviderIdentityForSlackUser, c as getConversationEventStore, d as getDb, f as getSqlExecutor, g as withConversationMutationLock, m as withConversationEventLock, r as readActorIdentity, u as getConversationStore } from "./viewer-DF3HTfW5.js";
8
8
  import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
9
- import { D as juniorConversations, _ as juniorConversationBriefs, a as juniorSchedulerRuns, b as juniorConversationEvents, m as juniorAgentInvocations, o as juniorSchedulerTasks, p as juniorAgentBindings } from "./executor-BNxfDS1V.js";
10
- import { V as annotationCard } from "./conversation-9Fxa1Zbq.js";
11
- import { n as pluginCatalogRuntime } from "./catalog-runtime-DlXuhrmk.js";
12
- import { J as appendConversationMessages, Z as projectConversationMessages, et as settleConversationTitleWork } from "./checkpoint-BlIIiHG5.js";
13
- import { O as withLock$1, w as getStateAdapter } from "./profile-D6apIG2N.js";
14
- import { f as setSandboxResourceConfig, u as getSandboxResourceConfig } from "./resolve-sJtTzuBO.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-Dq5_zt_l.js";
9
+ import { D as juniorConversations, _ as juniorConversationBriefs, a as juniorSchedulerRuns, b as juniorConversationEvents, m as juniorAgentInvocations, o as juniorSchedulerTasks, p as juniorAgentBindings } from "./executor-DmIad4GI.js";
10
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-xq-njrMs.js";
11
+ import { J as appendConversationMessages, Z as projectConversationMessages, et as settleConversationTitleWork } from "./checkpoint-C37Xgtj-.js";
12
+ import { $ as verifySlackDirectCredentialSubject, G as findMatchingWatches, Ht as listConversationAnnotations, J as bindEventAutomationCredentialSubject, Q as verifyScheduledAutomationCredentialSubject, St as readConversationAccessFromSql, V as collectEventMatchKeys, X as bindSlackDirectCredentialSubject, Y as bindScheduledAutomationCredentialSubject, Z as verifyEventAutomationCredentialSubject, _t as setDashboardConversationLinkOptions, a as getPluginRoutes, at as getSlackClient, d as setPlugins, dt as getWorkspaceTeamId, f as validatePlugins, ft as runWithWorkspaceTeamId, gt as getDashboardTaskLink, h as setBriefsConfig, i as getPluginApiRoutes, mt as getDashboardConversationLink, q as takeDueTimerWatches, st as isDmChannel, u as getPlugins, vt as createPluginState, xt as createPluginLogger, z as cancelSubscriptions, zt as resolveRootVisibility } from "./agent-hooks-p3UA9FI1.js";
13
+ import { V as annotationCard } from "./conversation-DwD-vquD.js";
14
+ import { O as withLock$1, w as getStateAdapter } from "./profile-DIcHBAxe.js";
15
+ import { c as getThreadStopDecision } from "./pending-auth-C6w4Gwve.js";
16
+ import { f as setSandboxResourceConfig, u as getSandboxResourceConfig } from "./resolve-BkpWmZgN.js";
17
+ 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-CXpx6KfD.js";
16
18
  import { D as scheduledRunSchema, L as getNextRunAtMs } from "./automation-CrQGQ2MT.js";
17
- import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-BNPhuAvt.js";
19
+ import { i as setExperimentalFeatures, n as getExperimentalFeatures, r as isExperimentalFeatureEnabled } from "./experimental-Qn9rKLgx.js";
20
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-DsLyiOfn.js";
18
21
  import { a as pluginRuntimeRegistrationsFromPluginSet, n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "./plugins-egKWjgue.js";
19
- import { A as getAuthPausedConversationTurnId, B as GET$3, C as clearSlackPendingReactions, D as stopSlackThread, E as isSlackMessageStopped, F as getThreadStopDecision, I as renderSlackObjectCard, L as createVercelAttachmentStorage, M as THREAD_OPTOUT_ACK, N as startProcessingReaction, O as normalizeIncomingSlackThreadId, P as parseContent, S as buildSlackInboundMessage, T as verifySlackSignature, _ as readViewerAutomationSummary, a as recordWebConversationActivity, c as createProductionSlackWebhookServices, k as withNormalizedThreadId, l as getProductionSlackAdapter, n as conversationTurnIdForMessage, o as webActorFromEmail, s as createProductionConversationWorkOptions, t as appendAndEnqueueWebMessage, w as runWithSlackInstallation, x as recordSkippedConversationMessage, z as enqueueAgentDispatch } from "./web-input-C56ivZuH.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, t as processPluginTask } from "./task-runner-Bh8XONXT.js";
21
- import { c as listPendingAgentInvocationMailboxAppends, r as enqueueAgentInvocation } from "./work-DJ7hb9Ul.js";
22
- import { s as coerceThreadConversationState } from "./thread-state-BnQln4jO.js";
23
- import { a as GET$4, i as publishAppHomeView, r as GET$5, t as receiveLocalOAuthCredential } from "./credential-sync-D9yGg3q5.js";
24
- import { a as registerVercelPluginTaskDevConsumer, n as createVercelPluginTaskCallback, s as queueCallback } from "./task-queue-BAiZ7_CF.js";
25
- import { t as processConversationWork } from "./worker-DiiV8Lba.js";
26
- import { t as bindSpawnAgent } from "./spawn-CJhmyE4E.js";
22
+ import { A as getAuthPausedConversationTurnId, C as clearSlackPendingReactions, D as stopSlackThread, E as isSlackMessageStopped, F as renderSlackObjectCard, I as createVercelAttachmentStorage, M as THREAD_OPTOUT_ACK, N as startProcessingReaction, O as normalizeIncomingSlackThreadId, P as parseContent, R as enqueueAgentDispatch, S as buildSlackInboundMessage, T as verifySlackSignature, _ as readViewerAutomationSummary, a as recordWebConversationActivity, c as createProductionSlackWebhookServices, k as withNormalizedThreadId, l as getProductionSlackAdapter, n as conversationTurnIdForMessage, o as webActorFromEmail, s as createProductionConversationWorkOptions, t as appendAndEnqueueWebMessage, w as runWithSlackInstallation, x as recordSkippedConversationMessage, z as GET$3 } from "./web-input-qVi8134S.js";
23
+ 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, t as processPluginTask } from "./task-runner-BZUoctJ1.js";
24
+ import { c as listPendingAgentInvocationMailboxAppends, r as enqueueAgentInvocation } from "./work-BbcghZZp.js";
25
+ import { s as coerceThreadConversationState } from "./thread-state-SnFcB9Rk.js";
26
+ import { a as GET$4, i as publishAppHomeView, r as GET$5, t as receiveLocalOAuthCredential } from "./credential-sync-BBeYpK4k.js";
27
+ import { a as registerVercelPluginTaskDevConsumer, n as createVercelPluginTaskCallback, s as queueCallback } from "./task-queue-B9uJqkal.js";
28
+ import { t as processConversationWork } from "./worker-B-uRQzKw.js";
29
+ import { t as bindSpawnAgent } from "./spawn-CY34_HCm.js";
27
30
  import { createRequire } from "node:module";
28
31
  import { Hono } from "hono";
29
32
  import { z } from "zod";
@@ -4875,6 +4878,7 @@ function dashboardHostRoutePaths(dashboard, authenticatedRoutes = []) {
4875
4878
  const peoplePath = pagePath("people");
4876
4879
  const pagePaths = [
4877
4880
  basePath,
4881
+ pagePath("admin"),
4878
4882
  pagePath("code"),
4879
4883
  `${pagePath("code")}/*`,
4880
4884
  conversationsPath,
@@ -1,7 +1,7 @@
1
- import { r as completeObject } from "./client-CPMbTmJU.js";
1
+ import { r as completeObject } from "./client-BZdqKg6S.js";
2
2
  import { r as defaultModelId } from "./model-profile-BwU8mqwD.js";
3
- import { B as parseBriefInput, I as briefCodeChangeSchema, d as conversationDetailReportSchema, p as conversationEventPageSchema } from "./conversation-9Fxa1Zbq.js";
4
- import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-Ctwy6hSI.js";
3
+ import { B as parseBriefInput, I as briefCodeChangeSchema, d as conversationDetailReportSchema, p as conversationEventPageSchema } from "./conversation-DwD-vquD.js";
4
+ import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-CMU-B4FA.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-CxpPG6nR.js").then((n) => n.r);
272
+ const { botConfig } = await import("./config-CGK_VplU.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-zfTzTHe6.js";
2
+ import { t as createPluginCatalogRuntime } from "./registry-VSrEYeaD.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,13 @@
1
- import { d as unwrapCurrentInstruction, f as escapeXml, i as completeText, o as resolveGatewayModel } from "./client-CPMbTmJU.js";
2
- import { d as logException, o as getActiveTraceId, p as logWarn, t as buildTurnFailureResponse, v as setSpanAttributes } from "./logging-rB_ngE_R.js";
3
- import { n as botConfig } from "./config-CxpPG6nR.js";
4
- import { b as parseSlackMessageTs, f as toStoredSlackActor } from "./context-0Et9iVSB.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-otHGbhBx.js";
6
- import { H as messageCardRef, J as agentHistoryItemSchema, it as instructionProvenanceFor, nt as contextProvenance, rt as instructionActors } from "./conversation-9Fxa1Zbq.js";
7
- import { D as fenceLock, O as withLock, T as MUTATION_LOCK_TTL_MS, k as sleep, w as getStateAdapter } from "./profile-D6apIG2N.js";
1
+ import { d as unwrapCurrentInstruction, f as escapeXml, i as completeText, o as resolveGatewayModel } from "./client-BZdqKg6S.js";
2
+ import { d as logException, o as getActiveTraceId, p as logWarn, t as buildTurnFailureResponse, v as setSpanAttributes } from "./logging-Bne7JUXI.js";
3
+ import { n as botConfig } from "./config-CGK_VplU.js";
4
+ import { c as toStoredSlackActor, g as parseSlackMessageTs } from "./actor-BTtLaeWy.js";
5
+ import { b as addAgentTurnUsage, c as getConversationEventStore, f as getSqlExecutor, m as withConversationEventLock, p as createSqlConversationEventStore, u as getConversationStore, v as bindProviderConversation } from "./viewer-DF3HTfW5.js";
6
+ import { d as instructionActors, f as instructionProvenanceFor, n as agentHistoryItemSchema, u as contextProvenance } from "./history-BLTUgFYO.js";
7
+ import { p as credentialSubjectSchema } from "./registry-VSrEYeaD.js";
8
+ import { Gt as agentsInstructionsUpdatedEvent, Kt as authenticationLinkedEvent, Wt as JUNIOR_NATIVE_EVENT_NAMESPACE, qt as authenticationUnlinkedEvent } from "./agent-hooks-p3UA9FI1.js";
9
+ import { H as messageCardRef } from "./conversation-DwD-vquD.js";
10
+ import { D as fenceLock, O as withLock, T as MUTATION_LOCK_TTL_MS, k as sleep, w as getStateAdapter } from "./profile-DIcHBAxe.js";
8
11
  import { isDeepStrictEqual } from "node:util";
9
12
  import { z } from "zod";
10
13
  import { createHash } from "node:crypto";
@@ -24,7 +27,7 @@ function authorizationObservationMessage(data, createdAtMs) {
24
27
  role: "user",
25
28
  content: [{
26
29
  type: "text",
27
- text: `${label} completed for provider "${data.provider}". Continue the blocked request and retry the provider operation if needed.`
30
+ text: `${label} completed for provider "${data.provider}". Continue the request that waited for it and retry the provider operation. If the person dropped that request since, do not continue it; say only that ${data.provider} is connected.`
28
31
  }],
29
32
  timestamp: createdAtMs
30
33
  });
@@ -1528,6 +1531,7 @@ const storedTurnRecordSchema = z.object({
1528
1531
  schemaVersion: z.literal(TURN_CURSOR_SCHEMA_VERSION),
1529
1532
  version: z.number().int().nonnegative(),
1530
1533
  conversationId: z.string().min(1),
1534
+ credentialSubject: credentialSubjectSchema.optional(),
1531
1535
  dispatchId: z.string().min(1).optional(),
1532
1536
  dispatchOutcome: z.enum([
1533
1537
  "blocked",
@@ -1645,6 +1649,7 @@ function materializeTurnRecord(stored, piProjection, turnStartMessageIndex, runt
1645
1649
  cumulativeDurationMs: runtimeMetrics?.cumulativeDurationMs ?? 0,
1646
1650
  ...definedProps$1({
1647
1651
  channelName: runtimeMetrics?.channelName,
1652
+ credentialSubject: stored.credentialSubject,
1648
1653
  cumulativeToolCallCount: stored.cumulativeToolCallCount,
1649
1654
  cumulativeUsage: runtimeMetrics?.cumulativeUsage,
1650
1655
  dispatchId: stored.dispatchId,
@@ -1714,6 +1719,7 @@ function buildStoredRecord(args) {
1714
1719
  committedSeq: args.committedSeq,
1715
1720
  ...definedProps$1({
1716
1721
  actor: args.actor,
1722
+ credentialSubject: args.credentialSubject,
1717
1723
  cumulativeToolCallCount: args.cumulativeToolCallCount,
1718
1724
  dispatchId: args.dispatchId,
1719
1725
  dispatchOutcome: args.dispatchOutcome,
@@ -1789,6 +1795,7 @@ async function updateTurnState(args) {
1789
1795
  lastProgressAtMs: parsed.lastProgressAtMs,
1790
1796
  previousVersion: parsed.version,
1791
1797
  ...definedProps$1({
1798
+ credentialSubject: args.existing.credentialSubject,
1792
1799
  cumulativeToolCallCount: args.existing.cumulativeToolCallCount,
1793
1800
  dispatchId: args.existing.dispatchId,
1794
1801
  dispatchOutcome: args.existing.dispatchOutcome,
@@ -1862,6 +1869,7 @@ async function upsertTurnRecordLocked(args, fence) {
1862
1869
  historyVersion: commit.historyVersion,
1863
1870
  previousVersion: existingRecord?.version,
1864
1871
  ...definedProps$1({
1872
+ credentialSubject: existingRecord?.credentialSubject ?? args.credentialSubject,
1865
1873
  cumulativeToolCallCount: args.cumulativeToolCallCount ?? existingRecord?.cumulativeToolCallCount,
1866
1874
  dispatchId,
1867
1875
  dispatchOutcome: args.dispatchOutcome ?? existingRecord?.dispatchOutcome,
@@ -2038,6 +2046,7 @@ function sharedWrite(args, latest) {
2038
2046
  ...definedProps({
2039
2047
  actor: args.actor,
2040
2048
  channelName: args.channelName ?? latest?.channelName,
2049
+ credentialSubject: args.credentialSubject,
2041
2050
  destination: args.destination,
2042
2051
  destinationVisibility: args.destinationVisibility,
2043
2052
  dispatchId: args.dispatchId ?? latest?.dispatchId,
@@ -2079,9 +2088,9 @@ async function savePaused(args) {
2079
2088
  const nextSliceId = keepSlice ? args.sliceId : args.sliceId + 1;
2080
2089
  try {
2081
2090
  const latest = await getTurnRecord(args.conversationId, args.turnId);
2082
- const messages = args.reason === "yield" ? [...args.messages] : continuableMessages(args.messages, latest?.piMessages);
2091
+ const messages = args.reason === "yield" || args.beforePrompt ? [...args.messages] : continuableMessages(args.messages, latest?.piMessages);
2083
2092
  if (args.reason === "auth") {
2084
- if (messages.length > 0 && !isContinuablePiBoundary(messages)) return;
2093
+ if (!args.beforePrompt && messages.length > 0 && !isContinuablePiBoundary(messages)) return;
2085
2094
  } else if (messages.length === 0 || !isContinuablePiBoundary(messages)) return;
2086
2095
  const base = {
2087
2096
  ...sharedWrite(args, latest),
package/dist/cli/chat.js CHANGED
@@ -1,4 +1,4 @@
1
- import { r as executeAgentRun, t as createAgentRunner } from "../agent-runner-DMAsnPb9.js";
1
+ import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-DjQSEVuD.js";
2
2
  import { t as loadAppPluginSet } from "../plugin-module-CVvEUSMH.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-otHGbhBx.js").then((n) => n.t),
104
- import("../catalog-runtime-DlXuhrmk.js").then((n) => n.t),
105
- import("../validation-BNPhuAvt.js").then((n) => n.r),
106
- import("../agent-hooks-otHGbhBx.js").then((n) => n.Zt)
103
+ import("../agent-hooks-p3UA9FI1.js").then((n) => n.t),
104
+ import("../catalog-runtime-xq-njrMs.js").then((n) => n.t),
105
+ import("../validation-DsLyiOfn.js").then((n) => n.r),
106
+ import("../viewer-DF3HTfW5.js").then((n) => n.s)
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-DMAsnPb9.js").then((n) => n.x);
156
+ const { setExperimentalFeatures } = await import("../experimental-Qn9rKLgx.js").then((n) => n.t);
157
157
  setExperimentalFeatures({ subagents: true });
158
- const { setBriefsConfig } = await import("../agent-hooks-otHGbhBx.js").then((n) => n.m);
158
+ const { setBriefsConfig } = await import("../agent-hooks-p3UA9FI1.js").then((n) => n.m);
159
159
  setBriefsConfig({ enabled: true });
160
- const { runLocalAgentTurn } = await import("../runner-DkCk8cbc.js");
161
- const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-Csw7RssK.js");
160
+ const { runLocalAgentTurn } = await import("../runner-52ezCnZF.js");
161
+ const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-Cb-HPZPS.js");
162
162
  const { createLocalOAuthState } = await import("../oauth-relay-CdCnu80W.js").then((n) => n.t);
163
- const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-tSQ8OEcw.js");
164
- const { bindSpawnAgent } = await import("../spawn-CJhmyE4E.js").then((n) => n.n);
165
- const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-DJ7hb9Ul.js").then((n) => n.a);
163
+ const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-Cmhf3P6Y.js");
164
+ const { bindSpawnAgent } = await import("../spawn-CY34_HCm.js").then((n) => n.n);
165
+ const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-BbcghZZp.js").then((n) => n.a);
166
166
  const { createLocalConversationWork } = await import("../conversation-work-C6y3T5Hx.js");
167
- const { processConversationWork } = await import("../worker-DiiV8Lba.js").then((n) => n.n);
167
+ const { processConversationWork } = await import("../worker-B-uRQzKw.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-rB_ngE_R.js";
2
- import { f as parseInlinePluginManifest, p as parsePluginManifest } from "../registry-zfTzTHe6.js";
3
- import { i as parseSkillFile } from "../skills-BVpr_Gnv.js";
1
+ import { D as JUNIOR_HEARTBEAT_ROUTE, M as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, T as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-Bne7JUXI.js";
2
+ import { _ as parsePluginManifest, g as parseInlinePluginManifest } from "../registry-VSrEYeaD.js";
3
+ import { i as parseSkillFile } from "../skills-PHvy-ZgH.js";
4
4
  import path from "node:path";
5
5
  import fs from "node:fs/promises";
6
6
  import { pathToFileURL } from "node:url";
package/dist/cli/main.js CHANGED
@@ -24,8 +24,11 @@ async function runUpgrade(pluginSet) {
24
24
  async function runChat(argv, pluginSet) {
25
25
  return await (await import("./chat.js")).runChat(argv, void 0, { pluginSet });
26
26
  }
27
+ async function runAdmin(argv) {
28
+ return await (await import("../admin-leAJ2k0P.js")).runAdmin(argv);
29
+ }
27
30
  async function runBriefs(argv) {
28
- return await (await import("../briefs-DDA1ugXk.js")).runBriefs(argv);
31
+ return await (await import("../briefs-mzUaJkBX.js")).runBriefs(argv);
29
32
  }
30
33
  function topLevelCommand(argv) {
31
34
  return (argv[0] === "--" ? argv.slice(1) : argv)[0];
@@ -36,10 +39,11 @@ async function runMain(argv, options = {}) {
36
39
  const instrument = options.instrument ?? true;
37
40
  if (instrument) await initSentry();
38
41
  const command = topLevelCommand(argv);
39
- const cliPluginsModule = command && command !== "init" && command !== "briefs" ? await import("./plugins.js") : void 0;
42
+ const cliPluginsModule = command && command !== "init" && command !== "briefs" && command !== "admin" ? await import("./plugins.js") : void 0;
40
43
  const pluginSet = cliPluginsModule ? await cliPluginsModule.loadCliPluginSet() ?? null : void 0;
41
44
  const pluginCommands = cliPluginsModule ? await cliPluginsModule.loadCliPluginCommands(pluginSet) : void 0;
42
45
  const exitCode = await runCli(argv, {
46
+ runAdmin,
43
47
  runBriefs,
44
48
  runChat: async (chatArgv) => await runChat(chatArgv, pluginSet),
45
49
  runInit,
@@ -1,6 +1,7 @@
1
- import { d as setPlugins, f as validatePlugins, tn as getDb, wt as createPluginLogger } from "../agent-hooks-otHGbhBx.js";
2
- import { n as pluginCatalogRuntime } from "../catalog-runtime-DlXuhrmk.js";
3
- import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-BNPhuAvt.js";
1
+ import { d as getDb } from "../viewer-DF3HTfW5.js";
2
+ import { n as pluginCatalogRuntime } from "../catalog-runtime-xq-njrMs.js";
3
+ import { d as setPlugins, f as validatePlugins, xt as createPluginLogger } from "../agent-hooks-p3UA9FI1.js";
4
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-DsLyiOfn.js";
4
5
  import { a as pluginRuntimeRegistrationsFromPluginSet, i as pluginCliRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "../plugins-egKWjgue.js";
5
6
  import { t as loadAppPluginSet } from "../plugin-module-CVvEUSMH.js";
6
7
  import { stderr, stdout } from "node:process";
@@ -14,6 +15,7 @@ import { Command, CommanderError } from "commander";
14
15
  */
15
16
  const pluginCliLoader = createJiti(import.meta.url, { moduleCache: false });
16
17
  const CORE_COMMAND_NAMES = /* @__PURE__ */ new Set([
18
+ "admin",
17
19
  "chat",
18
20
  "check",
19
21
  "init",
package/dist/cli/run.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  //#region src/cli/run.d.ts
2
- export declare const CLI_USAGE = "usage: junior init <dir>\n junior snapshot create\n junior check [dir]\n junior upgrade\n junior chat\n junior chat -p <message>\n junior briefs pull <conversationId...> --base-url <url> [--token <token>] --out <dir>\n junior briefs run <snapshot...> [--model <id>] [--prompt <file>] [--turn-by-turn] [--out <dir>]";
2
+ export declare const CLI_USAGE = "usage: junior init <dir>\n junior admin list|grant <email>|revoke <email>\n junior snapshot create\n junior check [dir]\n junior upgrade\n junior chat\n junior chat -p <message>\n junior briefs pull <conversationId...> --base-url <url> [--token <token>] --out <dir>\n junior briefs run <snapshot...> [--model <id>] [--prompt <file>] [--turn-by-turn] [--out <dir>]";
3
3
  interface CliHandlers {
4
+ runAdmin: (argv: string[]) => Promise<number>;
4
5
  runBriefs: (argv: string[]) => Promise<number>;
5
6
  runChat: (argv: string[]) => Promise<number>;
6
7
  runInit: (dir: string) => Promise<void>;
package/dist/cli/run.js CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region src/cli/run.ts
2
- const CLI_USAGE = "usage: junior init <dir>\n junior snapshot create\n junior check [dir]\n junior upgrade\n junior chat\n junior chat -p <message>\n junior briefs pull <conversationId...> --base-url <url> [--token <token>] --out <dir>\n junior briefs run <snapshot...> [--model <id>] [--prompt <file>] [--turn-by-turn] [--out <dir>]";
2
+ const CLI_USAGE = "usage: junior init <dir>\n junior admin list|grant <email>|revoke <email>\n junior snapshot create\n junior check [dir]\n junior upgrade\n junior chat\n junior chat -p <message>\n junior briefs pull <conversationId...> --base-url <url> [--token <token>] --out <dir>\n junior briefs run <snapshot...> [--model <id>] [--prompt <file>] [--turn-by-turn] [--out <dir>]";
3
3
  const DEFAULT_IO = { error: console.error };
4
4
  /** Strip Node's leading argv separator while preserving command-level flags. */
5
5
  function normalizeCliArgv(argv) {
@@ -9,6 +9,7 @@ function normalizeCliArgv(argv) {
9
9
  async function runCli(argv, handlers, io = DEFAULT_IO) {
10
10
  const [command, subcommand, ...rest] = normalizeCliArgv(argv);
11
11
  if (command === "chat") return await handlers.runChat(subcommand === void 0 ? [] : [subcommand, ...rest]);
12
+ if (command === "admin") return await handlers.runAdmin(subcommand === void 0 ? [] : [subcommand, ...rest]);
12
13
  if (command === "briefs") return await handlers.runBriefs(subcommand === void 0 ? [] : [subcommand, ...rest]);
13
14
  if (command === "init") {
14
15
  if (!subcommand || rest.length > 0) {
@@ -1,6 +1,6 @@
1
- import { n as pluginCatalogRuntime } from "../catalog-runtime-DlXuhrmk.js";
2
- import { S as disconnectStateAdapter, t as create } from "../profile-D6apIG2N.js";
3
- import { r as resolve } from "../resolve-sJtTzuBO.js";
1
+ import { n as pluginCatalogRuntime } from "../catalog-runtime-xq-njrMs.js";
2
+ import { S as disconnectStateAdapter, t as create } from "../profile-DIcHBAxe.js";
3
+ import { r as resolve } from "../resolve-BkpWmZgN.js";
4
4
  //#region src/cli/snapshot-create.ts
5
5
  const DEFAULT_RUNTIME = "node22";
6
6
  const DEFAULT_TIMEOUT_MS = 6e5;
@@ -1,4 +1,4 @@
1
- import "../db-Ca9Nt5ci.js";
1
+ import "../db-CWZP77Ex.js";
2
2
  import { n as JuniorPluginSet } from "../plugins-CjfUP5gJ.js";
3
3
  //#region src/cli/upgrade/types.d.ts
4
4
  interface UpgradeIo {
@@ -1,6 +1,6 @@
1
- import { i as getChatConfig } from "../config-CxpPG6nR.js";
2
- import { t as createJuniorSqlExecutor } from "../executor-BNxfDS1V.js";
3
- import { t as createPluginCatalogRuntime } from "../registry-zfTzTHe6.js";
1
+ import { i as getChatConfig } from "../config-CGK_VplU.js";
2
+ import { t as createJuniorSqlExecutor } from "../executor-DmIad4GI.js";
3
+ import { t as createPluginCatalogRuntime } from "../registry-VSrEYeaD.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-CVvEUSMH.js";
6
6
  import { basename, dirname, join, resolve } from "node:path";
@@ -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-rB_ngE_R.js";
2
- import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-Dbkdvozu.js";
1
+ import { d as logException, g as serializeGenAiAttribute, i as extractGenAiUsageAttributes, m as normalizeGenAiFinishReason, p as logWarn, w as withSpan } from "./logging-Bne7JUXI.js";
2
+ import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-Ci3QLNOb.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";