@sentry/junior 0.275.0 → 0.276.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{adapter-dE2BiWP_.js → adapter-DoPR2jS-.js} +1 -1
- package/dist/{admin-CkPaAYuZ.js → admin-BJTT-kXb.js} +1 -1
- package/dist/{agent-invocations-C1RNOCs8.js → agent-invocations-CUWrrzkc.js} +1 -0
- package/dist/{agent-runner-bE7aH7ew.js → agent-runner-sMpA5qGM.js} +266 -202
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +3 -3
- package/dist/api.d.ts +1 -1
- package/dist/api.js +75 -66
- package/dist/{app-CgkquhZ8.d.ts → app-DTj-yAQt.d.ts} +10 -2
- package/dist/app.d.ts +1 -1
- package/dist/app.js +192 -86
- package/dist/{assistant-reply-CjRU9Z59.js → assistant-reply-DbxKnBQF.js} +1 -1
- package/dist/{automation-BGrd03QO.js → automation-B8_mC68r.js} +42 -13
- package/dist/{background-compaction-queue-BYuOt3qK.js → background-compaction-queue-Bywqo1WJ.js} +2 -2
- package/dist/{briefs-6xUvmGos.js → briefs-IL7QnCCR.js} +4 -4
- package/dist/{catalog-runtime-DcJ5NHDW.js → catalog-runtime--sC2CYLQ.js} +1 -1
- package/dist/cli/chat.js +14 -14
- package/dist/cli/check.js +3 -3
- package/dist/cli/main.js +3 -3
- package/dist/cli/plugins.js +4 -4
- package/dist/cli/snapshot-create.js +4 -4
- package/dist/cli/upgrade.d.ts +1 -1
- package/dist/cli/upgrade.js +3 -3
- package/dist/{client-gnKpkpqP.js → client-7diKvInp.js} +2 -2
- package/dist/{config-D0GKc9sC.js → config-Cb--cuv-.js} +2 -2
- package/dist/{connections-DLqP5Bp1.js → connections-C4-4fxaE.js} +14 -14
- package/dist/{conversation-BjTo9ZFL.js → conversation-DppJ83Hw.js} +32 -7
- package/dist/{conversation-privacy-BCXFshP9.js → conversation-privacy-DTwdT3Pi.js} +1 -1
- package/dist/{credential-sync-BjihXFF2.js → credential-sync-Sl5RQCkS.js} +13 -13
- package/dist/{db-BMZhoYKj.d.ts → db-Ck6TXQIx.d.ts} +1 -1
- package/dist/{executor-j8VMt-To.js → executor-BFKmqxYe.js} +3 -3
- package/dist/instrumentation.d.ts +14 -0
- package/dist/instrumentation.js +29 -6
- package/dist/{logging-CFHIO4Vs.js → logging-B04X_eCB.js} +1 -1
- package/dist/{message-DH0cqFRS.js → message-DQMFyyE-.js} +9 -9
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-callback-server-BgU4EZsJ.js → oauth-callback-server-BGq0_vQI.js} +2 -2
- package/dist/{projection-CTvLSwcm.js → projection-6dXaN0n-.js} +99 -17
- package/dist/{prompt-JEWUUpLW.js → prompt-B4fQKGZR.js} +1 -1
- package/dist/{registry-OsyWR4GO.js → registry-CEqKR_ld.js} +1 -1
- package/dist/{resolve-DCrKjmVP.js → resolve-8I5DkrfI.js} +3 -3
- package/dist/{result-Btdt5bSl.js → result-BgAW90IM.js} +9 -9
- package/dist/{runner-C1AwS93W.js → runner-CSKDr_19.js} +12 -12
- package/dist/{sandbox-egress-signals-C-5i7Zxm.js → sandbox-egress-signals-BxAT276e.js} +1 -1
- package/dist/{schema-DfdHlBnb.d.ts → schema-CaUWl2EV.d.ts} +74 -6
- package/dist/{schema-CX9XGKCm.js → schema-Cal-EFdi.js} +9 -7
- package/dist/{service-account-CQIW6At4.js → service-account-CUuVJCKT.js} +3 -3
- package/dist/{service-account-DZX1KlQl.js → service-account-CtOab1Xz.js} +3 -3
- package/dist/{session-stop-DjIyORJw.js → session-stop-DK8LuPZW.js} +155 -54
- package/dist/{skills-BEfAAT6p.js → skills-Bc0D7BGy.js} +2 -2
- package/dist/{spawn-Dgj4xxvO.js → spawn-DF_GUcd8.js} +2 -2
- package/dist/{stop-DomyNvuv.js → stop-DthSy-z8.js} +130 -81
- package/dist/{store-Dp3RMEQd.js → store-BgH2P3X9.js} +3 -3
- package/dist/{store-B7Z6zIc7.js → store-C5uVTx2G.js} +11 -9
- package/dist/{task-queue-CVQ9cWnC.js → task-queue-C6ROM_XJ.js} +3 -3
- package/dist/{task-runner-DHBG47gS.js → task-runner-BwAkjjVE.js} +6 -6
- package/dist/{thread-state-BF8VwIxd.js → thread-state-BXjgk1pW.js} +4 -4
- package/dist/{turn-failure-response-Di7TbgsF.js → turn-failure-response-CVI57qKL.js} +7 -7
- package/dist/{turn-lifecycle-DzXwXmLg.js → turn-lifecycle-CF6ibonp.js} +6 -1
- package/dist/{turn-session-routing-CIWhXKeT.js → turn-session-routing-DddybdNu.js} +17 -16
- package/dist/{validation-BRmwRaXc.js → validation-BxF1nQbC.js} +1 -1
- package/dist/{version-DBVMsgvA.js → version-CTzSbCmR.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-BFADRGP8.js → viewer-CQwBszc7.js} +10 -7
- package/dist/{work-DDaoxZAw.js → work-BHlShEQ6.js} +30 -12
- package/dist/{worker-Bub0fDtW.js → worker-DhY9MnsH.js} +6 -6
- package/migrations/0073_conversation_quick_question.sql +1 -0
- package/migrations/meta/0073_snapshot.json +4070 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +6 -5
package/dist/app.js
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { d as restoreRuntimeConfig, f as setBotModelConfig, g as snapshotRuntimeConfig, h as setSlackReactionConfig, i as getChatConfig, m as setRuntimeLimits, n as botConfig, o as getSlackBotToken, p as setProfiles, u as resetRuntimeConfig } from "./config-
|
|
3
|
-
import { D as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, E as withSpan, P as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, T as withLogContext, V as normalizeIdentityEmail, b as setSpanAttributes, h as logWarn, j as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, m as logInfo, p as logException, r as createRequestContext, w as withContext, z as GOOGLE_IDENTITY_PROVIDER } from "./logging-
|
|
1
|
+
import { $a as listConversationAnnotations, Aa as createPluginLogger, Bi as takeDueTimerWatches, Bn as getPlugins, C as projectConversationMessages, Da as createPluginState, Dn as createUserTokenStore, E as settleConversationTitleWork, En as setExperimentalFeatures, Et as isInvalidConversationRecordError, Fn as getPluginRoutes, Fr as proxyVercelSandboxEgressRequest, Gi as verifyScheduledAutomationCredentialSubject, Gn as setBriefsConfig, Gr as slackMention, Ha as readConversationEventPage, Hi as bindScheduledAutomationCredentialSubject, Hn as validatePlugins, Ki as verifySlackDirectCredentialSubject, Li as findMatchingWatches, Ni as collectEventMatchKeys, Oa as createPluginEmbedder, Pn as getPluginApiRoutes, Pr as isVercelSandboxEgressRequest, Qi as getSlackClient, Qr as postSlackEphemeralMessage, Tn as isExperimentalFeatureEnabled, Ui as bindSlackDirectCredentialSubject, Vi as bindEventAutomationCredentialSubject, Vn as setPlugins, Wi as verifyEventAutomationCredentialSubject, Xa as resolveRootVisibility, Yn as dismissOpenReviewItems, Zr as openSlackModal, _i as parseSandboxEgressCredentialToken, _n as getThreadStopDecision, aa as getWorkspaceTeamId, ar as canActOnReviewItem, b as appendConversationMessages, ca as getDashboardConversationLink, ct as CONVERSATION_WORK_STALE_ENQUEUE_MS, da as getDashboardTaskLink, ea as isDmChannel, fa as setDashboardConversationLinkOptions, fo as getConfigDefaults, fr as reviewItemReaderForUser, hi as consumeSandboxEgressPermissionDeniedSignal, ii as slackExternalRefIdSchema, io as createPluginCache, ja as readConversationAccessFromSql, mi as consumeSandboxEgressAuthRequiredSignal, mn as SubscribedReplyReason, oa as runWithWorkspaceTeamId, pi as clearSandboxEgressSignals, po as setConfigDefaults, ri as slackEntitySchema, tr as searchReviewItems, ua as getDashboardReviewItemLink, wn as getExperimentalFeatures, wt as hasRunnableConversationWork, xi as normalizeSandboxEgressTracePropagationDomains, zr as resolveBaseUrl } from "./projection-6dXaN0n-.js";
|
|
2
|
+
import { d as restoreRuntimeConfig, f as setBotModelConfig, g as snapshotRuntimeConfig, h as setSlackReactionConfig, i as getChatConfig, m as setRuntimeLimits, n as botConfig, o as getSlackBotToken, p as setProfiles, u as resetRuntimeConfig } from "./config-Cb--cuv-.js";
|
|
3
|
+
import { D as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, E as withSpan, P as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, T as withLogContext, V as normalizeIdentityEmail, b as setSpanAttributes, h as logWarn, j as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, m as logInfo, p as logException, r as createRequestContext, w as withContext, z as GOOGLE_IDENTITY_PROVIDER } from "./logging-B04X_eCB.js";
|
|
4
4
|
import { n as captureMessage } from "./sentry-MDkYAVPV.js";
|
|
5
|
-
import { t as JUNIOR_VERSION } from "./version-
|
|
5
|
+
import { t as JUNIOR_VERSION } from "./version-CTzSbCmR.js";
|
|
6
6
|
import { _ as slackMessageTsSchema, f as parseSlackTeamId, g as slackMessageTsFromMs, h as parseSlackMessageTs, m as slackChannelIdSchema, n as createSlackActor, p as parseSlackUserId, s as parseActorUserId, u as parseSlackChannelId } from "./actor-B4DYygOB.js";
|
|
7
|
-
import { C as getSqlExecutor, E as withConversationEventLock, N as resolveActorIdentityId, S as getDb, _ as closeDb, g as createCache, i as readActorIdentity, k as withConversationMutationLock, l as resolveViewerUser, p as parseAvatarUrl, x as getConversationStore, y as getConversationEventStore, z as recordGoogleSignIn } from "./viewer-
|
|
8
|
-
import { a as juniorAgentInvocations, d as juniorDestinations, i as juniorAgentBindings, s as juniorConversations } from "./agent-invocations-
|
|
9
|
-
import { _ as juniorConversationBriefs, b as juniorConversationEvents, c as juniorReviewItems, d as juniorAutomations, l as juniorAutomationRuns } from "./executor-
|
|
10
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime
|
|
11
|
-
import { $ as readViewerAutomations, A as runWithSlackInstallation, B as logScheduledAutomationRunSkipped, C as readSlackReviewItemCardConversationId, D as parseSlackReviewItemClick, Dt as
|
|
7
|
+
import { C as getSqlExecutor, E as withConversationEventLock, N as resolveActorIdentityId, S as getDb, _ as closeDb, g as createCache, i as readActorIdentity, k as withConversationMutationLock, l as resolveViewerUser, p as parseAvatarUrl, x as getConversationStore, y as getConversationEventStore, z as recordGoogleSignIn } from "./viewer-CQwBszc7.js";
|
|
8
|
+
import { a as juniorAgentInvocations, d as juniorDestinations, i as juniorAgentBindings, s as juniorConversations } from "./agent-invocations-CUWrrzkc.js";
|
|
9
|
+
import { _ as juniorConversationBriefs, b as juniorConversationEvents, c as juniorReviewItems, d as juniorAutomations, l as juniorAutomationRuns } from "./executor-BFKmqxYe.js";
|
|
10
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime--sC2CYLQ.js";
|
|
11
|
+
import { $ as readViewerAutomations, A as runWithSlackInstallation, B as logScheduledAutomationRunSkipped, C as readSlackReviewItemCardConversationId, D as parseSlackReviewItemClick, Dt as processWorkspaceSnapshotJob, E as buildSlackReviewItemModal, L as joinPublicChannel, M as parseSlackThreadId, O as parseSlackReviewItemFormTarget, Ot as ingestEvent, S as createSlackReviewItemShow, V as scheduledAutomationRunAttributes, Y as readViewerAutomationExecutions, Z as readViewerAutomationSummary, _ as readPublicArtifact, _t as requestAttachmentDeletion, at as reviewItemChangeRecord, bt as stopConversationSession, ct as conversationTurnIdForMessage, dt as recordWebConversationActivity, ft as webActorFromUser, g as publicArtifactHeaders, ht as collectAttachmentGarbage, it as renderReviewItemMessage, j as verifySlackSignature, k as parseSlackUserInputSubmission, n as executeAgentRun, q as ViewerTaskNotFoundError, r as processBackgroundCompaction, rt as deliverReviewItemChange, st as appendAndEnqueueWebMessage, t as createAgentRunner, tt as effectiveTaskOutcomes, v as unpublishedArtifactHeaders, w as syncReviewItemSlackCards, xt as recordSubagentEnded, y as lookupSlackUserProfile } from "./agent-runner-sMpA5qGM.js";
|
|
12
12
|
import { a as withLock, i as fenceLock, n as MUTATION_LOCK_TTL_MS } from "./locks-D-0h111u.js";
|
|
13
|
-
import { r as getStateAdapter, t as disconnectStateAdapter } from "./adapter-
|
|
13
|
+
import { r as getStateAdapter, t as disconnectStateAdapter } from "./adapter-DoPR2jS-.js";
|
|
14
14
|
import { n as getNextRunAtMs } from "./cadence-R7Em4RjE.js";
|
|
15
|
-
import { D as conversationSurfaceSchema,
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
15
|
+
import { D as conversationSurfaceSchema, R as annotationCard, T as conversationReportStatusSchema, X as conversationBriefSchema, h as conversationFeedQuerySchema } from "./conversation-DppJ83Hw.js";
|
|
16
|
+
import { S as listPendingAgentInvocationResults, x as listPendingAgentInvocationMailboxAppends } from "./store-C5uVTx2G.js";
|
|
17
|
+
import { A as renderSlackObjectCard, T as renderTaskInput, d as getEventCatalog, f as SLACK_EVENT_NAMESPACE, g as slackChannelMessageRunsAutomation, h as slackChannelMessageReplyThreadTs, m as slackChannelMessageEvent } from "./session-stop-DK8LuPZW.js";
|
|
18
18
|
import { h as buttonUserInputField } from "./reporting-window-DgHgwQB3.js";
|
|
19
|
-
import { c as setSandboxResourceConfig, o as getSandboxResourceConfig } from "./resolve-
|
|
20
|
-
import { a as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC, b as isConversationQueueMessageRejectedError, c as verifyWorkspaceSnapshotJobMessage, d as verifyConversationQueueMessage, h as getQueueProvider, i as verifyBackgroundCompactionMessage, l as getVercelConversationWorkQueue, r as vercelBackgroundCompactionQueue, t as BACKGROUND_COMPACTION_QUEUE_TOPIC, u as resolveConversationWorkQueueTopic, y as conversationQueueMessageSchema } from "./background-compaction-queue-
|
|
21
|
-
import { S as removeActiveConversation, _ as hasRunnableConversationWork$1, c as clearExpiredConversationLease, g as getConversationWorkState, h as getConversation, m as ensureConversationWake, r as appendAndEnqueueInboundMessage, v as listActiveConversationIds } from "./store-
|
|
22
|
-
import { B as readScheduledAutomation, G as blockEventAutomation, H as saveScheduledAutomationInLock, K as collectEventAutomationMatchKeys, M as recordAutomationExecution, R as listScheduledAutomationsForTeam, S as existingConversationId, U as scheduledRunId, W as withScheduledAutomationLock, Y as findMatchingEventAutomations, a as confirmDispatchMailboxAppend, b as notifyAutomationBlocked, f as getPluginDispatchProjection, ht as eventGuidance, it as automationVersionOf, m as listPendingDispatchMailboxAppends, nt as eventAutomationRunLimitReason, o as createOrGetDispatch, p as isTerminalDispatchStatus, r as buildDispatchId, s as getDispatchConversationId, tt as admitEventAutomationRun, u as getDispatchRecord, v as markDispatchFailed } from "./turn-session-routing-
|
|
23
|
-
import { M as scheduledRunSchema, l as automationListQuerySchema, s as automationExecutionStatusSchema } from "./automation-
|
|
24
|
-
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-
|
|
19
|
+
import { c as setSandboxResourceConfig, o as getSandboxResourceConfig } from "./resolve-8I5DkrfI.js";
|
|
20
|
+
import { a as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC, b as isConversationQueueMessageRejectedError, c as verifyWorkspaceSnapshotJobMessage, d as verifyConversationQueueMessage, h as getQueueProvider, i as verifyBackgroundCompactionMessage, l as getVercelConversationWorkQueue, r as vercelBackgroundCompactionQueue, t as BACKGROUND_COMPACTION_QUEUE_TOPIC, u as resolveConversationWorkQueueTopic, y as conversationQueueMessageSchema } from "./background-compaction-queue-Bywqo1WJ.js";
|
|
21
|
+
import { S as removeActiveConversation, _ as hasRunnableConversationWork$1, c as clearExpiredConversationLease, g as getConversationWorkState, h as getConversation, m as ensureConversationWake, r as appendAndEnqueueInboundMessage, v as listActiveConversationIds } from "./store-BgH2P3X9.js";
|
|
22
|
+
import { B as readScheduledAutomation, G as blockEventAutomation, H as saveScheduledAutomationInLock, K as collectEventAutomationMatchKeys, M as recordAutomationExecution, R as listScheduledAutomationsForTeam, S as existingConversationId, U as scheduledRunId, W as withScheduledAutomationLock, Y as findMatchingEventAutomations, a as confirmDispatchMailboxAppend, b as notifyAutomationBlocked, f as getPluginDispatchProjection, ht as eventGuidance, it as automationVersionOf, m as listPendingDispatchMailboxAppends, nt as eventAutomationRunLimitReason, o as createOrGetDispatch, p as isTerminalDispatchStatus, r as buildDispatchId, s as getDispatchConversationId, tt as admitEventAutomationRun, u as getDispatchRecord, v as markDispatchFailed } from "./turn-session-routing-DddybdNu.js";
|
|
23
|
+
import { M as scheduledRunSchema, l as automationListQuerySchema, s as automationExecutionStatusSchema } from "./automation-B8_mC68r.js";
|
|
24
|
+
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-BxF1nQbC.js";
|
|
25
25
|
import { a as pluginRuntimeRegistrationsFromPluginSet, n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "./plugins-DOm9Y6qI.js";
|
|
26
|
-
import { A as
|
|
27
|
-
import { n as enqueueAgentInvocationResult, o as getAuthPausedConversationTurnId } from "./result-
|
|
28
|
-
import {
|
|
29
|
-
import { o as coerceThreadConversationState } from "./thread-state-
|
|
30
|
-
import { o as unlinkProvider } from "./connections-
|
|
31
|
-
import { a as GET$4, i as publishAppHomeView, r as GET$5, t as receiveLocalOAuthCredential } from "./credential-sync-
|
|
32
|
-
import { a as pluginTaskQueueConsumer, c as queueCallback, n as createVercelPluginTaskCallback, o as registerVercelPluginTaskDevConsumer } from "./task-queue-
|
|
33
|
-
import { t as processConversationWork } from "./worker-
|
|
34
|
-
import { t as bindMessageAgent } from "./message-
|
|
35
|
-
import { t as bindSpawnAgent } from "./spawn-
|
|
36
|
-
import { t as processPluginTask } from "./task-runner-
|
|
26
|
+
import { A as resolveAllowedDomains, B as bindMessageAuthorIdentityId, C as createProductionSlackWebhookServices, D as isAllowedDomain, E as assertNoLegacyAllowedDomains, F as stopSlackThread, G as actOnReviewItem, H as stripLeadingBotMention, I as normalizeIncomingSlackThreadId, J as reviewItemChange, K as closeReviewItemsAnsweredByReply, L as withNormalizedThreadId, M as buildSlackInboundMessage, N as clearSlackPendingReactions, O as isAllowedSignInEmail, P as isSlackMessageStopped, Q as GET$3, R as stopConversationTurn, S as createProductionConversationWorkOptions, T as createSlackWebApiStatusSender, U as parseContent, V as startProcessingReaction, W as ReviewItemActionError, Y as getAttachmentStorage, Z as enqueueAgentDispatch, _ as encodeConversationCursor, g as decodeConversationCursor, j as recordSkippedConversationMessage, k as readEnvList, n as readConversationDetail, o as readConversationFeed, q as readReviewItemForUser, s as readConversationRecordFromSql, t as stopConversationTurnForViewer, v as archiveConversation, w as getProductionSlackAdapter, z as THREAD_OPTOUT_ACK } from "./stop-DthSy-z8.js";
|
|
27
|
+
import { n as enqueueAgentInvocationResult, o as getAuthPausedConversationTurnId } from "./result-BgAW90IM.js";
|
|
28
|
+
import { i as enqueueAgentInvocation, r as endAgentInvocationsOfStoppedWork } from "./work-BHlShEQ6.js";
|
|
29
|
+
import { o as coerceThreadConversationState } from "./thread-state-BXjgk1pW.js";
|
|
30
|
+
import { o as unlinkProvider } from "./connections-C4-4fxaE.js";
|
|
31
|
+
import { a as GET$4, i as publishAppHomeView, r as GET$5, t as receiveLocalOAuthCredential } from "./credential-sync-Sl5RQCkS.js";
|
|
32
|
+
import { a as pluginTaskQueueConsumer, c as queueCallback, n as createVercelPluginTaskCallback, o as registerVercelPluginTaskDevConsumer } from "./task-queue-C6ROM_XJ.js";
|
|
33
|
+
import { t as processConversationWork } from "./worker-DhY9MnsH.js";
|
|
34
|
+
import { t as bindMessageAgent } from "./message-DQMFyyE-.js";
|
|
35
|
+
import { t as bindSpawnAgent } from "./spawn-DF_GUcd8.js";
|
|
36
|
+
import { t as processPluginTask } from "./task-runner-BwAkjjVE.js";
|
|
37
37
|
import { createRequire } from "node:module";
|
|
38
38
|
import { Hono } from "hono";
|
|
39
39
|
import { createHash, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
|
|
@@ -128,6 +128,7 @@ async function recoverConversationWork(args) {
|
|
|
128
128
|
}
|
|
129
129
|
if (work.execution.lease && work.execution.lease.expiresAtMs <= args.nowMs) {
|
|
130
130
|
const recovery = await clearExpiredConversationLease({
|
|
131
|
+
beforeWorkStops: args.beforeWorkStops,
|
|
131
132
|
conversationId,
|
|
132
133
|
nowMs: args.nowMs,
|
|
133
134
|
state: args.state
|
|
@@ -1103,6 +1104,7 @@ async function recoverPendingAgentInvocationResults(args) {
|
|
|
1103
1104
|
async function runHeartbeat(args) {
|
|
1104
1105
|
const queue = args.conversationWorkQueue ?? getVercelConversationWorkQueue();
|
|
1105
1106
|
await recoverConversationWork({
|
|
1107
|
+
beforeWorkStops: endAgentInvocationsOfStoppedWork,
|
|
1106
1108
|
nowMs: args.nowMs,
|
|
1107
1109
|
queue
|
|
1108
1110
|
});
|
|
@@ -1852,7 +1854,7 @@ async function act(args) {
|
|
|
1852
1854
|
text: renderReviewItemMessage(item, change),
|
|
1853
1855
|
threadTs: target.threadTs,
|
|
1854
1856
|
userId: actor.slackUserId
|
|
1855
|
-
}));
|
|
1857
|
+
}), { reviewItemChange: reviewItemChangeRecord(item, change) });
|
|
1856
1858
|
} catch (error) {
|
|
1857
1859
|
logException(error, "review_item.slack_input.persist.failed", { "app.review_item.id": item.id });
|
|
1858
1860
|
await deliverReviewItemChange({
|
|
@@ -2063,7 +2065,7 @@ async function handleSlackForm(args) {
|
|
|
2063
2065
|
adapter,
|
|
2064
2066
|
payload,
|
|
2065
2067
|
isAuthorAllowed: (userId) => args.isAuthorAllowed(userId, installation),
|
|
2066
|
-
persistMessage: (message) => args.persistMessage(message, installation),
|
|
2068
|
+
persistMessage: (message, facts) => args.persistMessage(message, installation, facts),
|
|
2067
2069
|
queue: args.queue,
|
|
2068
2070
|
state,
|
|
2069
2071
|
userTokenStore: args.getUserTokenStore()
|
|
@@ -2073,6 +2075,32 @@ async function handleSlackForm(args) {
|
|
|
2073
2075
|
})));
|
|
2074
2076
|
return new Response("", { status: 200 });
|
|
2075
2077
|
}
|
|
2078
|
+
// src/chat/ingress/slack-message-subtypes.ts
|
|
2079
|
+
const IGNORED_MESSAGE_SUBTYPES = /* @__PURE__ */ new Set([
|
|
2080
|
+
"message_changed",
|
|
2081
|
+
"message_deleted",
|
|
2082
|
+
"message_replied",
|
|
2083
|
+
"channel_join",
|
|
2084
|
+
"channel_leave",
|
|
2085
|
+
"channel_topic",
|
|
2086
|
+
"channel_purpose",
|
|
2087
|
+
"channel_name",
|
|
2088
|
+
"channel_archive",
|
|
2089
|
+
"channel_unarchive",
|
|
2090
|
+
"group_join",
|
|
2091
|
+
"group_leave",
|
|
2092
|
+
"group_topic",
|
|
2093
|
+
"group_purpose",
|
|
2094
|
+
"group_name",
|
|
2095
|
+
"group_archive",
|
|
2096
|
+
"group_unarchive",
|
|
2097
|
+
"ekm_access_denied",
|
|
2098
|
+
"tombstone"
|
|
2099
|
+
]);
|
|
2100
|
+
/** Whether ingress ignores a Slack message event for its subtype. */
|
|
2101
|
+
function shouldIgnoreMessageSubtype(event) {
|
|
2102
|
+
return Boolean(event.subtype && IGNORED_MESSAGE_SUBTYPES.has(event.subtype));
|
|
2103
|
+
}
|
|
2076
2104
|
// src/chat/ingress/slack-channel-created.ts
|
|
2077
2105
|
const slackChannelCreatedEnvelopeSchema = z.object({
|
|
2078
2106
|
type: z.literal("event_callback"),
|
|
@@ -2471,27 +2499,6 @@ function slackEventLogContext(event) {
|
|
|
2471
2499
|
userId: event?.user?.trim() || void 0
|
|
2472
2500
|
};
|
|
2473
2501
|
}
|
|
2474
|
-
const IGNORED_MESSAGE_SUBTYPES = /* @__PURE__ */ new Set([
|
|
2475
|
-
"message_changed",
|
|
2476
|
-
"message_deleted",
|
|
2477
|
-
"message_replied",
|
|
2478
|
-
"channel_join",
|
|
2479
|
-
"channel_leave",
|
|
2480
|
-
"channel_topic",
|
|
2481
|
-
"channel_purpose",
|
|
2482
|
-
"channel_name",
|
|
2483
|
-
"channel_archive",
|
|
2484
|
-
"channel_unarchive",
|
|
2485
|
-
"group_join",
|
|
2486
|
-
"group_leave",
|
|
2487
|
-
"group_topic",
|
|
2488
|
-
"group_purpose",
|
|
2489
|
-
"group_name",
|
|
2490
|
-
"group_archive",
|
|
2491
|
-
"group_unarchive",
|
|
2492
|
-
"ekm_access_denied",
|
|
2493
|
-
"tombstone"
|
|
2494
|
-
]);
|
|
2495
2502
|
function enqueue(waitUntil, task) {
|
|
2496
2503
|
waitUntil(task);
|
|
2497
2504
|
}
|
|
@@ -2515,9 +2522,6 @@ function installationFromEnvelope(body) {
|
|
|
2515
2522
|
function isDmEvent(event) {
|
|
2516
2523
|
return event.channel_type === "im" || event.channel?.startsWith("D") === true;
|
|
2517
2524
|
}
|
|
2518
|
-
function shouldIgnoreMessageSubtype(event) {
|
|
2519
|
-
return Boolean(event.subtype && IGNORED_MESSAGE_SUBTYPES.has(event.subtype));
|
|
2520
|
-
}
|
|
2521
2525
|
function normalizeMessageThreadId(message) {
|
|
2522
2526
|
const threadId = normalizeIncomingSlackThreadId(message.threadId, message);
|
|
2523
2527
|
return {
|
|
@@ -2578,6 +2582,7 @@ async function persistSlackMessage(args) {
|
|
|
2578
2582
|
const inbound = buildSlackInboundMessage({
|
|
2579
2583
|
conversationId,
|
|
2580
2584
|
installation: args.installation,
|
|
2585
|
+
reviewItemChange: args.facts?.reviewItemChange,
|
|
2581
2586
|
message: args.message,
|
|
2582
2587
|
receivedAtMs: args.receivedAtMs,
|
|
2583
2588
|
route: args.route,
|
|
@@ -2937,6 +2942,7 @@ async function persistSlackMentionWithLock(args) {
|
|
|
2937
2942
|
try {
|
|
2938
2943
|
if (!(await withLock(args.state, `slack:ingress:${threadId}`, () => persistSlackMessage({
|
|
2939
2944
|
adapter: args.adapter,
|
|
2945
|
+
facts: args.facts,
|
|
2940
2946
|
installation: args.installation,
|
|
2941
2947
|
message,
|
|
2942
2948
|
conversationStore: args.services.conversationStore,
|
|
@@ -2978,8 +2984,9 @@ async function handleSlackWebhook(args) {
|
|
|
2978
2984
|
teamId: installation.teamId,
|
|
2979
2985
|
user: userId
|
|
2980
2986
|
}),
|
|
2981
|
-
persistMessage: (message, installation) => persistSlackMentionWithLock({
|
|
2987
|
+
persistMessage: (message, installation, facts) => persistSlackMentionWithLock({
|
|
2982
2988
|
adapter,
|
|
2989
|
+
facts,
|
|
2983
2990
|
installation,
|
|
2984
2991
|
message,
|
|
2985
2992
|
services: args.services,
|
|
@@ -3360,9 +3367,6 @@ function createEventAppPublisher(args) {
|
|
|
3360
3367
|
}
|
|
3361
3368
|
// src/api/acp/conversations.ts
|
|
3362
3369
|
const EVENT_PAGE_SIZE = 50;
|
|
3363
|
-
function actorFromUser(user) {
|
|
3364
|
-
return webActorFromEmail(user.email, user.displayName ? { fullName: user.displayName } : void 0);
|
|
3365
|
-
}
|
|
3366
3370
|
async function hasConversationAccess(conversationId, user) {
|
|
3367
3371
|
const access = (await readConversationAccessFromSql(getDb(), [conversationId], user)).get(conversationId);
|
|
3368
3372
|
return Boolean(access?.isParticipant);
|
|
@@ -3404,7 +3408,7 @@ function createAcpConversations(options) {
|
|
|
3404
3408
|
},
|
|
3405
3409
|
async create({ conversationId, user }) {
|
|
3406
3410
|
await recordWebConversationActivity({
|
|
3407
|
-
actor:
|
|
3411
|
+
actor: webActorFromUser(user),
|
|
3408
3412
|
conversationId,
|
|
3409
3413
|
conversationStore: options.conversationStore,
|
|
3410
3414
|
nowMs: Date.now(),
|
|
@@ -3419,7 +3423,7 @@ function createAcpConversations(options) {
|
|
|
3419
3423
|
const currentCursor = await latestEventCursor(options.eventStore, conversationId);
|
|
3420
3424
|
if (await getAuthPausedConversationTurnId(conversationId)) return { status: "active" };
|
|
3421
3425
|
const result = await appendAndEnqueueWebMessage({
|
|
3422
|
-
actor:
|
|
3426
|
+
actor: webActorFromUser(user),
|
|
3423
3427
|
conversationId,
|
|
3424
3428
|
idempotencyKey,
|
|
3425
3429
|
message: text
|
|
@@ -4979,9 +4983,106 @@ function requestHasSameOrigin(request) {
|
|
|
4979
4983
|
const origin = request.headers.get("origin");
|
|
4980
4984
|
return origin !== null && URL.parse(origin)?.origin === new URL(request.url).origin;
|
|
4981
4985
|
}
|
|
4986
|
+
const PAGE_STYLE = `
|
|
4987
|
+
:root {
|
|
4988
|
+
color-scheme: dark;
|
|
4989
|
+
--bg: #060607;
|
|
4990
|
+
--panel: #0c0c0e;
|
|
4991
|
+
--raised: #101013;
|
|
4992
|
+
--hover: #17171a;
|
|
4993
|
+
--text: #f4f4f5;
|
|
4994
|
+
--muted: #a1a1aa;
|
|
4995
|
+
--faint: #8a8a93;
|
|
4996
|
+
--solid: #ffffff;
|
|
4997
|
+
--subtle: #c4c4cc;
|
|
4998
|
+
--inverse: #000000;
|
|
4999
|
+
--focus: #beaaff;
|
|
5000
|
+
--border: rgb(255 255 255 / 0.08);
|
|
5001
|
+
--border-emphasis: rgb(255 255 255 / 0.15);
|
|
5002
|
+
--border-heavy: rgb(255 255 255 / 0.3);
|
|
5003
|
+
--warning-bg: rgb(251 191 36 / 0.08);
|
|
5004
|
+
--warning-border: rgb(251 191 36 / 0.3);
|
|
5005
|
+
--warning-text: #fcd34d;
|
|
5006
|
+
--shadow: 0 16px 40px rgb(0 0 0 / 0.5);
|
|
5007
|
+
}
|
|
5008
|
+
@media (prefers-color-scheme: light) {
|
|
5009
|
+
:root {
|
|
5010
|
+
color-scheme: light;
|
|
5011
|
+
--bg: #ffffff;
|
|
5012
|
+
--panel: #f9f9fa;
|
|
5013
|
+
--raised: #ffffff;
|
|
5014
|
+
--hover: #f1f1f3;
|
|
5015
|
+
--text: #18181b;
|
|
5016
|
+
--muted: #52525b;
|
|
5017
|
+
--faint: #71717a;
|
|
5018
|
+
--solid: #09090b;
|
|
5019
|
+
--subtle: #3f3f46;
|
|
5020
|
+
--inverse: #ffffff;
|
|
5021
|
+
--focus: #7553ff;
|
|
5022
|
+
--border: rgb(0 0 0 / 0.09);
|
|
5023
|
+
--border-emphasis: rgb(0 0 0 / 0.16);
|
|
5024
|
+
--border-heavy: rgb(0 0 0 / 0.32);
|
|
5025
|
+
--warning-bg: rgb(245 158 11 / 0.1);
|
|
5026
|
+
--warning-border: rgb(217 119 6 / 0.35);
|
|
5027
|
+
--warning-text: #92400e;
|
|
5028
|
+
--shadow: 0 16px 40px rgb(0 0 0 / 0.08);
|
|
5029
|
+
}
|
|
5030
|
+
}
|
|
5031
|
+
* { box-sizing: border-box; }
|
|
5032
|
+
body {
|
|
5033
|
+
margin: 0;
|
|
5034
|
+
min-height: 100vh;
|
|
5035
|
+
display: grid;
|
|
5036
|
+
place-items: center;
|
|
5037
|
+
padding: 24px 16px;
|
|
5038
|
+
background: var(--bg);
|
|
5039
|
+
color: var(--text);
|
|
5040
|
+
font: 16px/1.5 Inter, -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
|
|
5041
|
+
}
|
|
5042
|
+
main {
|
|
5043
|
+
width: 100%;
|
|
5044
|
+
max-width: 28rem;
|
|
5045
|
+
padding: 32px;
|
|
5046
|
+
border: 1px solid var(--border);
|
|
5047
|
+
border-radius: 12px;
|
|
5048
|
+
background: var(--panel);
|
|
5049
|
+
box-shadow: var(--shadow);
|
|
5050
|
+
}
|
|
5051
|
+
h1, h2 { font-family: Outfit, "Avenir Next", Avenir, "Segoe UI", system-ui, sans-serif; }
|
|
5052
|
+
h1 { margin: 0 0 8px; font-size: 1.5rem; line-height: 1.25; font-weight: 600; text-wrap: balance; overflow-wrap: anywhere; }
|
|
5053
|
+
h2 { margin: 24px 0 8px; font-size: 0.875rem; line-height: 1.35; font-weight: 600; color: var(--subtle); }
|
|
5054
|
+
p { margin: 0 0 16px; color: var(--muted); text-wrap: pretty; }
|
|
5055
|
+
p:last-child { margin-bottom: 0; }
|
|
5056
|
+
strong { color: var(--text); font-weight: 600; }
|
|
5057
|
+
code { font: 0.8125rem/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--faint); overflow-wrap: anywhere; }
|
|
5058
|
+
.list { margin: 0 0 24px; padding: 0; list-style: none; border: 1px solid var(--border); border-radius: 8px; background: var(--raised); }
|
|
5059
|
+
.list li { padding: 12px 16px; font-size: 0.875rem; line-height: 1.35; }
|
|
5060
|
+
.list li + li { border-top: 1px solid var(--border); }
|
|
5061
|
+
.list code { display: block; margin-top: 4px; }
|
|
5062
|
+
.warning { margin: 0 0 24px; padding: 12px 16px; border: 1px solid var(--warning-border); border-radius: 8px; background: var(--warning-bg); color: var(--warning-text); font-size: 0.875rem; line-height: 1.35; }
|
|
5063
|
+
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
|
|
5064
|
+
label { display: block; margin: 0 0 16px; font-size: 0.875rem; font-weight: 600; color: var(--subtle); }
|
|
5065
|
+
label input {
|
|
5066
|
+
display: block; width: 100%; min-height: 44px; margin-top: 8px; padding: 8px 12px;
|
|
5067
|
+
border: 1px solid var(--border-emphasis); border-radius: 6px; background: var(--raised);
|
|
5068
|
+
color: var(--text); font: 1rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
5069
|
+
}
|
|
5070
|
+
button {
|
|
5071
|
+
width: 100%; min-height: 44px; padding: 8px 16px; border: 1px solid var(--border-emphasis); border-radius: 6px;
|
|
5072
|
+
background: var(--raised); color: var(--text); cursor: pointer;
|
|
5073
|
+
font-family: inherit; font-size: 0.875rem; font-weight: 600; line-height: 1; transition: background-color 0.2s ease, border-color 0.2s ease;
|
|
5074
|
+
}
|
|
5075
|
+
button:hover { border-color: var(--border-heavy); background: var(--hover); }
|
|
5076
|
+
button.primary { border-color: var(--solid); background: var(--solid); color: var(--inverse); }
|
|
5077
|
+
button.primary:hover { border-color: var(--subtle); background: var(--subtle); }
|
|
5078
|
+
button:focus-visible, label input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
|
|
5079
|
+
@media (max-width: 480px) { main { padding: 24px; } }
|
|
5080
|
+
@media (prefers-reduced-motion: reduce) { button { transition: none; } }
|
|
5081
|
+
`;
|
|
4982
5082
|
/**
|
|
4983
5083
|
* Render one sign-in page that browsers cannot frame or cache. `bodyHtml`
|
|
4984
|
-
* follows the heading, and the caller escapes every value in it.
|
|
5084
|
+
* follows the heading, and the caller escapes every value in it. Callers use
|
|
5085
|
+
* the `list`, `warning`, `actions`, and `primary` classes from `PAGE_STYLE`.
|
|
4985
5086
|
*/
|
|
4986
5087
|
function renderHtmlPage(page) {
|
|
4987
5088
|
return new Response(`<!DOCTYPE html>
|
|
@@ -4990,13 +5091,12 @@ function renderHtmlPage(page) {
|
|
|
4990
5091
|
<meta charset="utf-8" />
|
|
4991
5092
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
4992
5093
|
<title>${escapeHtml(page.title)}</title>
|
|
5094
|
+
<style>${PAGE_STYLE}</style>
|
|
4993
5095
|
</head>
|
|
4994
|
-
<body
|
|
4995
|
-
<main
|
|
4996
|
-
<
|
|
4997
|
-
<h1 style="margin:0 0 .75rem;font-size:2rem">${escapeHtml(page.title)}</h1>
|
|
5096
|
+
<body>
|
|
5097
|
+
<main>
|
|
5098
|
+
<h1>${escapeHtml(page.title)}</h1>
|
|
4998
5099
|
${page.bodyHtml}
|
|
4999
|
-
</section>
|
|
5000
5100
|
</main>
|
|
5001
5101
|
</body>
|
|
5002
5102
|
</html>`, {
|
|
@@ -5324,15 +5424,18 @@ function redirectUriMatches(registered, requested) {
|
|
|
5324
5424
|
});
|
|
5325
5425
|
}
|
|
5326
5426
|
// src/api/mcp/oauth/page.ts
|
|
5327
|
-
/**
|
|
5427
|
+
/**
|
|
5428
|
+
* Render one MCP sign-in page. It loads no resources and sends no referrer to
|
|
5429
|
+
* other origins.
|
|
5430
|
+
*/
|
|
5328
5431
|
function renderMcpPage(page) {
|
|
5329
5432
|
const formAction = ["'self'", ...page.formOrigin ? [page.formOrigin] : []];
|
|
5330
|
-
const message = `
|
|
5433
|
+
const message = ` <p>${escapeHtml(page.message)}</p>`;
|
|
5331
5434
|
return renderHtmlPage({
|
|
5332
5435
|
bodyHtml: page.bodyHtml ? `${message}\n${page.bodyHtml}` : message,
|
|
5333
5436
|
headers: {
|
|
5334
5437
|
"content-security-policy": `default-src 'none'; style-src 'unsafe-inline'; frame-ancestors 'none'; form-action ${formAction.join(" ")}`,
|
|
5335
|
-
"referrer-policy": "
|
|
5438
|
+
"referrer-policy": "same-origin"
|
|
5336
5439
|
},
|
|
5337
5440
|
status: page.status,
|
|
5338
5441
|
title: page.title
|
|
@@ -5793,17 +5896,19 @@ function blockedPage() {
|
|
|
5793
5896
|
function consentPage(args) {
|
|
5794
5897
|
const clientHost = new URL(args.authorization.clientId).host;
|
|
5795
5898
|
const clientName = args.authorization.clientName ?? clientHost;
|
|
5796
|
-
const
|
|
5797
|
-
const scopeItems = (parseMcpScopes(args.authorization.scope) ?? []).map((scope) => `<li style="margin:0 0 .25rem">${escapeHtml(MCP_SCOPE_DESCRIPTIONS[scope])} <code style="color:#8a8a8a">${escapeHtml(scope)}</code></li>`).join("");
|
|
5899
|
+
const scopeItems = (parseMcpScopes(args.authorization.scope) ?? []).map((scope) => `<li>${escapeHtml(MCP_SCOPE_DESCRIPTIONS[scope])}<code>${escapeHtml(scope)}</code></li>`).join("");
|
|
5798
5900
|
return renderMcpPage({
|
|
5799
|
-
bodyHtml: `
|
|
5800
|
-
|
|
5801
|
-
|
|
5802
|
-
|
|
5803
|
-
|
|
5804
|
-
|
|
5901
|
+
bodyHtml: ` <p>The app is published at <strong>${escapeHtml(clientHost)}</strong>.</p>
|
|
5902
|
+
<h2>In ${escapeHtml(args.agentName)}, it can:</h2>
|
|
5903
|
+
<ul class="list">${scopeItems}</ul>
|
|
5904
|
+
<p class="warning" role="note">Only continue if you started this connection.</p>
|
|
5905
|
+
<form method="post" class="actions">
|
|
5906
|
+
<input type="hidden" name="csrf" value="${escapeHtml(args.csrfToken)}">
|
|
5907
|
+
<button type="submit" name="action" value="deny">Deny</button>
|
|
5908
|
+
<button type="submit" name="action" value="approve" class="primary">Allow</button>
|
|
5909
|
+
</form>`,
|
|
5805
5910
|
formOrigin: new URL(args.authorization.redirectUri).origin,
|
|
5806
|
-
message: `${clientName} wants to connect to ${args.agentName}
|
|
5911
|
+
message: `${clientName} wants to connect to ${args.agentName}.`,
|
|
5807
5912
|
status: 200,
|
|
5808
5913
|
title: `Connect ${clientName}`
|
|
5809
5914
|
});
|
|
@@ -6635,7 +6740,7 @@ function renderResult(agentName, result) {
|
|
|
6635
6740
|
}
|
|
6636
6741
|
}[result];
|
|
6637
6742
|
return renderHtmlPage({
|
|
6638
|
-
bodyHtml: `
|
|
6743
|
+
bodyHtml: ` <p>${escapeHtml(content.message)}</p>`,
|
|
6639
6744
|
headers: ACP_PAGE_HEADERS,
|
|
6640
6745
|
status: content.status,
|
|
6641
6746
|
title: content.title
|
|
@@ -6643,11 +6748,12 @@ function renderResult(agentName, result) {
|
|
|
6643
6748
|
}
|
|
6644
6749
|
function renderConfirmation(agentName) {
|
|
6645
6750
|
return renderHtmlPage({
|
|
6646
|
-
bodyHtml: `
|
|
6647
|
-
|
|
6648
|
-
|
|
6649
|
-
|
|
6650
|
-
</
|
|
6751
|
+
bodyHtml: ` <p>Enter the verification code shown by your ACP client.</p>
|
|
6752
|
+
<p class="warning" role="note">Only continue if you started sign-in from your ACP client.</p>
|
|
6753
|
+
<form method="post">
|
|
6754
|
+
<label>Verification code<input name="code" required autocomplete="one-time-code" inputmode="text"></label>
|
|
6755
|
+
<button type="submit" class="primary">Connect</button>
|
|
6756
|
+
</form>`,
|
|
6651
6757
|
headers: ACP_PAGE_HEADERS,
|
|
6652
6758
|
status: 200,
|
|
6653
6759
|
title: `Connect ${agentName}`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as resolveLocalScheduleAtMs, i as isValidTimeZone, r as getZonedDateTimeParts, t as getFirstRunAtMs } from "./cadence-R7Em4RjE.js";
|
|
2
|
-
import { n as actorIdentitySchema } from "./conversation-
|
|
2
|
+
import { n as actorIdentitySchema } from "./conversation-DppJ83Hw.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { actorUserIdSchema, destinationVisibilitySchema, eventMatchFieldsSchema, eventMatchSchema, eventReachSchema, eventTypeSchema, pluginEventTypeSchema, slackDestinationSchema, taskOutcomeSchema } from "@sentry/junior-plugin-api";
|
|
5
5
|
// src/chat/scheduled-automations/schedule-intent.ts
|
|
@@ -39,7 +39,7 @@ const oneOffScheduleIntentSchema = z.object({
|
|
|
39
39
|
time: localTimeSchema.describe("Requested local wall-clock time in HH:MM format.")
|
|
40
40
|
}).strict()]).describe("Relative delay or explicit local time for the one-off run.")
|
|
41
41
|
}).strict();
|
|
42
|
-
const
|
|
42
|
+
const recurringScheduleFields = {
|
|
43
43
|
kind: z.literal("recurring").describe("A repeating calendar schedule."),
|
|
44
44
|
frequency: z.enum([
|
|
45
45
|
"daily",
|
|
@@ -50,20 +50,21 @@ const recurringScheduleIntentSchema = z.object({
|
|
|
50
50
|
interval: z.number().int().positive().max(365).describe("Repeat every N frequency units. Defaults to 1.").nullable().optional(),
|
|
51
51
|
time: localTimeSchema.describe("Local wall-clock time for each occurrence in HH:MM format."),
|
|
52
52
|
weekdays: z.array(weekdaySchema).min(1).max(7).describe("Required for weekly schedules.").nullable().optional(),
|
|
53
|
-
dayOfMonth: z.number().int().min(1).max(31).describe("Required for monthly and yearly schedules.").nullable().optional(),
|
|
54
53
|
month: z.number().int().min(1).max(12).describe("Required for yearly schedules, where January is 1.").nullable().optional(),
|
|
55
|
-
startDate: localDateSchema.describe("Optional local calendar date that anchors the recurrence. Omit to start with the next matching occurrence.").nullable().optional(),
|
|
56
54
|
timezone: timezoneSchema
|
|
57
|
-
}
|
|
55
|
+
};
|
|
56
|
+
const dayOfMonthSchema = z.number().int().min(1).max(31).describe("Required for monthly and yearly schedules.").nullable().optional();
|
|
57
|
+
const startDateSchema = localDateSchema.describe("Optional local calendar date that anchors the recurrence. Omit to start with the next matching occurrence.").nullable().optional();
|
|
58
|
+
function checkRecurringSchedule(schedule, dayOfMonth, context) {
|
|
58
59
|
if (schedule.frequency === "weekly" && schedule.weekdays == null) context.addIssue({
|
|
59
60
|
code: "custom",
|
|
60
61
|
message: "Weekly schedules require weekdays.",
|
|
61
62
|
path: ["weekdays"]
|
|
62
63
|
});
|
|
63
|
-
if ((schedule.frequency === "monthly" || schedule.frequency === "yearly") &&
|
|
64
|
+
if ((schedule.frequency === "monthly" || schedule.frequency === "yearly") && dayOfMonth.value == null) context.addIssue({
|
|
64
65
|
code: "custom",
|
|
65
|
-
message: `${schedule.frequency} schedules require dayOfMonth.`,
|
|
66
|
-
path: [
|
|
66
|
+
message: `${schedule.frequency} schedules require ${dayOfMonth.key}.`,
|
|
67
|
+
path: [dayOfMonth.key]
|
|
67
68
|
});
|
|
68
69
|
if (schedule.frequency === "yearly" && schedule.month == null) context.addIssue({
|
|
69
70
|
code: "custom",
|
|
@@ -75,18 +76,46 @@ const recurringScheduleIntentSchema = z.object({
|
|
|
75
76
|
message: "weekdays applies only to weekly schedules.",
|
|
76
77
|
path: ["weekdays"]
|
|
77
78
|
});
|
|
78
|
-
if (schedule.frequency !== "monthly" && schedule.frequency !== "yearly" &&
|
|
79
|
+
if (schedule.frequency !== "monthly" && schedule.frequency !== "yearly" && dayOfMonth.value != null) context.addIssue({
|
|
79
80
|
code: "custom",
|
|
80
|
-
message:
|
|
81
|
-
path: [
|
|
81
|
+
message: `${dayOfMonth.key} applies only to monthly or yearly schedules.`,
|
|
82
|
+
path: [dayOfMonth.key]
|
|
82
83
|
});
|
|
83
84
|
if (schedule.frequency !== "yearly" && schedule.month != null) context.addIssue({
|
|
84
85
|
code: "custom",
|
|
85
86
|
message: "month applies only to yearly schedules.",
|
|
86
87
|
path: ["month"]
|
|
87
88
|
});
|
|
88
|
-
}
|
|
89
|
+
}
|
|
90
|
+
const recurringScheduleIntentSchema = z.object({
|
|
91
|
+
...recurringScheduleFields,
|
|
92
|
+
dayOfMonth: dayOfMonthSchema,
|
|
93
|
+
startDate: startDateSchema
|
|
94
|
+
}).strict().superRefine((schedule, context) => checkRecurringSchedule(schedule, {
|
|
95
|
+
key: "dayOfMonth",
|
|
96
|
+
value: schedule.dayOfMonth
|
|
97
|
+
}, context));
|
|
98
|
+
const recurringToolScheduleIntentSchema = z.object({
|
|
99
|
+
...recurringScheduleFields,
|
|
100
|
+
day_of_month: dayOfMonthSchema,
|
|
101
|
+
start_date: startDateSchema
|
|
102
|
+
}).strict().superRefine((schedule, context) => checkRecurringSchedule(schedule, {
|
|
103
|
+
key: "day_of_month",
|
|
104
|
+
value: schedule.day_of_month
|
|
105
|
+
}, context));
|
|
89
106
|
const scheduleIntentSchema = z.union([oneOffScheduleIntentSchema, recurringScheduleIntentSchema]);
|
|
107
|
+
/** Model-facing schedule intent of the Automation tools. */
|
|
108
|
+
const toolScheduleIntentSchema = z.union([oneOffScheduleIntentSchema, recurringToolScheduleIntentSchema]);
|
|
109
|
+
/** Map a tool schedule intent to the shape that core compiles and saves. */
|
|
110
|
+
function scheduleIntentFromTool(intent) {
|
|
111
|
+
if (intent.kind === "one_off") return intent;
|
|
112
|
+
const { day_of_month, start_date, ...rest } = intent;
|
|
113
|
+
return {
|
|
114
|
+
...rest,
|
|
115
|
+
dayOfMonth: day_of_month,
|
|
116
|
+
startDate: start_date
|
|
117
|
+
};
|
|
118
|
+
}
|
|
90
119
|
const WEEKDAY_INDEX = {
|
|
91
120
|
sunday: 0,
|
|
92
121
|
monday: 1,
|
|
@@ -694,4 +723,4 @@ const automationEventCatalogSchema = z.array(z.object({
|
|
|
694
723
|
}).strict());
|
|
695
724
|
const automationScheduleIntentSchema = scheduleIntentSchema;
|
|
696
725
|
const automationSchedulePreviewSchema = scheduledAutomationSchema.pick({ schedule: true }).extend({ nextRunAtMs: z.number() }).strict();
|
|
697
|
-
export { SCHEDULED_AUTOMATION_SYSTEM_ACTOR as A, eventAutomationSummarySchema as C, taskOutcomeInputSchema as D, automationTitleSchema as E,
|
|
726
|
+
export { SCHEDULED_AUTOMATION_SYSTEM_ACTOR as A, eventAutomationSummarySchema as C, taskOutcomeInputSchema as D, automationTitleSchema as E, scheduleIntentFromTool as F, toolScheduleIntentSchema as I, weekdaySchema as L, scheduledRunSchema as M, ScheduleIntentError as N, eventAutomationSchema as O, compileScheduleIntent as P, automationVersionSchema as S, automationInstructionToolSchema as T, automationSummarySchema as _, automationExecutionSchema as a, automationVersionListSchema as b, automationLifecycleSchema as c, automationParamsSchema as d, automationRunListSchema as f, automationSchedulePreviewSchema as g, automationScheduleIntentSchema as h, automationExecutionListSchema as i, scheduledAutomationSchema as j, eventAutomationTriggerSchema as k, automationListQuerySchema as l, automationRunWindowsSchema as m, automationEditSchema as n, automationExecutionStatusDaySchema as o, automationRunSchema as p, automationEventCatalogSchema as r, automationExecutionStatusSchema as s, automationEditErrorSchema as t, automationListSchema as u, automationUpdateSchema as v, scheduledAutomationSummarySchema as w, automationVersionParamsSchema as x, automationVersionActivateSchema as y };
|
package/dist/{background-compaction-queue-BYuOt3qK.js → background-compaction-queue-Bywqo1WJ.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as getChatConfig } from "./config-
|
|
2
|
-
import { E as withSpan, m as logInfo, p as logException } from "./logging-
|
|
1
|
+
import { i as getChatConfig } from "./config-Cb--cuv-.js";
|
|
2
|
+
import { E as withSpan, m as logInfo, p as logException } from "./logging-B04X_eCB.js";
|
|
3
3
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
4
4
|
import { createHash, createHmac, timingSafeEqual } from "node:crypto";
|
|
5
5
|
import { z } from "zod";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { i as completeObject } from "./client-
|
|
1
|
+
import { i as completeObject } from "./client-7diKvInp.js";
|
|
2
2
|
import { i as defaultModelId } from "./model-profile-B998sjVd.js";
|
|
3
|
-
import {
|
|
4
|
-
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-
|
|
3
|
+
import { Z as parseBriefInput, d as conversationDetailReportSchema, p as conversationEventPageSchema, q as briefCodeChangeSchema } from "./conversation-DppJ83Hw.js";
|
|
4
|
+
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-B4fQKGZR.js";
|
|
5
5
|
import { CLI_USAGE } from "./cli/run.js";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import { z } from "zod";
|
|
@@ -267,7 +267,7 @@ async function parseRunOptions(argv) {
|
|
|
267
267
|
* `DATABASE_URL` at import, and `briefs pull` must work with only a token.
|
|
268
268
|
*/
|
|
269
269
|
async function configuredDefaultModelId() {
|
|
270
|
-
const { botConfig } = await import("./config-
|
|
270
|
+
const { botConfig } = await import("./config-Cb--cuv-.js").then((n) => n.r);
|
|
271
271
|
return defaultModelId(botConfig);
|
|
272
272
|
}
|
|
273
273
|
function apiUrl(baseUrl, pathname) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
|
|
2
|
-
import { t as createPluginCatalogRuntime } from "./registry-
|
|
2
|
+
import { t as createPluginCatalogRuntime } from "./registry-CEqKR_ld.js";
|
|
3
3
|
// src/chat/plugins/catalog-runtime.ts
|
|
4
4
|
var catalog_runtime_exports = /* @__PURE__ */ __exportAll({ pluginCatalogRuntime: () => pluginCatalogRuntime });
|
|
5
5
|
const pluginCatalogRuntime = createPluginCatalogRuntime();
|