@sentry/junior 0.226.0 → 0.227.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 (57) hide show
  1. package/dist/{agent-hooks-FUetyyLe.js → agent-hooks-bEwEJhlg.js} +218 -11
  2. package/dist/{agent-runner-DEF7auSj.js → agent-runner-BGDSjciH.js} +114 -73
  3. package/dist/api/schema.d.ts +65 -6
  4. package/dist/api/schema.js +3 -3
  5. package/dist/api.js +52 -31
  6. package/dist/{app-TVL42pGL.d.ts → app-CjRIKZb5.d.ts} +1 -1
  7. package/dist/app.d.ts +1 -1
  8. package/dist/app.js +208 -136
  9. package/dist/{briefs-Cb4T2BUI.js → briefs-BkM_ZW4B.js} +4 -4
  10. package/dist/{catalog-runtime-BYGR3Dr4.js → catalog-runtime-Cw9V2jpn.js} +1 -1
  11. package/dist/{checkpoint-CJe-dZFF.js → checkpoint-oZYD3-Ar.js} +7 -7
  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-C2WBBx7m.js → client-Pcxo3lGn.js} +2 -2
  19. package/dist/{config-Bws6Rpsh.js → config-CYvEow1F.js} +2 -2
  20. package/dist/{context-Bplcgypl.js → context-0Et9iVSB.js} +1 -1
  21. package/dist/{conversation-DPbmIwjy.js → conversation-BnhOMfEB.js} +49 -22
  22. package/dist/{conversation-privacy-pCcW0a5Y.js → conversation-privacy-hQmyZbOC.js} +1 -1
  23. package/dist/{credential-sync-ibuNsMyl.js → credential-sync-CUGbiiCM.js} +14 -14
  24. package/dist/{executor-D36FWjcf.js → executor-BXMlFrV6.js} +1 -1
  25. package/dist/{history-DI9KJT3J.d.ts → history-nukv1YN8.d.ts} +26 -1
  26. package/dist/images-8siTAUNW.js +82 -0
  27. package/dist/instrumentation.js +2 -2
  28. package/dist/{job-queue-2mFFDMHB.js → job-queue-AI0_QAgc.js} +1 -1
  29. package/dist/{logging-CvjMHRvg.js → logging-BPBx6WF-.js} +1 -1
  30. package/dist/nitro.d.ts +1 -1
  31. package/dist/nitro.js +3 -3
  32. package/dist/{oauth-authorization-l4O1rXsL.js → oauth-authorization-Cq1GaLIP.js} +1 -1
  33. package/dist/{oauth-callback-server-Ds8M5FFX.js → oauth-callback-server-CnF03VYh.js} +2 -2
  34. package/dist/{pending-auth-DLNJbD8H.js → pending-auth-CHUjr_6d.js} +1 -1
  35. package/dist/{profile-dvV7PB7u.js → profile-upzC-wN1.js} +4 -4
  36. package/dist/{prompt-DehgjkO5.js → prompt-CZIQcPHy.js} +1 -1
  37. package/dist/{registry-C6FHctIu.js → registry-DM5aMhjm.js} +2 -2
  38. package/dist/{resolve-DqwGI9wq.js → resolve-sF6Lg7Ay.js} +2 -2
  39. package/dist/{runner-CzYEcB73.js → runner-Bu2wYpK8.js} +10 -10
  40. package/dist/{sandbox-egress-signals-BZOv0fns.js → sandbox-egress-signals-Dgerhizb.js} +1 -1
  41. package/dist/{schema-BZg-xzfG.js → schema-BSiwcvjm.js} +1 -1
  42. package/dist/{skills-EhiVbjF4.js → skills-CAI5s___.js} +2 -2
  43. package/dist/{spawn-Ck3L0rEr.js → spawn-DRK9TBgY.js} +2 -2
  44. package/dist/{task-queue-TXhAWQwj.js → task-queue-iuDAqfZg.js} +3 -3
  45. package/dist/{task-runner-axUJS1No.js → task-runner-S3QtH38c.js} +10 -10
  46. package/dist/{thread-state-CTuWhjru.js → thread-state-C_arVuaN.js} +5 -5
  47. package/dist/{turn-failure-response-csVoLOzx.js → turn-failure-response-DarwGYgC.js} +9 -9
  48. package/dist/{turn-lifecycle-C1S6vELh.js → turn-lifecycle-CdiIejXH.js} +1 -1
  49. package/dist/{turn-session-routing-5RejBvit.js → turn-session-routing-DyLGd_wU.js} +1 -1
  50. package/dist/{validation-q2PFxkTQ.js → validation-BMig74Zp.js} +1 -1
  51. package/dist/{version-ByLtIYyy.js → version-lhQSfLjx.js} +1 -1
  52. package/dist/version.js +1 -1
  53. package/dist/{web-authorization-Biy8nsS7.js → web-authorization-r2lKYKJ2.js} +6 -6
  54. package/dist/{web-input-DM9LaEdn.js → web-input-BU-Fu7iq.js} +46 -36
  55. package/dist/{work-QrbHdXTc.js → work-B9koS8sW.js} +7 -7
  56. package/dist/{worker-r17aopXW.js → worker-C_iJSRgG.js} +5 -5
  57. package/package.json +5 -4
package/dist/app.js CHANGED
@@ -1,28 +1,28 @@
1
- import { $t as renderTaskInput, A as collectAttachmentGarbage, B as scheduledAutomationRunAttributes, C as readPublicArtifact, Cn as slackEntitySchema, Ct as appendAndEnqueueInboundMessage, Ft as getConversation, G as listScheduledAutomationsForTeam, Ht as removeActiveConversation, It as getConversationWorkState, Jt as CONVERSATION_WORK_STALE_ENQUEUE_MS, Kt as stopConversationWork, Lt as hasRunnableConversationWork, M as requestAttachmentDeletion, Nn as getConfigDefaults, Ot as clearExpiredConversationLease, P as parseSlackThreadId, Pn as setConfigDefaults, Pt as ensureConversationWake, Q as scheduledRunSchema, Qt as isInvalidConversationRecordError, Rt as listActiveConversationIds, S as publicArtifactHeaders, Tn as createUserTokenStore, V as getNextRunAtMs, W as listScheduledAutomations, Wt as requestConversationWork, X as scheduledRunId, Xt as hasRunnableConversationWork$1, Y as saveScheduledAutomationInLock, Z as withScheduledAutomationLock, a as isExperimentalFeatureEnabled, an as SANDBOX_EGRESS_PROXY_PATH, bt as eventGuidance, cn as consumeSandboxEgressPermissionDeniedSignal, dn as formatProviderLabel, et as effectiveTaskOutcomes, f as deleteMcpAuthSessionsForUserProvider, gt as ingestEvent, ht as processWorkspaceSnapshotJob, i as getExperimentalFeatures, in as shouldPropagateSandboxEgressTrace, it as findMatchingEventAutomations, l as executeCredentialedEgressRequest, ln as parseSandboxEgressCredentialToken, m as deleteMcpStoredOAuthCredentials, mn as startOAuthFlow, nn as resolveSandboxEgressProviderForHost, o as setExperimentalFeatures, on as clearSandboxEgressSignals, p as deleteMcpServerSessionId, q as readScheduledAutomation, rn as normalizeSandboxEgressTracePropagationDomains, s as executeAgentRun, sn as consumeSandboxEgressAuthRequiredSignal, t as createAgentRunner, tt as collectEventAutomationMatchKeys, w as unpublishedArtifactHeaders, wn as slackExternalRefIdSchema, yt as getEventCatalog, z as logScheduledAutomationRunSkipped } from "./agent-runner-DEF7auSj.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-CvjMHRvg.js";
1
+ import { $ as collectEventAutomationMatchKeys, A as requestAttachmentDeletion, An as getConfigDefaults, Bt as removeActiveConversation, C as readPublicArtifact, Cn as createUserTokenStore, Et as clearExpiredConversationLease, Ft as hasRunnableConversationWork, G as readScheduledAutomation, H as listScheduledAutomations, Ht as requestConversationWork, It as listActiveConversationIds, J as scheduledRunId, Jt as hasRunnableConversationWork$1, Kt as CONVERSATION_WORK_STALE_ENQUEUE_MS, L as logScheduledAutomationRunSkipped, M as parseSlackThreadId, Mt as ensureConversationWake, Nt as getConversation, O as collectAttachmentGarbage, Pt as getConversationWorkState, Q as effectiveTaskOutcomes, R as scheduledAutomationRunAttributes, S as publicArtifactHeaders, Sn as slackExternalRefIdSchema, U as listScheduledAutomationsForTeam, Wt as stopConversationWork, X as scheduledRunSchema, Xt as isInvalidConversationRecordError, Y as withScheduledAutomationLock, Zt as renderTaskInput, _t as getEventCatalog, a as isExperimentalFeatureEnabled, an as consumeSandboxEgressAuthRequiredSignal, en as resolveSandboxEgressProviderForHost, f as deleteMcpAuthSessionsForUserProvider, fn as startOAuthFlow, i as getExperimentalFeatures, in as clearSandboxEgressSignals, jn as setConfigDefaults, l as executeCredentialedEgressRequest, ln as formatProviderLabel, m as deleteMcpStoredOAuthCredentials, mt as ingestEvent, nn as shouldPropagateSandboxEgressTrace, nt as findMatchingEventAutomations, o as setExperimentalFeatures, on as consumeSandboxEgressPermissionDeniedSignal, p as deleteMcpServerSessionId, pt as processWorkspaceSnapshotJob, q as saveScheduledAutomationInLock, rn as SANDBOX_EGRESS_PROXY_PATH, s as executeAgentRun, sn as parseSandboxEgressCredentialToken, t as createAgentRunner, tn as normalizeSandboxEgressTracePropagationDomains, vt as eventGuidance, w as unpublishedArtifactHeaders, xn as slackEntitySchema, xt as appendAndEnqueueInboundMessage, z as getNextRunAtMs } from "./agent-runner-BGDSjciH.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-BPBx6WF-.js";
3
3
  import { r as continueTrace } from "./sentry-CgWZM_kV.js";
4
- import { t as JUNIOR_VERSION } from "./version-ByLtIYyy.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-Bws6Rpsh.js";
6
- import { a as createActor, u as parseActorUserId } from "./context-Bplcgypl.js";
7
- import { F as bindSlackDirectCredentialSubject, G as isDmChannel, I as verifyEventAutomationCredentialSubject, Jt as getSqlExecutor, Kt as getConversationStore, L as verifyScheduledAutomationCredentialSubject, Lt as listConversationAnnotations, N as bindEventAutomationCredentialSubject, P as bindScheduledAutomationCredentialSubject, Pt as resolveRootVisibility, Q as readActorIdentity, R as verifySlackDirectCredentialSubject, U as getSlackClient, Wt as getConversationEventStore, X as runWithWorkspaceTeamId, Xt as withConversationEventLock, Y as getWorkspaceTeamId, Zt as withConversationMutationLock, _t as createPluginState, a as getPluginRoutes, bt as createPluginLogger, ct as collectEventMatchKeys, d as setPlugins, dt as findMatchingWatches, f as validatePlugins, gt as setDashboardConversationLinkOptions, h as setBriefsConfig, ht as getDashboardTaskLink, i as getPluginApiRoutes, mt as getDashboardConversationLink, ot as cancelSubscriptions, qt as getDb, sn as deleteProviderIdentityForSlackUser, u as getPlugins, xt as readConversationAccessFromSql } from "./agent-hooks-FUetyyLe.js";
4
+ import { t as JUNIOR_VERSION } from "./version-lhQSfLjx.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-CYvEow1F.js";
6
+ import { _ as slackChannelIdSchema, u as parseActorUserId, v as slackTeamIdSchema, x as slackMessageTsSchema, y as slackUserIdSchema } from "./context-0Et9iVSB.js";
7
+ import { $t as getDb, Bt as resolveRootVisibility, Ct as readConversationAccessFromSql, F as bindSlackDirectCredentialSubject, G as isDmChannel, I as verifyEventAutomationCredentialSubject, L as verifyScheduledAutomationCredentialSubject, N as bindEventAutomationCredentialSubject, P as bindScheduledAutomationCredentialSubject, Q as readActorIdentity, Qt as getConversationStore, R as verifySlackDirectCredentialSubject, St as createPluginLogger, U as getSlackClient, Ut as listConversationAnnotations, X as runWithWorkspaceTeamId, Xt as getConversationEventStore, Y as getWorkspaceTeamId, _t as getDashboardTaskLink, a as getPluginRoutes, ct as collectEventMatchKeys, d as setPlugins, en as getSqlExecutor, f as validatePlugins, ft as findMatchingWatches, gt as getDashboardConversationLink, h as setBriefsConfig, i as getPluginApiRoutes, mt as takeDueTimerWatches, nn as withConversationEventLock, ot as cancelSubscriptions, pn as deleteProviderIdentityForSlackUser, rn as withConversationMutationLock, u as getPlugins, vt as setDashboardConversationLinkOptions, yt as createPluginState } from "./agent-hooks-bEwEJhlg.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-D36FWjcf.js";
10
- import { k as annotationCard } from "./conversation-DPbmIwjy.js";
11
- import { n as pluginCatalogRuntime } from "./catalog-runtime-BYGR3Dr4.js";
12
- import { X as projectConversationMessages, q as appendConversationMessages } from "./checkpoint-CJe-dZFF.js";
13
- import { O as withLock$1, w as getStateAdapter } from "./profile-dvV7PB7u.js";
14
- import { f as setSandboxResourceConfig, u as getSandboxResourceConfig } from "./resolve-DqwGI9wq.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-2mFFDMHB.js";
16
- import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-q2PFxkTQ.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-BXMlFrV6.js";
10
+ import { k as annotationCard } from "./conversation-BnhOMfEB.js";
11
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-Cw9V2jpn.js";
12
+ import { X as projectConversationMessages, q as appendConversationMessages } from "./checkpoint-oZYD3-Ar.js";
13
+ import { O as withLock$1, w as getStateAdapter } from "./profile-upzC-wN1.js";
14
+ import { f as setSandboxResourceConfig, u as getSandboxResourceConfig } from "./resolve-sF6Lg7Ay.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-AI0_QAgc.js";
16
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-BMig74Zp.js";
17
17
  import { a as pluginRuntimeRegistrationsFromPluginSet, n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "./plugins-egKWjgue.js";
18
- import { A as THREAD_OPTOUT_ACK, C as verifySlackSignature, D as withNormalizedThreadId, E as normalizeIncomingSlackThreadId, F as createVercelAttachmentStorage, L as enqueueAgentDispatch, M as parseContent, N as getThreadStopDecision, O as getAuthPausedConversationTurnId, P as renderSlackObjectCard, R as GET$3, S as runWithSlackInstallation, T as stopSlackThread, a as webActorFromEmail, b as clearSlackPendingReactions, c as getProductionSlackAdapter, g as readViewerAutomationSummary, i as recordWebConversationActivity, j as startProcessingReaction, n as conversationTurnIdForMessage, o as createProductionConversationWorkOptions, s as createProductionSlackWebhookServices, t as appendAndEnqueueWebMessage, v as recordSkippedConversationMessage, w as isSlackMessageStopped, y as buildSlackInboundMessage } from "./web-input-DM9LaEdn.js";
19
- import { O as recordAutomationExecution, _ as markDispatchFailed, a as confirmDispatchMailboxAppend, d as getPluginDispatchProjection, f as isTerminalDispatchStatus, l as getDispatchRecord, o as createOrGetDispatch, p as listPendingDispatchMailboxAppends, s as getDispatchConversationId } from "./task-runner-axUJS1No.js";
20
- import { c as listPendingAgentInvocationMailboxAppends, r as enqueueAgentInvocation } from "./work-QrbHdXTc.js";
21
- import { s as coerceThreadConversationState } from "./thread-state-CTuWhjru.js";
22
- import { a as GET$4, i as publishAppHomeView, r as GET$5, t as receiveLocalOAuthCredential } from "./credential-sync-ibuNsMyl.js";
23
- import { a as registerVercelPluginTaskDevConsumer, n as createVercelPluginTaskCallback, s as queueCallback } from "./task-queue-TXhAWQwj.js";
24
- import { t as processConversationWork } from "./worker-r17aopXW.js";
25
- import { t as bindSpawnAgent } from "./spawn-Ck3L0rEr.js";
18
+ import { A as THREAD_OPTOUT_ACK, C as verifySlackSignature, D as withNormalizedThreadId, E as normalizeIncomingSlackThreadId, F as createVercelAttachmentStorage, L as enqueueAgentDispatch, M as parseContent, N as getThreadStopDecision, O as getAuthPausedConversationTurnId, P as renderSlackObjectCard, R as GET$3, S as runWithSlackInstallation, T as stopSlackThread, a as webActorFromEmail, b as clearSlackPendingReactions, c as getProductionSlackAdapter, g as readViewerAutomationSummary, i as recordWebConversationActivity, j as startProcessingReaction, n as conversationTurnIdForMessage, o as createProductionConversationWorkOptions, s as createProductionSlackWebhookServices, t as appendAndEnqueueWebMessage, v as recordSkippedConversationMessage, w as isSlackMessageStopped, y as buildSlackInboundMessage } from "./web-input-BU-Fu7iq.js";
19
+ import { O as recordAutomationExecution, _ as markDispatchFailed, a as confirmDispatchMailboxAppend, d as getPluginDispatchProjection, f as isTerminalDispatchStatus, l as getDispatchRecord, o as createOrGetDispatch, p as listPendingDispatchMailboxAppends, s as getDispatchConversationId } from "./task-runner-S3QtH38c.js";
20
+ import { c as listPendingAgentInvocationMailboxAppends, r as enqueueAgentInvocation } from "./work-B9koS8sW.js";
21
+ import { s as coerceThreadConversationState } from "./thread-state-C_arVuaN.js";
22
+ import { a as GET$4, i as publishAppHomeView, r as GET$5, t as receiveLocalOAuthCredential } from "./credential-sync-CUGbiiCM.js";
23
+ import { a as registerVercelPluginTaskDevConsumer, n as createVercelPluginTaskCallback, s as queueCallback } from "./task-queue-iuDAqfZg.js";
24
+ import { t as processConversationWork } from "./worker-C_iJSRgG.js";
25
+ import { t as bindSpawnAgent } from "./spawn-DRK9TBgY.js";
26
26
  import { createRequire } from "node:module";
27
27
  import { pathToFileURL } from "node:url";
28
28
  import { Hono } from "hono";
@@ -34,6 +34,26 @@ import { setTimeout as setTimeout$1 } from "node:timers/promises";
34
34
  import { createRemoteJWKSet, decodeJwt, jwtVerify } from "jose";
35
35
  import { ChannelImpl, ThreadImpl } from "chat";
36
36
  import * as acp from "@agentclientprotocol/sdk";
37
+ //#region src/chat/events/timers.ts
38
+ /** Publish a bounded batch of due timers; the mailbox owns agent execution. */
39
+ async function runTimerWatchHeartbeat(args) {
40
+ const errors = [];
41
+ for (const watch of await takeDueTimerWatches(args.nowMs)) try {
42
+ await ingestEvent({
43
+ namespace: "junior",
44
+ identifier: watch.identifier,
45
+ eventType: "timer.fired",
46
+ eventKey: `timer:${watch.id}`,
47
+ occurredAtMs: watch.firesAtMs,
48
+ terminal: true,
49
+ trustedSummary: "Timer elapsed."
50
+ }, args);
51
+ } catch (error) {
52
+ errors.push(error);
53
+ }
54
+ if (errors.length) throw new AggregateError(errors, "Timer Watch delivery failed");
55
+ }
56
+ //#endregion
37
57
  //#region src/chat/task-execution/heartbeat.ts
38
58
  const DEFAULT_RECOVERY_LIMIT = 25;
39
59
  function heartbeatIdempotencyKey(reason, conversationId, nowMs) {
@@ -1026,6 +1046,14 @@ async function runHeartbeat(args) {
1026
1046
  } catch (error) {
1027
1047
  logException(error, "scheduled_automations.heartbeat.failed");
1028
1048
  }
1049
+ try {
1050
+ await runTimerWatchHeartbeat({
1051
+ nowMs: args.nowMs,
1052
+ queue
1053
+ });
1054
+ } catch (error) {
1055
+ logException(error, "watches.timer.heartbeat.failed");
1056
+ }
1029
1057
  await runPluginHeartbeats({
1030
1058
  conversationWorkQueue: queue,
1031
1059
  nowMs: args.nowMs
@@ -1740,6 +1768,102 @@ async function presentSlackAnnotationDetails(event, teamId) {
1740
1768
  });
1741
1769
  }
1742
1770
  //#endregion
1771
+ //#region src/chat/ingress/slack-payload.ts
1772
+ const eventTimestampSchema = slackMessageTsSchema.refine((value) => Number.isFinite((/* @__PURE__ */ new Date(Number(value) * 1e3)).getTime()));
1773
+ const slackSlashCommandSchema = z.object({
1774
+ channel_id: z.string().trim().pipe(slackChannelIdSchema),
1775
+ team_id: z.string().trim().pipe(slackTeamIdSchema),
1776
+ user_id: z.string().trim().pipe(slackUserIdSchema),
1777
+ text: z.string(),
1778
+ enterprise_id: z.string().optional(),
1779
+ is_enterprise_install: z.enum(["true", "false"]).optional()
1780
+ });
1781
+ const slackAssistantThreadSchema = z.object({
1782
+ channel_id: z.string().min(1),
1783
+ thread_ts: eventTimestampSchema,
1784
+ user_id: z.string(),
1785
+ context: z.object({
1786
+ channel_id: z.string().optional(),
1787
+ team_id: z.string().optional(),
1788
+ enterprise_id: z.string().nullable().optional()
1789
+ })
1790
+ });
1791
+ const slackEventSchema = z.looseObject({
1792
+ type: z.string(),
1793
+ attachments: z.array(z.looseObject({
1794
+ from_url: z.string().optional(),
1795
+ original_url: z.string().optional(),
1796
+ title: z.string().optional(),
1797
+ text: z.string().optional(),
1798
+ image_url: z.string().optional(),
1799
+ thumb_url: z.string().optional(),
1800
+ service_name: z.string().optional()
1801
+ })).optional(),
1802
+ files: z.array(z.looseObject({
1803
+ id: z.string().optional(),
1804
+ mimetype: z.string().optional(),
1805
+ url_private: z.string().optional(),
1806
+ name: z.string().optional(),
1807
+ size: z.number().optional(),
1808
+ original_w: z.number().optional(),
1809
+ original_h: z.number().optional()
1810
+ })).optional(),
1811
+ edited: z.looseObject({ ts: eventTimestampSchema }).optional(),
1812
+ team: z.string().optional(),
1813
+ team_id: z.string().optional(),
1814
+ username: z.string().optional(),
1815
+ blocks: z.array(z.looseObject({
1816
+ type: z.string(),
1817
+ elements: z.array(z.looseObject({
1818
+ type: z.string(),
1819
+ elements: z.array(z.looseObject({
1820
+ type: z.string(),
1821
+ url: z.string().optional()
1822
+ })).optional()
1823
+ })).optional(),
1824
+ text: z.union([z.string(), z.looseObject({
1825
+ type: z.enum(["mrkdwn", "plain_text"]),
1826
+ text: z.string()
1827
+ })]).optional()
1828
+ })).optional(),
1829
+ bot_id: z.string().optional(),
1830
+ channel: z.string().optional(),
1831
+ channel_type: z.enum([
1832
+ "channel",
1833
+ "group",
1834
+ "mpim",
1835
+ "im",
1836
+ "app_home"
1837
+ ]).optional(),
1838
+ event_ts: eventTimestampSchema.optional(),
1839
+ subtype: z.string().optional(),
1840
+ text: z.string().optional(),
1841
+ thread_ts: eventTimestampSchema.optional(),
1842
+ ts: eventTimestampSchema.optional(),
1843
+ user: z.string().optional()
1844
+ });
1845
+ const slackEventEnvelopeSchema = z.object({
1846
+ enterprise_id: z.string().optional(),
1847
+ event: slackEventSchema.optional(),
1848
+ is_enterprise_install: z.boolean().optional(),
1849
+ team_id: z.string().optional(),
1850
+ type: z.string(),
1851
+ challenge: z.string().optional()
1852
+ });
1853
+ const slackInteractivePayloadSchema = z.object({
1854
+ actions: z.array(z.object({
1855
+ action_id: z.string().optional(),
1856
+ selected_option: z.object({ value: z.string().optional() }).optional(),
1857
+ value: z.string().optional()
1858
+ })).optional(),
1859
+ team: z.object({ id: z.string().optional() }).nullish(),
1860
+ type: z.string(),
1861
+ user: z.object({
1862
+ id: z.string().optional(),
1863
+ team_id: z.string().optional()
1864
+ }).optional()
1865
+ });
1866
+ //#endregion
1743
1867
  //#region src/chat/conversations/stop.ts
1744
1868
  /** Stop the current Conversation Turn and wake an idle resume when needed. */
1745
1869
  async function stopConversationTurn(args) {
@@ -1856,22 +1980,17 @@ function textMentionsBot(text, botUserId) {
1856
1980
  }
1857
1981
  //#endregion
1858
1982
  //#region src/chat/ingress/workspace-membership.ts
1859
- /**
1860
- * Return true when a Slack event's author is from an external workspace.
1861
- *
1862
- * In Slack Connect shared channels the inner event carries `user_team`
1863
- * (the author's home workspace). When it differs from the outer payload's
1864
- * `team_id` the author is a Slack Connect participant, not a local member.
1865
- */
1866
- function isExternalSlackUser(raw) {
1867
- if (!raw) return false;
1983
+ const authorTeamSchema = z.object({
1984
+ user_team: z.string().optional(),
1985
+ source_team: z.string().optional()
1986
+ });
1987
+ /** Accept only Slack authors whose home workspace matches the installation. */
1988
+ function isSlackWorkspaceMember(raw) {
1868
1989
  const workspaceTeamId = getWorkspaceTeamId();
1869
1990
  if (!workspaceTeamId) return false;
1870
- const userTeam = typeof raw.user_team === "string" ? raw.user_team : void 0;
1871
- if (userTeam) return userTeam !== workspaceTeamId;
1872
- const sourceTeam = typeof raw.source_team === "string" ? raw.source_team : void 0;
1873
- if (sourceTeam) return sourceTeam !== workspaceTeamId;
1874
- return false;
1991
+ const parsed = authorTeamSchema.safeParse(raw);
1992
+ if (!parsed.success) return false;
1993
+ return (parsed.data.user_team ?? parsed.data.source_team) === workspaceTeamId;
1875
1994
  }
1876
1995
  //#endregion
1877
1996
  //#region src/chat/credentials/unlink-provider.ts
@@ -1889,17 +2008,12 @@ async function unlinkProvider(userId, provider, userTokenStore, slackTeamId) {
1889
2008
  //#endregion
1890
2009
  //#region src/chat/ingress/slash-command.ts
1891
2010
  async function postEphemeral(event, text) {
1892
- await event.channel.postEphemeral(event.user, text, { fallbackToDM: false });
1893
- }
1894
- function requireActorId(event) {
1895
- const userId = parseActorUserId(event.user.userId);
1896
- if (!userId) throw new Error("Slack slash command requires a actor user id");
1897
- return userId;
2011
+ await event.channel.postEphemeral(event.userId, text, { fallbackToDM: false });
1898
2012
  }
1899
2013
  function getCommandName() {
1900
2014
  return getChatConfig().slack.slashCommand;
1901
2015
  }
1902
- async function handleLink(event, actorId, provider) {
2016
+ async function handleLink(event, provider) {
1903
2017
  if (!pluginCatalogRuntime.isProvider(provider)) {
1904
2018
  await postEphemeral(event, `Unknown provider: \`${provider}\``);
1905
2019
  return;
@@ -1908,20 +2022,14 @@ async function handleLink(event, actorId, provider) {
1908
2022
  await postEphemeral(event, `${formatProviderLabel(provider)} doesn't support account linking.`);
1909
2023
  return;
1910
2024
  }
1911
- const raw = event.raw;
1912
- const actor = createActor({
1913
- platform: "slack",
1914
- teamId: raw.team_id,
1915
- userId: actorId
1916
- }, {
1917
- platform: "slack",
1918
- teamId: raw.team_id,
1919
- userId: actorId
1920
- });
1921
2025
  const result = await startOAuthFlow(provider, {
1922
- actorId,
1923
- ...actor ? { actor } : void 0,
1924
- channelId: raw.channel_id
2026
+ actorId: event.userId,
2027
+ actor: {
2028
+ platform: "slack",
2029
+ teamId: event.teamId,
2030
+ userId: event.userId
2031
+ },
2032
+ channelId: event.channelId
1925
2033
  });
1926
2034
  if (!result.ok) {
1927
2035
  await postEphemeral(event, `Failed to start linking: ${result.error}`);
@@ -1930,7 +2038,7 @@ async function handleLink(event, actorId, provider) {
1930
2038
  if (result.delivery === "fallback_dm") await postEphemeral(event, `Check your DMs for a ${formatProviderLabel(provider)} authorization link.`);
1931
2039
  else if (result.delivery === false) await postEphemeral(event, "I wasn't able to send you a private authorization link. Please try again in a direct message.");
1932
2040
  }
1933
- async function handleUnlink(event, actorId, provider) {
2041
+ async function handleUnlink(event, provider) {
1934
2042
  if (!pluginCatalogRuntime.isProvider(provider)) {
1935
2043
  await postEphemeral(event, `Unknown provider: \`${provider}\``);
1936
2044
  return;
@@ -1940,8 +2048,7 @@ async function handleUnlink(event, actorId, provider) {
1940
2048
  return;
1941
2049
  }
1942
2050
  const tokenStore = createUserTokenStore();
1943
- const teamId = event.raw.team_id;
1944
- await unlinkProvider(actorId, provider, tokenStore, teamId);
2051
+ await unlinkProvider(event.userId, provider, tokenStore, event.teamId);
1945
2052
  logInfo("slash_command.credential.unlinked", { "app.credential.provider": provider });
1946
2053
  await postEphemeral(event, `Your ${formatProviderLabel(provider)} account has been unlinked.`);
1947
2054
  }
@@ -1957,9 +2064,8 @@ async function handleSlashCommand(event) {
1957
2064
  return;
1958
2065
  }
1959
2066
  const normalized = provider.toLowerCase();
1960
- const actorId = requireActorId(event);
1961
- if (subcommand === "link") await handleLink(event, actorId, normalized);
1962
- else await handleUnlink(event, actorId, normalized);
2067
+ if (subcommand === "link") await handleLink(event, normalized);
2068
+ else await handleUnlink(event, normalized);
1963
2069
  }
1964
2070
  //#endregion
1965
2071
  //#region src/chat/slack/automation-details.ts
@@ -2154,7 +2260,7 @@ async function buildThread(args) {
2154
2260
  });
2155
2261
  }
2156
2262
  function shouldIgnoreMessage(message) {
2157
- return message.author.isMe === true || !parseActorUserId(message.author.userId) || isExternalSlackUser(message.raw);
2263
+ return message.author.isMe === true || !parseActorUserId(message.author.userId);
2158
2264
  }
2159
2265
  function shouldPersistBeforeAck(body) {
2160
2266
  return body.event?.type === "app_mention" || body.event?.type === "message";
@@ -2273,7 +2379,7 @@ async function routeParsedMessage(args) {
2273
2379
  const message = normalized.message;
2274
2380
  const canonicalThreadId = normalized.threadId;
2275
2381
  const botUserId = args.adapter.botUserId;
2276
- const isMention = Boolean(botUserId && (textMentionsBot(args.event.text ?? "", botUserId) || args.event.blocks?.some((block) => block.type === "section" && block.text?.type === "mrkdwn" && textMentionsBot(block.text.text, botUserId))));
2382
+ const isMention = Boolean(botUserId && (textMentionsBot(args.event.text ?? "", botUserId) || args.event.blocks?.some((block) => block.type === "section" && typeof block.text === "object" && block.text.type === "mrkdwn" && textMentionsBot(block.text.text, botUserId))));
2277
2383
  if (isMention) message.isMention = true;
2278
2384
  const isDirectMessage = isDmEvent(args.event);
2279
2385
  const isSubscribed = !isDirectMessage && !isMention && await args.state.isSubscribed(canonicalThreadId);
@@ -2356,32 +2462,22 @@ async function handleSlackEvent(args) {
2356
2462
  installation,
2357
2463
  state,
2358
2464
  task: async () => {
2359
- if (event.type === "assistant_thread_started") {
2360
- const assistantThread = event.assistant_thread;
2361
- if (assistantThread?.channel_id && assistantThread.thread_ts) await args.services.runtime.handleAssistantThreadStarted({
2362
- channelId: assistantThread.channel_id,
2363
- context: { channelId: assistantThread.context?.channel_id },
2465
+ if (event.type === "assistant_thread_started" || event.type === "assistant_thread_context_changed") {
2466
+ const parsed = slackAssistantThreadSchema.safeParse(event.assistant_thread);
2467
+ if (!parsed.success) return;
2468
+ const thread = parsed.data;
2469
+ const callback = {
2470
+ channelId: thread.channel_id,
2471
+ context: { channelId: thread.context.channel_id },
2364
2472
  threadId: adapter.encodeThreadId({
2365
- channel: assistantThread.channel_id,
2366
- threadTs: assistantThread.thread_ts
2473
+ channel: thread.channel_id,
2474
+ threadTs: thread.thread_ts
2367
2475
  }),
2368
- threadTs: assistantThread.thread_ts,
2369
- userId: assistantThread.user_id
2370
- });
2371
- return;
2372
- }
2373
- if (event.type === "assistant_thread_context_changed") {
2374
- const assistantThread = event.assistant_thread;
2375
- if (assistantThread?.channel_id && assistantThread.thread_ts) await args.services.runtime.handleAssistantContextChanged({
2376
- channelId: assistantThread.channel_id,
2377
- context: { channelId: assistantThread.context?.channel_id },
2378
- threadId: adapter.encodeThreadId({
2379
- channel: assistantThread.channel_id,
2380
- threadTs: assistantThread.thread_ts
2381
- }),
2382
- threadTs: assistantThread.thread_ts,
2383
- userId: assistantThread.user_id
2384
- });
2476
+ threadTs: thread.thread_ts,
2477
+ userId: thread.user_id
2478
+ };
2479
+ if (event.type === "assistant_thread_started") await args.services.runtime.handleAssistantThreadStarted(callback);
2480
+ else await args.services.runtime.handleAssistantContextChanged(callback);
2385
2481
  return;
2386
2482
  }
2387
2483
  if (event.type === "entity_details_requested") {
@@ -2395,6 +2491,7 @@ async function handleSlackEvent(args) {
2395
2491
  return;
2396
2492
  }
2397
2493
  if ((event.type === "message" || event.type === "app_mention") && !shouldIgnoreMessageSubtype(event) && event.channel && event.ts) {
2494
+ if (!isSlackWorkspaceMember(event)) return;
2398
2495
  const message = adapter.parseMessage(event);
2399
2496
  if (!(await withLock$1(state, `slack:ingress:${normalizeMessageThreadId(message).threadId}`, () => routeParsedMessage({
2400
2497
  adapter,
@@ -2419,42 +2516,19 @@ function requireSlackPayloadUserId(value, source) {
2419
2516
  return userId;
2420
2517
  }
2421
2518
  async function handleSlashCommandForm(args) {
2422
- const raw = Object.fromEntries(args.params);
2423
- const channelId = args.params.get("channel_id") ?? "";
2519
+ const { channel_id: channelId, team_id: teamId, user_id: userId } = args.form;
2424
2520
  const channel = new ChannelImpl({
2425
- id: channelId ? `slack:${channelId}` : "",
2521
+ id: `slack:${channelId}`,
2426
2522
  adapter: args.adapter,
2427
2523
  stateAdapter: args.state
2428
2524
  });
2429
- const userId = requireSlackPayloadUserId(args.params.get("user_id"), "Slack slash command payload");
2430
- const teamId = args.params.get("team_id") ?? void 0;
2431
- const userIdentity = createActor({
2432
- platform: "slack",
2433
- teamId,
2434
- userId,
2435
- userName: args.params.get("user_name") ?? void 0,
2436
- fullName: args.params.get("user_name") ?? void 0
2437
- }, {
2438
- teamId,
2439
- userId
2440
- });
2441
- if (!userIdentity?.userId) throw new Error("Slack slash command payload actor identity is invalid");
2442
2525
  await withSpan("chat.slash_command", "chat.slash_command", { userId }, async () => {
2443
2526
  await handleSlashCommand({
2444
- adapter: args.adapter,
2445
2527
  channel,
2446
- command: args.params.get("command") || "",
2447
- text: args.params.get("text") || "",
2448
- triggerId: args.params.get("trigger_id") || void 0,
2449
- raw,
2450
- user: {
2451
- userId,
2452
- userName: userIdentity.userName ?? "",
2453
- fullName: userIdentity.fullName ?? "",
2454
- isBot: false,
2455
- isMe: false
2456
- },
2457
- openModal: async () => void 0
2528
+ channelId,
2529
+ teamId,
2530
+ text: args.form.text,
2531
+ userId
2458
2532
  });
2459
2533
  });
2460
2534
  }
@@ -2477,14 +2551,6 @@ async function handleInteractivePayload(args) {
2477
2551
  }
2478
2552
  });
2479
2553
  }
2480
- function installationFromForm(params) {
2481
- const isEnterpriseInstall = params.get("is_enterprise_install") === "true";
2482
- return {
2483
- teamId: params.get("team_id") ?? void 0,
2484
- enterpriseId: params.get("enterprise_id") ?? void 0,
2485
- isEnterpriseInstall
2486
- };
2487
- }
2488
2554
  function installationFromInteractive(payload) {
2489
2555
  return { teamId: payload.team?.id ?? payload.user?.team_id };
2490
2556
  }
@@ -2494,17 +2560,24 @@ async function handleSlackForm(args) {
2494
2560
  const state = args.services.state ?? getStateAdapter();
2495
2561
  await state.connect();
2496
2562
  if (params.has("command") && !params.has("payload")) {
2497
- const installation = installationFromForm(params);
2563
+ const result = slackSlashCommandSchema.safeParse(Object.fromEntries(params));
2564
+ if (!result.success) return new Response("Invalid slash command payload", { status: 400 });
2565
+ const form = result.data;
2566
+ const installation = {
2567
+ teamId: form.team_id,
2568
+ enterpriseId: form.enterprise_id,
2569
+ isEnterpriseInstall: form.is_enterprise_install === "true"
2570
+ };
2498
2571
  enqueue(args.waitUntil, withLogContext({
2499
2572
  platform: "slack",
2500
- userId: params.get("user_id")?.trim() || void 0
2573
+ userId: form.user_id
2501
2574
  }, () => runWithWorkspaceTeamId(installation.teamId, () => runWithSlackInstallation({
2502
2575
  adapter,
2503
2576
  installation,
2504
2577
  state,
2505
2578
  task: () => handleSlashCommandForm({
2506
2579
  adapter,
2507
- params,
2580
+ form,
2508
2581
  state
2509
2582
  })
2510
2583
  })).catch((error) => {
@@ -2514,8 +2587,9 @@ async function handleSlackForm(args) {
2514
2587
  }
2515
2588
  const rawPayload = params.get("payload");
2516
2589
  if (!rawPayload) return new Response("Missing payload", { status: 400 });
2517
- const payload = parseJson(rawPayload);
2518
- if (!payload) return new Response("Invalid payload JSON", { status: 400 });
2590
+ const result = slackInteractivePayloadSchema.safeParse(parseJson(rawPayload));
2591
+ if (!result.success) return new Response("Invalid payload JSON", { status: 400 });
2592
+ const payload = result.data;
2519
2593
  const installation = installationFromInteractive(payload);
2520
2594
  enqueue(args.waitUntil, withLogContext({
2521
2595
  platform: "slack",
@@ -2547,12 +2621,10 @@ async function handleSlackWebhook(args) {
2547
2621
  services: args.services,
2548
2622
  waitUntil: args.waitUntil
2549
2623
  });
2550
- const parsed = parseJson(body);
2551
- if (!parsed) return new Response("Invalid JSON", { status: 400 });
2552
- if (parsed.type === "url_verification") {
2553
- const challenge = parsed.challenge;
2554
- return Response.json({ challenge });
2555
- }
2624
+ const result = slackEventEnvelopeSchema.safeParse(parseJson(body));
2625
+ if (!result.success) return new Response("Invalid JSON", { status: 400 });
2626
+ const parsed = result.data;
2627
+ if (parsed.type === "url_verification") return Response.json({ challenge: parsed.challenge });
2556
2628
  if (parsed.type === "event_callback") {
2557
2629
  const eventLogContext = slackEventLogContext(parsed.event);
2558
2630
  if (shouldPersistBeforeAck(parsed)) {
@@ -1,7 +1,7 @@
1
- import { r as completeObject } from "./client-C2WBBx7m.js";
1
+ import { r as completeObject } from "./client-Pcxo3lGn.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-DPbmIwjy.js";
4
- import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-DehgjkO5.js";
3
+ import { U as parseBriefInput, d as conversationDetailReportSchema, p as conversationEventPageSchema, z as briefCodeChangeSchema } from "./conversation-BnhOMfEB.js";
4
+ import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-CZIQcPHy.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-Bws6Rpsh.js").then((n) => n.r);
272
+ const { botConfig } = await import("./config-CYvEow1F.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-C6FHctIu.js";
2
+ import { t as createPluginCatalogRuntime } from "./registry-DM5aMhjm.js";
3
3
  //#region src/chat/plugins/catalog-runtime.ts
4
4
  var catalog_runtime_exports = /* @__PURE__ */ __exportAll({ pluginCatalogRuntime: () => pluginCatalogRuntime });
5
5
  const pluginCatalogRuntime = createPluginCatalogRuntime();
@@ -1,10 +1,10 @@
1
- import { i as completeText, m as escapeXml, o as resolveGatewayModel, p as unwrapCurrentInstruction } from "./client-C2WBBx7m.js";
2
- import { d as logException, o as getActiveTraceId, p as logWarn, t as buildTurnFailureResponse, v as setSpanAttributes } from "./logging-CvjMHRvg.js";
3
- import { n as botConfig } from "./config-Bws6Rpsh.js";
4
- import { _ as parseSlackMessageTs, f as toStoredSlackActor } from "./context-Bplcgypl.js";
5
- import { $t as bindProviderConversation, Bt as agentsInstructionsUpdatedEvent, Ht as authenticationUnlinkedEvent, Jt as getSqlExecutor, Kt as getConversationStore, Vt as authenticationLinkedEvent, Wt as getConversationEventStore, Xt as withConversationEventLock, Yt as createSqlConversationEventStore, tn as addAgentTurnUsage, zt as JUNIOR_NATIVE_EVENT_NAMESPACE } from "./agent-hooks-FUetyyLe.js";
6
- import { B as agentHistoryItemSchema, J as contextProvenance, X as instructionProvenanceFor, Y as instructionActors } from "./conversation-DPbmIwjy.js";
7
- import { D as fenceLock, O as withLock, T as MUTATION_LOCK_TTL_MS, k as sleep, w as getStateAdapter } from "./profile-dvV7PB7u.js";
1
+ import { i as completeText, m as escapeXml, o as resolveGatewayModel, p as unwrapCurrentInstruction } from "./client-Pcxo3lGn.js";
2
+ import { d as logException, o as getActiveTraceId, p as logWarn, t as buildTurnFailureResponse, v as setSpanAttributes } from "./logging-BPBx6WF-.js";
3
+ import { n as botConfig } from "./config-CYvEow1F.js";
4
+ import { b as parseSlackMessageTs, f as toStoredSlackActor } from "./context-0Et9iVSB.js";
5
+ import { Gt as JUNIOR_NATIVE_EVENT_NAMESPACE, Jt as authenticationUnlinkedEvent, Kt as agentsInstructionsUpdatedEvent, Qt as getConversationStore, Xt as getConversationEventStore, an as bindProviderConversation, en as getSqlExecutor, nn as withConversationEventLock, qt as authenticationLinkedEvent, sn as addAgentTurnUsage, tn as createSqlConversationEventStore } from "./agent-hooks-bEwEJhlg.js";
6
+ import { $ as contextProvenance, G as agentHistoryItemSchema, et as instructionActors, tt as instructionProvenanceFor } from "./conversation-BnhOMfEB.js";
7
+ import { D as fenceLock, O as withLock, T as MUTATION_LOCK_TTL_MS, k as sleep, w as getStateAdapter } from "./profile-upzC-wN1.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-DEF7auSj.js";
1
+ import { s as executeAgentRun, t as createAgentRunner } from "../agent-runner-BGDSjciH.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-FUetyyLe.js").then((n) => n.t),
104
- import("../catalog-runtime-BYGR3Dr4.js").then((n) => n.t),
105
- import("../validation-q2PFxkTQ.js").then((n) => n.r),
106
- import("../agent-hooks-FUetyyLe.js").then((n) => n.Ut)
103
+ import("../agent-hooks-bEwEJhlg.js").then((n) => n.t),
104
+ import("../catalog-runtime-Cw9V2jpn.js").then((n) => n.t),
105
+ import("../validation-BMig74Zp.js").then((n) => n.r),
106
+ import("../agent-hooks-bEwEJhlg.js").then((n) => n.Yt)
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-DEF7auSj.js").then((n) => n.r);
156
+ const { setExperimentalFeatures } = await import("../agent-runner-BGDSjciH.js").then((n) => n.r);
157
157
  setExperimentalFeatures({ subagents: true });
158
- const { setBriefsConfig } = await import("../agent-hooks-FUetyyLe.js").then((n) => n.m);
158
+ const { setBriefsConfig } = await import("../agent-hooks-bEwEJhlg.js").then((n) => n.m);
159
159
  setBriefsConfig({ enabled: true });
160
- const { runLocalAgentTurn } = await import("../runner-CzYEcB73.js");
161
- const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-Ds8M5FFX.js");
160
+ const { runLocalAgentTurn } = await import("../runner-Bu2wYpK8.js");
161
+ const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-CnF03VYh.js");
162
162
  const { createLocalOAuthState } = await import("../oauth-relay-CdCnu80W.js").then((n) => n.t);
163
- const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-BZOv0fns.js");
164
- const { bindSpawnAgent } = await import("../spawn-Ck3L0rEr.js").then((n) => n.n);
165
- const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-QrbHdXTc.js").then((n) => n.a);
163
+ const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-Dgerhizb.js");
164
+ const { bindSpawnAgent } = await import("../spawn-DRK9TBgY.js").then((n) => n.n);
165
+ const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-B9koS8sW.js").then((n) => n.a);
166
166
  const { createLocalConversationWork } = await import("../conversation-work-C6y3T5Hx.js");
167
- const { processConversationWork } = await import("../worker-r17aopXW.js").then((n) => n.n);
167
+ const { processConversationWork } = await import("../worker-C_iJSRgG.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-CvjMHRvg.js";
2
- import { f as parseInlinePluginManifest, p as parsePluginManifest } from "../registry-C6FHctIu.js";
3
- import { i as parseSkillFile } from "../skills-EhiVbjF4.js";
1
+ import { D as JUNIOR_HEARTBEAT_ROUTE, M as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, T as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-BPBx6WF-.js";
2
+ import { f as parseInlinePluginManifest, p as parsePluginManifest } from "../registry-DM5aMhjm.js";
3
+ import { i as parseSkillFile } from "../skills-CAI5s___.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-Cb4T2BUI.js")).runBriefs(argv);
28
+ return await (await import("../briefs-BkM_ZW4B.js")).runBriefs(argv);
29
29
  }
30
30
  function topLevelCommand(argv) {
31
31
  return (argv[0] === "--" ? argv.slice(1) : argv)[0];