@sentry/junior 0.254.0 → 0.255.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/{admin-D7kYbu5l.js → admin-CeJh4SuR.js} +1 -1
- package/dist/{agent-hooks-DfPubHYm.js → agent-hooks-CDVx26Uu.js} +8 -8
- package/dist/{agent-runner-BWmnJ0dD.js → agent-runner-Caiof09f.js} +24 -21
- package/dist/api/schema.d.ts +0 -8
- package/dist/api/schema.js +2 -2
- package/dist/api.js +60 -70
- package/dist/app.js +36 -36
- package/dist/{assistant-reply-B3J6ogAM.js → assistant-reply-BddmM66R.js} +1 -1
- package/dist/{automation-gznOMaQ2.js → automation-CHdlHVZP.js} +3 -4
- package/dist/{briefs-B_fgUFD2.js → briefs-iVq_8-ft.js} +2 -2
- package/dist/{catalog-runtime-TG5WF66H.js → catalog-runtime-hKmI-iZa.js} +1 -1
- package/dist/cli/chat.js +15 -15
- package/dist/cli/check.js +3 -3
- package/dist/cli/main.js +2 -2
- package/dist/cli/plugins.js +4 -4
- package/dist/cli/snapshot-create.js +3 -3
- package/dist/cli/upgrade.js +3 -3
- package/dist/{client-oBgOmQV6.js → client-Clj7onnT.js} +2 -2
- package/dist/{config-CRlLncIj.js → config-BDAfLTI9.js} +2 -2
- package/dist/{connections-BZAuDnYm.js → connections-BC0RTejT.js} +9 -9
- package/dist/{conversation-privacy-Dui3hTO-.js → conversation-privacy-1ERtieuM.js} +1 -1
- package/dist/{credential-sync-9HiSpphh.js → credential-sync-BZuqqIHk.js} +14 -14
- package/dist/{executor-B88oEqok.js → executor-Dh4Ofsnx.js} +5 -6
- package/dist/{images-k8HewSp_.js → images-C-WOnTc_.js} +2 -2
- package/dist/instrumentation.js +2 -2
- package/dist/{job-queue-B6KaQXY6.js → job-queue-BaCL36FY.js} +1 -1
- package/dist/{logging-B3nJLXT7.js → logging-D3aYP0aG.js} +1 -1
- package/dist/{message-C9Wx3Rxx.js → message-B9xqD2BP.js} +3 -3
- package/dist/nitro.js +3 -3
- package/dist/{oauth-callback-server-CetsCZng.js → oauth-callback-server-i5qdAou6.js} +2 -2
- package/dist/{pending-auth-m8aJlwP_.js → pending-auth-D2t1Moxf.js} +2 -2
- package/dist/{profile-Dh73O6lZ.js → profile-DnkX3e2S.js} +4 -4
- package/dist/{registry-C-jns0Be.js → registry-CmKmKHpp.js} +1 -1
- package/dist/{resolve-CDYCpS_U.js → resolve-jfNHtEBx.js} +2 -2
- package/dist/{result-sih-x_yN.js → result-Df5nEDX2.js} +6 -6
- package/dist/{runner-CA43p74t.js → runner-CmzoXEI4.js} +9 -9
- package/dist/{sandbox-egress-signals-CxHHTu8e.js → sandbox-egress-signals-DjMNKLZz.js} +1 -1
- package/dist/{schema-C-a9U34c.js → schema-BBgv0MNf.js} +1 -1
- package/dist/{session-stop-DenN1GuJ.js → session-stop-BEBfE97J.js} +10 -10
- package/dist/{skills-D_XDFkSx.js → skills-Dc-AMYi4.js} +2 -2
- package/dist/{spawn-CcWYt3Tl.js → spawn-OgTwBUj0.js} +2 -2
- package/dist/{store-CIs0Tr31.js → store-BashBewg.js} +6 -6
- package/dist/{task-queue-DAY-aQLX.js → task-queue-VvIKqlQ4.js} +3 -3
- package/dist/{task-runner-BE6Jgt2u.js → task-runner-D2CpD6GN.js} +10 -10
- package/dist/{tasks-DO9VM9cu.js → tasks-dJooqiip.js} +16 -26
- package/dist/{thread-state-FreaCOZD.js → thread-state-CsMC-ob0.js} +6 -6
- package/dist/{turn-failure-response-CJSt2ZSf.js → turn-failure-response-zB364t7_.js} +7 -7
- package/dist/{turn-lifecycle-BXclEcfZ.js → turn-lifecycle-BfodfmiY.js} +1 -1
- package/dist/{turn-session-routing-CItfUsjQ.js → turn-session-routing-BAh_qsBJ.js} +1 -1
- package/dist/{validation-MW8dmhF9.js → validation-LzIilOb6.js} +1 -1
- package/dist/{version-DcWD8xpq.js → version-CDM8Rq6E.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-CGZiUVMU.js → viewer-Rnim7alE.js} +3 -3
- package/dist/{web-input-Dpqh0oBt.js → web-input-Dc1VwcT4.js} +74 -75
- package/dist/{work-DbA9xNO1.js → work-BAn43SsN.js} +9 -9
- package/dist/{worker-DuCs9-3G.js → worker-mBXq4_zg.js} +5 -5
- package/migrations/0058_automation_creator_identity.sql +45 -0
- package/migrations/meta/0058_snapshot.json +3598 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +5 -5
package/dist/app.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { At as consumeSandboxEgressPermissionDeniedSignal, B as effectiveTaskOutcomes, Ct as ingestEvent, Dt as SANDBOX_EGRESS_PROXY_PATH, E as requestAttachmentDeletion, Et as shouldPropagateSandboxEgressTrace, F as logScheduledAutomationRunSkipped, I as scheduledAutomationRunAttributes, It as startOAuthFlow, Kt as getConfigDefaults, Lt as createUserTokenStore, Nt as formatProviderLabel, O as parseSlackThreadId, Ot as clearSandboxEgressSignals, St as processWorkspaceSnapshotJob, Tt as normalizeSandboxEgressTracePropagationDomains, U as stopConversationSession, W as recordSubagentEnded, b as unpublishedArtifactHeaders, i as executeCredentialedEgressRequest, jt as parseSandboxEgressCredentialToken, kt as consumeSandboxEgressAuthRequiredSignal, lt as listPendingAgentInvocationMailboxAppends, n as executeAgentRun, qt as setConfigDefaults, t as createAgentRunner, ut as listPendingAgentInvocationResults, v as publicArtifactHeaders, w as collectAttachmentGarbage, wt as resolveSandboxEgressProviderForHost, x as lookupSlackUserProfile, y as readPublicArtifact } from "./agent-runner-
|
|
2
|
-
import { C as withLogContext, O as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, S as withContext, d as logException, f as logInfo, j as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, p as logWarn, r as createRequestContext, v as setSpanAttributes, w as withSpan, y as setSpanStatus } from "./logging-
|
|
1
|
+
import { At as consumeSandboxEgressPermissionDeniedSignal, B as effectiveTaskOutcomes, Ct as ingestEvent, Dt as SANDBOX_EGRESS_PROXY_PATH, E as requestAttachmentDeletion, Et as shouldPropagateSandboxEgressTrace, F as logScheduledAutomationRunSkipped, I as scheduledAutomationRunAttributes, It as startOAuthFlow, Kt as getConfigDefaults, Lt as createUserTokenStore, Nt as formatProviderLabel, O as parseSlackThreadId, Ot as clearSandboxEgressSignals, St as processWorkspaceSnapshotJob, Tt as normalizeSandboxEgressTracePropagationDomains, U as stopConversationSession, W as recordSubagentEnded, b as unpublishedArtifactHeaders, i as executeCredentialedEgressRequest, jt as parseSandboxEgressCredentialToken, kt as consumeSandboxEgressAuthRequiredSignal, lt as listPendingAgentInvocationMailboxAppends, n as executeAgentRun, qt as setConfigDefaults, t as createAgentRunner, ut as listPendingAgentInvocationResults, v as publicArtifactHeaders, w as collectAttachmentGarbage, wt as resolveSandboxEgressProviderForHost, x as lookupSlackUserProfile, y as readPublicArtifact } from "./agent-runner-Caiof09f.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-D3aYP0aG.js";
|
|
3
3
|
import { n as captureMessage, r as continueTrace } from "./sentry-CgWZM_kV.js";
|
|
4
|
-
import { t as JUNIOR_VERSION } from "./version-
|
|
5
|
-
import { _ as snapshotRuntimeConfig, d as restoreRuntimeConfig, f as setBotModelConfig, g as setSlackReactionConfig, h as setRuntimeLimits, i as getChatConfig, m as setProfiles, n as botConfig, o as getSlackBotToken, p as setCrossActorMidRunMode, u as resetRuntimeConfig } from "./config-
|
|
4
|
+
import { t as JUNIOR_VERSION } from "./version-CDM8Rq6E.js";
|
|
5
|
+
import { _ as snapshotRuntimeConfig, d as restoreRuntimeConfig, f as setBotModelConfig, g as setSlackReactionConfig, h as setRuntimeLimits, i as getChatConfig, m as setProfiles, n as botConfig, o as getSlackBotToken, p as setCrossActorMidRunMode, u as resetRuntimeConfig } from "./config-BDAfLTI9.js";
|
|
6
6
|
import { _ as slackMessageTsSchema, d as parseSlackTeamId, f as parseSlackUserId, h as slackUserIdSchema, m as slackTeamIdSchema, o as parseActorUserId, p as slackChannelIdSchema } from "./actor-BTtLaeWy.js";
|
|
7
|
-
import { c as getConversationEventStore, d as getDb, f as getSqlExecutor, g as withConversationMutationLock, m as withConversationEventLock, r as readActorIdentity, u as getConversationStore } from "./viewer-
|
|
7
|
+
import { c as getConversationEventStore, d as getDb, f as getSqlExecutor, g as withConversationMutationLock, m as withConversationEventLock, r as readActorIdentity, u as getConversationStore } from "./viewer-Rnim7alE.js";
|
|
8
8
|
import { a as juniorAgentInvocations, d as juniorDestinations, i as juniorAgentBindings, s as juniorConversations } from "./agent-invocations-BY60iNw-.js";
|
|
9
|
-
import { f as juniorConversationBriefs, h as juniorConversationEvents, o as juniorAutomationRuns, s as juniorAutomations } from "./executor-
|
|
10
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
11
|
-
import {
|
|
12
|
-
import { $ as bindSlackDirectCredentialSubject, At as resolveRootVisibility, Ht as getSlackClient, Jt as getWorkspaceTeamId, Nt as listConversationAnnotations, Q as bindScheduledAutomationCredentialSubject, U as collectEventMatchKeys, Wt as isDmChannel, X as takeDueTimerWatches, Yt as runWithWorkspaceTeamId, Z as bindEventAutomationCredentialSubject, a as getPluginRoutes, at as getDashboardConversationLink, ct as setDashboardConversationLinkOptions, d as setPlugins, et as verifyEventAutomationCredentialSubject, f as validatePlugins, ft as createPluginLogger, h as setBriefsConfig, i as getPluginApiRoutes, lt as createPluginState, nt as verifySlackDirectCredentialSubject, pt as readConversationAccessFromSql, q as findMatchingWatches, st as getDashboardTaskLink, tt as verifyScheduledAutomationCredentialSubject, u as getPlugins } from "./agent-hooks-
|
|
9
|
+
import { f as juniorConversationBriefs, h as juniorConversationEvents, o as juniorAutomationRuns, s as juniorAutomations } from "./executor-Dh4Ofsnx.js";
|
|
10
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-hKmI-iZa.js";
|
|
11
|
+
import { Gt as projectConversationMessages, H as slackEntitySchema, Ht as appendConversationMessages, Jt as settleConversationTitleWork, N as slackMention, U as slackExternalRefIdSchema, b as admitEventAutomationRun, c as withScheduledAutomationLock, i as readScheduledAutomation, l as blockEventAutomation, n as listScheduledAutomationsForTeam, o as saveScheduledAutomationInLock, p as findMatchingEventAutomations, s as scheduledRunId, u as collectEventAutomationMatchKeys, x as eventAutomationRunLimitReason } from "./tasks-dJooqiip.js";
|
|
12
|
+
import { $ as bindSlackDirectCredentialSubject, At as resolveRootVisibility, Ht as getSlackClient, Jt as getWorkspaceTeamId, Nt as listConversationAnnotations, Q as bindScheduledAutomationCredentialSubject, U as collectEventMatchKeys, Wt as isDmChannel, X as takeDueTimerWatches, Yt as runWithWorkspaceTeamId, Z as bindEventAutomationCredentialSubject, a as getPluginRoutes, at as getDashboardConversationLink, ct as setDashboardConversationLinkOptions, d as setPlugins, et as verifyEventAutomationCredentialSubject, f as validatePlugins, ft as createPluginLogger, h as setBriefsConfig, i as getPluginApiRoutes, lt as createPluginState, nt as verifySlackDirectCredentialSubject, pt as readConversationAccessFromSql, q as findMatchingWatches, st as getDashboardTaskLink, tt as verifyScheduledAutomationCredentialSubject, u as getPlugins } from "./agent-hooks-CDVx26Uu.js";
|
|
13
13
|
import { W as annotationCard } from "./conversation-T18Xlkx9.js";
|
|
14
|
-
import { O as withLock$1, w as getStateAdapter } from "./profile-
|
|
15
|
-
import { c as getThreadStopDecision } from "./pending-auth-
|
|
16
|
-
import { O as renderTaskInput, f as slackChannelMessageEvent, l as getEventCatalog, p as slackChannelMessageReplyThreadTs, u as SLACK_EVENT_NAMESPACE, y as eventGuidance } from "./session-stop-
|
|
14
|
+
import { O as withLock$1, w as getStateAdapter } from "./profile-DnkX3e2S.js";
|
|
15
|
+
import { c as getThreadStopDecision } from "./pending-auth-D2t1Moxf.js";
|
|
16
|
+
import { O as renderTaskInput, f as slackChannelMessageEvent, l as getEventCatalog, p as slackChannelMessageReplyThreadTs, u as SLACK_EVENT_NAMESPACE, y as eventGuidance } from "./session-stop-BEBfE97J.js";
|
|
17
17
|
import { n as getNextRunAtMs } from "./cadence-D00SCzT1.js";
|
|
18
|
-
import { f as setSandboxResourceConfig, u as getSandboxResourceConfig } from "./resolve-
|
|
19
|
-
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-
|
|
20
|
-
import { A as hasRunnableConversationWork$1, M as isInvalidConversationRecordError, O as CONVERSATION_WORK_STALE_ENQUEUE_MS, S as removeActiveConversation, _ as hasRunnableConversationWork, c as clearExpiredConversationLease, g as getConversationWorkState, h as getConversation, m as ensureConversationWake, r as appendAndEnqueueInboundMessage, v as listActiveConversationIds } from "./store-
|
|
21
|
-
import { D as scheduledRunSchema } from "./automation-
|
|
18
|
+
import { f as setSandboxResourceConfig, u as getSandboxResourceConfig } from "./resolve-jfNHtEBx.js";
|
|
19
|
+
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-BaCL36FY.js";
|
|
20
|
+
import { A as hasRunnableConversationWork$1, M as isInvalidConversationRecordError, O as CONVERSATION_WORK_STALE_ENQUEUE_MS, S as removeActiveConversation, _ as hasRunnableConversationWork, c as clearExpiredConversationLease, g as getConversationWorkState, h as getConversation, m as ensureConversationWake, r as appendAndEnqueueInboundMessage, v as listActiveConversationIds } from "./store-BashBewg.js";
|
|
21
|
+
import { D as scheduledRunSchema } from "./automation-CHdlHVZP.js";
|
|
22
22
|
import { i as setExperimentalFeatures, n as getExperimentalFeatures, r as isExperimentalFeatureEnabled } from "./experimental-Qn9rKLgx.js";
|
|
23
|
-
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-
|
|
23
|
+
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-LzIilOb6.js";
|
|
24
24
|
import { a as pluginRuntimeRegistrationsFromPluginSet, n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "./plugins-egKWjgue.js";
|
|
25
|
-
import { A as withNormalizedThreadId, C as buildSlackInboundMessage, D as isSlackMessageStopped, E as verifySlackSignature, F as renderSlackObjectCard, I as createVercelAttachmentStorage, M as THREAD_OPTOUT_ACK, N as startProcessingReaction, O as stopSlackThread, P as parseContent, R as enqueueAgentDispatch, S as recordSkippedConversationMessage, T as runWithSlackInstallation, a as recordWebConversationActivity, c as createProductionSlackWebhookServices, f as createSlackWebApiStatusSender, j as stopConversationTurn, k as normalizeIncomingSlackThreadId, l as getProductionSlackAdapter, n as conversationTurnIdForMessage, o as webActorFromEmail, s as createProductionConversationWorkOptions, t as appendAndEnqueueWebMessage, v as readViewerAutomationSummary, w as clearSlackPendingReactions, z as GET$3 } from "./web-input-
|
|
26
|
-
import { M as recordAutomationExecution, S as existingConversationId, a as confirmDispatchMailboxAppend, b as notifyAutomationBlocked, f as getPluginDispatchProjection, m as listPendingDispatchMailboxAppends, o as createOrGetDispatch, p as isTerminalDispatchStatus, s as getDispatchConversationId, t as processPluginTask, u as getDispatchRecord, v as markDispatchFailed } from "./task-runner-
|
|
27
|
-
import { o as getAuthPausedConversationTurnId, t as enqueueAgentInvocationResult } from "./result-
|
|
28
|
-
import { r as enqueueAgentInvocation } from "./work-
|
|
29
|
-
import { s 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 registerVercelPluginTaskDevConsumer, n as createVercelPluginTaskCallback, s as queueCallback } from "./task-queue-
|
|
33
|
-
import { t as processConversationWork } from "./worker-
|
|
34
|
-
import { t as bindMessageAgent } from "./message-
|
|
35
|
-
import { t as bindSpawnAgent } from "./spawn-
|
|
25
|
+
import { A as withNormalizedThreadId, C as buildSlackInboundMessage, D as isSlackMessageStopped, E as verifySlackSignature, F as renderSlackObjectCard, I as createVercelAttachmentStorage, M as THREAD_OPTOUT_ACK, N as startProcessingReaction, O as stopSlackThread, P as parseContent, R as enqueueAgentDispatch, S as recordSkippedConversationMessage, T as runWithSlackInstallation, a as recordWebConversationActivity, c as createProductionSlackWebhookServices, f as createSlackWebApiStatusSender, j as stopConversationTurn, k as normalizeIncomingSlackThreadId, l as getProductionSlackAdapter, n as conversationTurnIdForMessage, o as webActorFromEmail, s as createProductionConversationWorkOptions, t as appendAndEnqueueWebMessage, v as readViewerAutomationSummary, w as clearSlackPendingReactions, z as GET$3 } from "./web-input-Dc1VwcT4.js";
|
|
26
|
+
import { M as recordAutomationExecution, S as existingConversationId, a as confirmDispatchMailboxAppend, b as notifyAutomationBlocked, f as getPluginDispatchProjection, m as listPendingDispatchMailboxAppends, o as createOrGetDispatch, p as isTerminalDispatchStatus, s as getDispatchConversationId, t as processPluginTask, u as getDispatchRecord, v as markDispatchFailed } from "./task-runner-D2CpD6GN.js";
|
|
27
|
+
import { o as getAuthPausedConversationTurnId, t as enqueueAgentInvocationResult } from "./result-Df5nEDX2.js";
|
|
28
|
+
import { r as enqueueAgentInvocation } from "./work-BAn43SsN.js";
|
|
29
|
+
import { s as coerceThreadConversationState } from "./thread-state-CsMC-ob0.js";
|
|
30
|
+
import { o as unlinkProvider } from "./connections-BC0RTejT.js";
|
|
31
|
+
import { a as GET$4, i as publishAppHomeView, r as GET$5, t as receiveLocalOAuthCredential } from "./credential-sync-BZuqqIHk.js";
|
|
32
|
+
import { a as registerVercelPluginTaskDevConsumer, n as createVercelPluginTaskCallback, s as queueCallback } from "./task-queue-VvIKqlQ4.js";
|
|
33
|
+
import { t as processConversationWork } from "./worker-mBXq4_zg.js";
|
|
34
|
+
import { t as bindMessageAgent } from "./message-B9xqD2BP.js";
|
|
35
|
+
import { t as bindSpawnAgent } from "./spawn-OgTwBUj0.js";
|
|
36
36
|
import { createRequire } from "node:module";
|
|
37
37
|
import { Hono } from "hono";
|
|
38
38
|
import { z } from "zod";
|
|
@@ -442,13 +442,13 @@ async function writeRun(db, run) {
|
|
|
442
442
|
set: columns
|
|
443
443
|
});
|
|
444
444
|
}
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
async function listIncompleteScheduledRuns(db) {
|
|
451
|
-
return await
|
|
445
|
+
/**
|
|
446
|
+
* List incomplete Scheduled automation runs, optionally for one automation.
|
|
447
|
+
* Deleted automations are included: a run that was already dispatched when
|
|
448
|
+
* its automation was deleted must still settle.
|
|
449
|
+
*/
|
|
450
|
+
async function listIncompleteScheduledRuns(db, automationId) {
|
|
451
|
+
return (await db.select({ run: juniorAutomationRuns }).from(juniorAutomationRuns).innerJoin(juniorAutomations, eq(juniorAutomations.id, juniorAutomationRuns.automationId)).where(and(eq(juniorAutomations.kind, "scheduled"), automationId === void 0 ? void 0 : eq(juniorAutomationRuns.automationId, automationId), inArray(juniorAutomationRuns.status, [...INCOMPLETE_RUN_STATUSES]))).orderBy(asc(juniorAutomationRuns.scheduledForMs), asc(juniorAutomationRuns.id))).map(({ run }) => parseScheduledRunRow(run)).filter(present);
|
|
452
452
|
}
|
|
453
453
|
function getDueRunAtMs(task, nowMs) {
|
|
454
454
|
if (typeof task.runNowAtMs === "number" && Number.isFinite(task.runNowAtMs) && task.runNowAtMs <= nowMs) return task.runNowAtMs;
|
|
@@ -539,7 +539,7 @@ async function claimDueScheduledRun(db, args) {
|
|
|
539
539
|
const scheduledForMs = getDueRunAtMs(task, args.nowMs);
|
|
540
540
|
if (scheduledForMs === void 0) return void 0;
|
|
541
541
|
const runId = scheduledRunId(task.id, scheduledForMs);
|
|
542
|
-
const incompleteRuns = await
|
|
542
|
+
const incompleteRuns = await listIncompleteScheduledRuns(taskTx, task.id);
|
|
543
543
|
const incompleteRun = incompleteRuns.find((item) => item.id === runId);
|
|
544
544
|
if (incompleteRuns.find((item) => item.id !== runId && !isStalePendingRun(item, args.nowMs))) return void 0;
|
|
545
545
|
if (incompleteRun) {
|
|
@@ -234,6 +234,8 @@ const eventAutomationSchema = z.object({
|
|
|
234
234
|
id: z.string().min(1),
|
|
235
235
|
createdAtMs: z.number().finite(),
|
|
236
236
|
createdBy: eventAutomationPrincipalSchema,
|
|
237
|
+
/** Junior identity that created the automation. It decides ownership. */
|
|
238
|
+
creatorIdentityId: z.string().min(1),
|
|
237
239
|
credentialMode: z.enum(["system", "creator"]),
|
|
238
240
|
destination: eventAutomationDestinationSchema,
|
|
239
241
|
destinationVisibility: destinationVisibilitySchema,
|
|
@@ -501,10 +503,7 @@ const automationListSchema = z.object({
|
|
|
501
503
|
creators: z.array(automationFilterOptionSchema),
|
|
502
504
|
destinations: z.array(automationFilterOptionSchema)
|
|
503
505
|
}).strict();
|
|
504
|
-
const automationParamsSchema = z.object({
|
|
505
|
-
id: z.string().min(1),
|
|
506
|
-
kind: z.enum(["scheduled", "event"])
|
|
507
|
-
}).strict();
|
|
506
|
+
const automationParamsSchema = z.object({ id: z.string().min(1) }).strict();
|
|
508
507
|
const automationExecutionStatusSchema = z.enum([
|
|
509
508
|
"blocked",
|
|
510
509
|
"completed",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as completeObject } from "./client-
|
|
1
|
+
import { r as completeObject } from "./client-Clj7onnT.js";
|
|
2
2
|
import { r as defaultModelId } from "./model-profile-BwU8mqwD.js";
|
|
3
3
|
import { U as parseBriefInput, d as conversationDetailReportSchema, p as conversationEventPageSchema, z as briefCodeChangeSchema } from "./conversation-T18Xlkx9.js";
|
|
4
4
|
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-C04mP1hu.js";
|
|
@@ -269,7 +269,7 @@ async function parseRunOptions(argv) {
|
|
|
269
269
|
* `DATABASE_URL` at import, and `briefs pull` must work with only a token.
|
|
270
270
|
*/
|
|
271
271
|
async function configuredDefaultModelId() {
|
|
272
|
-
const { botConfig } = await import("./config-
|
|
272
|
+
const { botConfig } = await import("./config-BDAfLTI9.js").then((n) => n.r);
|
|
273
273
|
return defaultModelId(botConfig);
|
|
274
274
|
}
|
|
275
275
|
function apiUrl(baseUrl, pathname) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { t as createPluginCatalogRuntime } from "./registry-
|
|
2
|
+
import { t as createPluginCatalogRuntime } from "./registry-CmKmKHpp.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();
|
package/dist/cli/chat.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-
|
|
1
|
+
import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-Caiof09f.js";
|
|
2
2
|
import { t as loadAppPluginSet } from "../plugin-module-CVvEUSMH.js";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { createHash, randomUUID } from "node:crypto";
|
|
@@ -100,10 +100,10 @@ async function loadLocalPluginSet() {
|
|
|
100
100
|
async function configureLocalChatPlugins(pluginSet) {
|
|
101
101
|
const [pluginsModule, agentHooksModule, catalogRuntimeModule, validationModule, databaseModule] = await Promise.all([
|
|
102
102
|
import("../plugins-egKWjgue.js").then((n) => n.o),
|
|
103
|
-
import("../agent-hooks-
|
|
104
|
-
import("../catalog-runtime-
|
|
105
|
-
import("../validation-
|
|
106
|
-
import("../viewer-
|
|
103
|
+
import("../agent-hooks-CDVx26Uu.js").then((n) => n.t),
|
|
104
|
+
import("../catalog-runtime-hKmI-iZa.js").then((n) => n.t),
|
|
105
|
+
import("../validation-LzIilOb6.js").then((n) => n.r),
|
|
106
|
+
import("../viewer-Rnim7alE.js").then((n) => n.s)
|
|
107
107
|
]);
|
|
108
108
|
const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
|
|
109
109
|
const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
|
|
@@ -155,19 +155,19 @@ async function prepareLocalChatRun(io, pluginSet) {
|
|
|
155
155
|
await configureLocalChatPlugins(pluginSet);
|
|
156
156
|
const { setExperimentalFeatures } = await import("../experimental-Qn9rKLgx.js").then((n) => n.t);
|
|
157
157
|
setExperimentalFeatures({ subagents: true });
|
|
158
|
-
const { setBriefsConfig } = await import("../agent-hooks-
|
|
158
|
+
const { setBriefsConfig } = await import("../agent-hooks-CDVx26Uu.js").then((n) => n.m);
|
|
159
159
|
setBriefsConfig({ enabled: true });
|
|
160
|
-
const { runLocalAgentTurn } = await import("../runner-
|
|
161
|
-
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-
|
|
160
|
+
const { runLocalAgentTurn } = await import("../runner-CmzoXEI4.js");
|
|
161
|
+
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-i5qdAou6.js");
|
|
162
162
|
const { createLocalOAuthState } = await import("../oauth-relay-CdCnu80W.js").then((n) => n.t);
|
|
163
|
-
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-
|
|
164
|
-
const { bindSpawnAgent } = await import("../spawn-
|
|
165
|
-
const { bindMessageAgent } = await import("../message-
|
|
166
|
-
const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-
|
|
167
|
-
const { startAgentInvocationsForChildInput } = await import("../result-
|
|
168
|
-
const { skipInputBeforeConversationStop } = await import("../session-stop-
|
|
163
|
+
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-DjMNKLZz.js");
|
|
164
|
+
const { bindSpawnAgent } = await import("../spawn-OgTwBUj0.js").then((n) => n.n);
|
|
165
|
+
const { bindMessageAgent } = await import("../message-B9xqD2BP.js").then((n) => n.n);
|
|
166
|
+
const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-BAn43SsN.js").then((n) => n.a);
|
|
167
|
+
const { startAgentInvocationsForChildInput } = await import("../result-Df5nEDX2.js").then((n) => n.r);
|
|
168
|
+
const { skipInputBeforeConversationStop } = await import("../session-stop-BEBfE97J.js").then((n) => n.r);
|
|
169
169
|
const { createLocalConversationWork } = await import("../conversation-work-C6y3T5Hx.js");
|
|
170
|
-
const { processConversationWork } = await import("../worker-
|
|
170
|
+
const { processConversationWork } = await import("../worker-mBXq4_zg.js").then((n) => n.n);
|
|
171
171
|
let agentRunner;
|
|
172
172
|
const localConversationWork = createLocalConversationWork(async (message) => {
|
|
173
173
|
if (!agentRunner) throw new Error("Local agent runner is not ready");
|
package/dist/cli/check.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { D as JUNIOR_HEARTBEAT_ROUTE, M as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, T as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-
|
|
2
|
-
import { _ as parsePluginManifest, g as parseInlinePluginManifest } from "../registry-
|
|
3
|
-
import { i as parseSkillFile } from "../skills-
|
|
1
|
+
import { D as JUNIOR_HEARTBEAT_ROUTE, M as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, T as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-D3aYP0aG.js";
|
|
2
|
+
import { _ as parsePluginManifest, g as parseInlinePluginManifest } from "../registry-CmKmKHpp.js";
|
|
3
|
+
import { i as parseSkillFile } from "../skills-Dc-AMYi4.js";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import fs from "node:fs/promises";
|
|
6
6
|
import { pathToFileURL } from "node:url";
|
package/dist/cli/main.js
CHANGED
|
@@ -25,10 +25,10 @@ async function runChat(argv, pluginSet) {
|
|
|
25
25
|
return await (await import("./chat.js")).runChat(argv, void 0, { pluginSet });
|
|
26
26
|
}
|
|
27
27
|
async function runAdmin(argv) {
|
|
28
|
-
return await (await import("../admin-
|
|
28
|
+
return await (await import("../admin-CeJh4SuR.js")).runAdmin(argv);
|
|
29
29
|
}
|
|
30
30
|
async function runBriefs(argv) {
|
|
31
|
-
return await (await import("../briefs-
|
|
31
|
+
return await (await import("../briefs-iVq_8-ft.js")).runBriefs(argv);
|
|
32
32
|
}
|
|
33
33
|
function topLevelCommand(argv) {
|
|
34
34
|
return (argv[0] === "--" ? argv.slice(1) : argv)[0];
|
package/dist/cli/plugins.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { d as getDb } from "../viewer-
|
|
2
|
-
import { n as pluginCatalogRuntime } from "../catalog-runtime-
|
|
3
|
-
import { d as setPlugins, f as validatePlugins, ft as createPluginLogger } from "../agent-hooks-
|
|
4
|
-
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-
|
|
1
|
+
import { d as getDb } from "../viewer-Rnim7alE.js";
|
|
2
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime-hKmI-iZa.js";
|
|
3
|
+
import { d as setPlugins, f as validatePlugins, ft as createPluginLogger } from "../agent-hooks-CDVx26Uu.js";
|
|
4
|
+
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-LzIilOb6.js";
|
|
5
5
|
import { a as pluginRuntimeRegistrationsFromPluginSet, i as pluginCliRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "../plugins-egKWjgue.js";
|
|
6
6
|
import { t as loadAppPluginSet } from "../plugin-module-CVvEUSMH.js";
|
|
7
7
|
import { stderr, stdout } from "node:process";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as pluginCatalogRuntime } from "../catalog-runtime-
|
|
2
|
-
import { S as disconnectStateAdapter, t as create } from "../profile-
|
|
3
|
-
import { r as resolve } from "../resolve-
|
|
1
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime-hKmI-iZa.js";
|
|
2
|
+
import { S as disconnectStateAdapter, t as create } from "../profile-DnkX3e2S.js";
|
|
3
|
+
import { r as resolve } from "../resolve-jfNHtEBx.js";
|
|
4
4
|
//#region src/cli/snapshot-create.ts
|
|
5
5
|
const DEFAULT_RUNTIME = "node22";
|
|
6
6
|
const DEFAULT_TIMEOUT_MS = 6e5;
|
package/dist/cli/upgrade.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as getChatConfig } from "../config-
|
|
2
|
-
import { t as createJuniorSqlExecutor } from "../executor-
|
|
3
|
-
import { t as createPluginCatalogRuntime } from "../registry-
|
|
1
|
+
import { i as getChatConfig } from "../config-BDAfLTI9.js";
|
|
2
|
+
import { t as createJuniorSqlExecutor } from "../executor-Dh4Ofsnx.js";
|
|
3
|
+
import { t as createPluginCatalogRuntime } from "../registry-CmKmKHpp.js";
|
|
4
4
|
import { n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "../plugins-egKWjgue.js";
|
|
5
5
|
import { t as loadAppPluginSet } from "../plugin-module-CVvEUSMH.js";
|
|
6
6
|
import { basename, dirname, join, resolve } from "node:path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as logException, g as serializeGenAiAttribute, i as extractGenAiUsageAttributes, m as normalizeGenAiFinishReason, p as logWarn, w as withSpan } from "./logging-
|
|
2
|
-
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-
|
|
1
|
+
import { d as logException, g as serializeGenAiAttribute, i as extractGenAiUsageAttributes, m as normalizeGenAiFinishReason, p as logWarn, w as withSpan } from "./logging-D3aYP0aG.js";
|
|
2
|
+
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-1ERtieuM.js";
|
|
3
3
|
import { calculateCost, completeSimple, getEnvApiKey, getModels, registerApiProvider } from "@earendil-works/pi-ai/compat";
|
|
4
4
|
import { stream as streamAnthropic, streamSimple as streamSimpleAnthropic } from "@earendil-works/pi-ai/api/anthropic-messages";
|
|
5
5
|
import { createGatewayProvider } from "@ai-sdk/gateway";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { S as toOptionalTrimmed, o as resolveGatewayModel } from "./client-
|
|
3
|
-
import { p as logWarn } from "./logging-
|
|
2
|
+
import { S as toOptionalTrimmed, o as resolveGatewayModel } from "./client-Clj7onnT.js";
|
|
3
|
+
import { p as logWarn } from "./logging-D3aYP0aG.js";
|
|
4
4
|
import { l as TURN_REASONING_LEVELS, s as modelProfileSchema, t as DEFAULT_MODEL_PROFILES, u as parseTurnReasoningLevel } from "./model-profile-BwU8mqwD.js";
|
|
5
5
|
//#region src/chat/slack/emoji.ts
|
|
6
6
|
const SLACK_EMOJI_NAME_RE = /^(?:[a-z0-9_+-]+)(?:::(?:skin-tone-[2-6]))?$/;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { It as startOAuthFlow, c as deleteMcpAuthSessionsForUserProvider, l as deleteMcpServerSessionId, u as deleteMcpStoredOAuthCredentials } from "./agent-runner-
|
|
2
|
-
import { D as deleteProviderIdentityForSlackUser, c as getConversationEventStore, f as getSqlExecutor } from "./viewer-
|
|
3
|
-
import { u as hasRequiredOAuthScope } from "./registry-
|
|
4
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
5
|
-
import {
|
|
6
|
-
import { w as getStateAdapter } from "./profile-
|
|
7
|
-
import { a as getVercelConversationWorkQueue } from "./job-queue-
|
|
8
|
-
import { m as ensureConversationWake, w as requestConversationWork } from "./store-
|
|
9
|
-
import { n as resolveTurnSessionRouting } from "./turn-session-routing-
|
|
1
|
+
import { It as startOAuthFlow, c as deleteMcpAuthSessionsForUserProvider, l as deleteMcpServerSessionId, u as deleteMcpStoredOAuthCredentials } from "./agent-runner-Caiof09f.js";
|
|
2
|
+
import { D as deleteProviderIdentityForSlackUser, c as getConversationEventStore, f as getSqlExecutor } from "./viewer-Rnim7alE.js";
|
|
3
|
+
import { u as hasRequiredOAuthScope } from "./registry-CmKmKHpp.js";
|
|
4
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-hKmI-iZa.js";
|
|
5
|
+
import { G as loadTurnCheckpoint, X as getTurnRecord, Y as failTurnRecord } from "./tasks-dJooqiip.js";
|
|
6
|
+
import { w as getStateAdapter } from "./profile-DnkX3e2S.js";
|
|
7
|
+
import { a as getVercelConversationWorkQueue } from "./job-queue-BaCL36FY.js";
|
|
8
|
+
import { m as ensureConversationWake, w as requestConversationWork } from "./store-BashBewg.js";
|
|
9
|
+
import { n as resolveTurnSessionRouting } from "./turn-session-routing-BAh_qsBJ.js";
|
|
10
10
|
import { z } from "zod";
|
|
11
11
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
12
12
|
//#region src/chat/task-execution/authorized-turn.ts
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { Ft as resolveBaseUrl, Lt as createUserTokenStore, Nt as formatProviderLabel, Pt as parseOAuthStatePayload, _ as resolvePluginOAuthAccount, d as getMcpAuthSession, f as getMcpStoredOAuthCredentials, o as finalizeMcpAuthorization, p as putMcpStoredOAuthCredentials, s as deleteMcpAuthSession, x as lookupSlackUserProfile, xt as getMcpProviderErrorAttributes } from "./agent-runner-
|
|
2
|
-
import { f as escapeXml } from "./client-
|
|
3
|
-
import { d as logException, h as runBestEffort, p as logWarn } from "./logging-
|
|
4
|
-
import { a as getRuntimeMetadata, n as botConfig } from "./config-
|
|
1
|
+
import { Ft as resolveBaseUrl, Lt as createUserTokenStore, Nt as formatProviderLabel, Pt as parseOAuthStatePayload, _ as resolvePluginOAuthAccount, d as getMcpAuthSession, f as getMcpStoredOAuthCredentials, o as finalizeMcpAuthorization, p as putMcpStoredOAuthCredentials, s as deleteMcpAuthSession, x as lookupSlackUserProfile, xt as getMcpProviderErrorAttributes } from "./agent-runner-Caiof09f.js";
|
|
2
|
+
import { f as escapeXml } from "./client-Clj7onnT.js";
|
|
3
|
+
import { d as logException, h as runBestEffort, p as logWarn } from "./logging-D3aYP0aG.js";
|
|
4
|
+
import { a as getRuntimeMetadata, n as botConfig } from "./config-BDAfLTI9.js";
|
|
5
5
|
import { f as parseSlackUserId } from "./actor-BTtLaeWy.js";
|
|
6
|
-
import { A as upsertIdentity, f as getSqlExecutor, j as upsertLinkedIdentity } from "./viewer-
|
|
6
|
+
import { A as upsertIdentity, f as getSqlExecutor, j as upsertLinkedIdentity } from "./viewer-Rnim7alE.js";
|
|
7
7
|
import { i as homeDir } from "./package-discovery-BVvSnQBB.js";
|
|
8
|
-
import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-
|
|
9
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
10
|
-
import { t as discoverSkills } from "./skills-
|
|
11
|
-
import {
|
|
12
|
-
import { Ht as getSlackClient } from "./agent-hooks-
|
|
13
|
-
import { E as acquireActiveLock, w as getStateAdapter } from "./profile-
|
|
14
|
-
import { i as getConversationPendingAuth } from "./pending-auth-
|
|
15
|
-
import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-
|
|
16
|
-
import { c as deleteWebAuthorization, f as wakeAuthorizedTurn, i as readConnectedOAuthTokens, p as wakePausedTurn } from "./connections-
|
|
8
|
+
import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-CmKmKHpp.js";
|
|
9
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-hKmI-iZa.js";
|
|
10
|
+
import { t as discoverSkills } from "./skills-Dc-AMYi4.js";
|
|
11
|
+
import { Ft as recordAuthorizationCompleted, Pt as recordAuthenticationLinked, X as getTurnRecord, z as postSlackMessage } from "./tasks-dJooqiip.js";
|
|
12
|
+
import { Ht as getSlackClient } from "./agent-hooks-CDVx26Uu.js";
|
|
13
|
+
import { E as acquireActiveLock, w as getStateAdapter } from "./profile-DnkX3e2S.js";
|
|
14
|
+
import { i as getConversationPendingAuth } from "./pending-auth-D2t1Moxf.js";
|
|
15
|
+
import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-CsMC-ob0.js";
|
|
16
|
+
import { c as deleteWebAuthorization, f as wakeAuthorizedTurn, i as readConnectedOAuthTokens, p as wakePausedTurn } from "./connections-BC0RTejT.js";
|
|
17
17
|
import { n as relayLocalOAuthCallback } from "./oauth-relay-CdCnu80W.js";
|
|
18
18
|
import path from "node:path";
|
|
19
19
|
import { z } from "zod";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { d as logException } from "./logging-
|
|
1
|
+
import { d as logException } from "./logging-D3aYP0aG.js";
|
|
2
2
|
import { g as startSpanManual } from "./sentry-CgWZM_kV.js";
|
|
3
|
-
import "./config-
|
|
3
|
+
import "./config-BDAfLTI9.js";
|
|
4
4
|
import { a as juniorAgentInvocations, c as juniorIdentities, d as juniorDestinations, f as timestamptz, i as juniorAgentBindings, l as juniorUsers, s as juniorConversations } from "./agent-invocations-BY60iNw-.js";
|
|
5
5
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
6
6
|
import { sql } from "drizzle-orm";
|
|
@@ -313,8 +313,8 @@ const juniorAutomations = pgTable("junior_automations", {
|
|
|
313
313
|
teamId: text("team_id").notNull(),
|
|
314
314
|
channelId: text("channel_id").notNull(),
|
|
315
315
|
creatorSlackUserId: text("creator_slack_user_id").notNull(),
|
|
316
|
-
/**
|
|
317
|
-
creatorIdentityId: text("creator_identity_id"),
|
|
316
|
+
/** Junior identity that created the Automation. It decides ownership. */
|
|
317
|
+
creatorIdentityId: text("creator_identity_id").notNull().references(() => juniorIdentities.id),
|
|
318
318
|
status: text("status").$type().notNull(),
|
|
319
319
|
/** Why a run blocked this Automation, until its creator resumes it. */
|
|
320
320
|
statusReason: text("status_reason"),
|
|
@@ -332,8 +332,7 @@ const juniorAutomations = pgTable("junior_automations", {
|
|
|
332
332
|
check("junior_automations_record_check", sql`jsonb_typeof(${table.record}) = 'object'`),
|
|
333
333
|
check("junior_automations_trigger_check", sql`(${table.kind} = 'scheduled' and ${table.namespace} is null and ${table.identifier} is null) or (${table.kind} = 'event' and ${table.namespace} is not null and ${table.identifier} is not null and ${table.nextRunAtMs} is null and ${table.runNowAtMs} is null and ${table.status} <> 'completed')`),
|
|
334
334
|
index("junior_automations_team_idx").on(table.teamId, table.createdAtMs, table.id).where(sql`${table.status} <> 'deleted'`),
|
|
335
|
-
index("
|
|
336
|
-
index("junior_automations_creator_identity_idx").on(table.creatorIdentityId, table.createdAtMs, table.id).where(sql`${table.creatorIdentityId} IS NOT NULL`),
|
|
335
|
+
index("junior_automations_creator_identity_idx").on(table.creatorIdentityId, table.createdAtMs, table.id),
|
|
337
336
|
index("junior_automations_run_now_due_idx").on(table.runNowAtMs, table.createdAtMs, table.id).where(sql`${table.status} = 'active' AND ${table.runNowAtMs} IS NOT NULL`),
|
|
338
337
|
index("junior_automations_next_run_due_idx").on(table.nextRunAtMs, table.createdAtMs, table.id).where(sql`${table.status} = 'active' AND ${table.nextRunAtMs} IS NOT NULL`),
|
|
339
338
|
index("junior_automations_match_idx").on(table.namespace, table.identifier, table.createdAtMs, table.id).where(sql`${table.status} <> 'deleted'`)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { D as storeAttachment, T as readLiveAttachment } from "./agent-runner-
|
|
3
|
-
import { f as getSqlExecutor } from "./viewer-
|
|
2
|
+
import { D as storeAttachment, T as readLiveAttachment } from "./agent-runner-Caiof09f.js";
|
|
3
|
+
import { f as getSqlExecutor } from "./viewer-Rnim7alE.js";
|
|
4
4
|
import { L as detectImageMediaType } from "./conversation-T18Xlkx9.js";
|
|
5
5
|
//#region src/chat/attachments/images.ts
|
|
6
6
|
var images_exports = /* @__PURE__ */ __exportAll({
|
package/dist/instrumentation.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { N as getDeploymentServiceVersion, P as getDeploymentTelemetryAttributes } from "./logging-
|
|
1
|
+
import { N as getDeploymentServiceVersion, P as getDeploymentTelemetryAttributes } from "./logging-D3aYP0aG.js";
|
|
2
2
|
import { _ as vercelAIIntegration, a as getClient, b as withStreamedSpan, c as init, o as getGlobalScope } from "./sentry-CgWZM_kV.js";
|
|
3
|
-
import { n as getCurrentConversationPrivacy } from "./conversation-privacy-
|
|
3
|
+
import { n as getCurrentConversationPrivacy } from "./conversation-privacy-1ERtieuM.js";
|
|
4
4
|
import { t as consumePrivateTraceResultMarker } from "./private-trace-result-BLvBjy_e.js";
|
|
5
5
|
//#region src/chat/sentry-payload-filter.ts
|
|
6
6
|
const PAYLOAD_ATTRIBUTE_KEYS = /* @__PURE__ */ new Set([
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as getChatConfig } from "./config-
|
|
1
|
+
import { i as getChatConfig } from "./config-BDAfLTI9.js";
|
|
2
2
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { createHash, createHmac, timingSafeEqual } from "node:crypto";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { d as setTag, f as setUser, h as startSpan, i as getActiveSpan, l as logger, n as captureMessage, p as spanToJSON, s as getTraceData, t as captureException, y as withScope } from "./sentry-CgWZM_kV.js";
|
|
2
|
-
import { t as JUNIOR_VERSION } from "./version-
|
|
2
|
+
import { t as JUNIOR_VERSION } from "./version-CDM8Rq6E.js";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { styleText } from "node:util";
|
|
5
5
|
import { ConfigError, configureSync, getConfig, getLogger } from "@logtape/logtape";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { Ht as toolInvocationDestination, Q as getActiveAgentInvocationForConversation, Vt as actorFromRun, Y as createAgentInvocationForMessage, Z as findChildAgentConversationId, _t as AgentMessageTargetError, vt as PARENT_AGENT_TARGET } from "./agent-runner-
|
|
3
|
-
import { n as enqueueAgentMessageToParent } from "./result-
|
|
4
|
-
import { r as enqueueAgentInvocation } from "./work-
|
|
2
|
+
import { Ht as toolInvocationDestination, Q as getActiveAgentInvocationForConversation, Vt as actorFromRun, Y as createAgentInvocationForMessage, Z as findChildAgentConversationId, _t as AgentMessageTargetError, vt as PARENT_AGENT_TARGET } from "./agent-runner-Caiof09f.js";
|
|
3
|
+
import { n as enqueueAgentMessageToParent } from "./result-Df5nEDX2.js";
|
|
4
|
+
import { r as enqueueAgentInvocation } from "./work-BAn43SsN.js";
|
|
5
5
|
//#region src/chat/agent-invocations/message.ts
|
|
6
6
|
var message_exports = /* @__PURE__ */ __exportAll({ bindMessageAgent: () => bindMessageAgent });
|
|
7
7
|
/**
|
package/dist/nitro.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A as JUNIOR_RETENTION_ROUTE, D as JUNIOR_HEARTBEAT_ROUTE, E as JUNIOR_HEARTBEAT_CRON_SCHEDULE, O as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, T as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, j as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, k as JUNIOR_RETENTION_CRON_SCHEDULE } from "./logging-
|
|
1
|
+
import { A as JUNIOR_RETENTION_ROUTE, D as JUNIOR_HEARTBEAT_ROUTE, E as JUNIOR_HEARTBEAT_CRON_SCHEDULE, O as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, T as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, j as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, k as JUNIOR_RETENTION_CRON_SCHEDULE } from "./logging-D3aYP0aG.js";
|
|
2
2
|
import { d as resolvePackageDir, t as discoverInstalledPluginPackageContent, u as isValidPackageName } from "./package-discovery-BVvSnQBB.js";
|
|
3
|
-
import { o as resolveConversationWorkQueueTopic, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-
|
|
3
|
+
import { o as resolveConversationWorkQueueTopic, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-BaCL36FY.js";
|
|
4
4
|
import { a as pluginRuntimeRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "./plugins-egKWjgue.js";
|
|
5
|
-
import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-
|
|
5
|
+
import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-VvIKqlQ4.js";
|
|
6
6
|
import { n as loadPluginSetFromModule, r as resolvePluginModule } from "./plugin-module-CVvEUSMH.js";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import { cpSync, existsSync, mkdirSync, readdirSync, statSync } from "node:fs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Lt as createUserTokenStore } from "./agent-runner-
|
|
2
|
-
import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-
|
|
1
|
+
import { Lt as createUserTokenStore } from "./agent-runner-Caiof09f.js";
|
|
2
|
+
import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-BZuqqIHk.js";
|
|
3
3
|
import { createServer } from "node:http";
|
|
4
4
|
//#region src/chat/local/oauth-callback-server.ts
|
|
5
5
|
const LOCAL_OAUTH_TIMEOUT_MS = 6e5;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { v as isProviderRetryError } from "./client-
|
|
2
|
-
import {
|
|
1
|
+
import { v as isProviderRetryError } from "./client-Clj7onnT.js";
|
|
2
|
+
import { cn as estimateTextTokens, q as abandonTurnRecord } from "./tasks-dJooqiip.js";
|
|
3
3
|
import { r as isExperimentalFeatureEnabled } from "./experimental-Qn9rKLgx.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region src/chat/state/turn-id.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { S as toOptionalTrimmed } from "./client-
|
|
2
|
-
import { v as setSpanAttributes, y as setSpanStatus } from "./logging-
|
|
3
|
-
import { i as getChatConfig } from "./config-
|
|
4
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
1
|
+
import { S as toOptionalTrimmed } from "./client-Clj7onnT.js";
|
|
2
|
+
import { v as setSpanAttributes, y as setSpanStatus } from "./logging-D3aYP0aG.js";
|
|
3
|
+
import { i as getChatConfig } from "./config-BDAfLTI9.js";
|
|
4
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-hKmI-iZa.js";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
import { createMemoryState } from "@chat-adapter/state-memory";
|
|
7
7
|
import { createRedisState } from "@chat-adapter/state-redis";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as logInfo, p as logWarn, v as setSpanAttributes } from "./logging-
|
|
1
|
+
import { f as logInfo, p as logWarn, v as setSpanAttributes } from "./logging-D3aYP0aG.js";
|
|
2
2
|
import { o as parseActorUserId } from "./actor-BTtLaeWy.js";
|
|
3
3
|
import { n as normalizePluginPackageNames, o as pluginRoots, t as discoverInstalledPluginPackageContent } from "./package-discovery-BVvSnQBB.js";
|
|
4
4
|
import path from "node:path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { v as setSpanAttributes, w as withSpan } from "./logging-
|
|
2
|
-
import { N as SANDBOX_WORKSPACE_ROOT, k as sleep, r as isStale, t as create, u as isSandboxUnavailableError, v as getVercelSandboxCredentials, w as getStateAdapter, x as runNonInteractiveCommand } from "./profile-
|
|
1
|
+
import { v as setSpanAttributes, w as withSpan } from "./logging-D3aYP0aG.js";
|
|
2
|
+
import { N as SANDBOX_WORKSPACE_ROOT, k as sleep, r as isStale, t as create, u as isSandboxUnavailableError, v as getVercelSandboxCredentials, w as getStateAdapter, x as runNonInteractiveCommand } from "./profile-DnkX3e2S.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { FileSystem, Sandbox } from "@vercel/sandbox";
|
|
5
5
|
//#region src/chat/sandbox/resources.ts
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { $ as getAgentInvocation, X as createAgentInvocationFromLatest, ct as isTerminalAgentInvocation, et as getAgentInvocationIdForEvents, ft as markAgentInvocationParentMailboxAppended, it as getAgentInvocationResultMessageId, nt as getAgentInvocationIdForResult, st as getLatestAgentInvocationForConversation, tt as getAgentInvocationIdForMessage } from "./agent-runner-
|
|
2
|
+
import { $ as getAgentInvocation, X as createAgentInvocationFromLatest, ct as isTerminalAgentInvocation, et as getAgentInvocationIdForEvents, ft as markAgentInvocationParentMailboxAppended, it as getAgentInvocationResultMessageId, nt as getAgentInvocationIdForResult, st as getLatestAgentInvocationForConversation, tt as getAgentInvocationIdForMessage } from "./agent-runner-Caiof09f.js";
|
|
3
3
|
import { t as createActor } from "./actor-BTtLaeWy.js";
|
|
4
|
-
import { d as credentialContextForActor } from "./registry-
|
|
5
|
-
import {
|
|
6
|
-
import { a as EVENT_WAIT_MS, c as timerWatchCredentialSubject, s as isEventMailboxMetadata } from "./session-stop-
|
|
4
|
+
import { d as credentialContextForActor } from "./registry-CmKmKHpp.js";
|
|
5
|
+
import { X as getTurnRecord, Z as listTurnSummaries } from "./tasks-dJooqiip.js";
|
|
6
|
+
import { a as EVENT_WAIT_MS, c as timerWatchCredentialSubject, s as isEventMailboxMetadata } from "./session-stop-BEBfE97J.js";
|
|
7
7
|
import { a as EVENT_SYSTEM_ACTOR, i as EVENT_MESSAGE_AUTHOR, o as isEventConversationMessage } from "./prompt-C04mP1hu.js";
|
|
8
|
-
import { r as appendAndEnqueueInboundMessage } from "./store-
|
|
9
|
-
import { r as enqueueAgentInvocation } from "./work-
|
|
8
|
+
import { r as appendAndEnqueueInboundMessage } from "./store-BashBewg.js";
|
|
9
|
+
import { r as enqueueAgentInvocation } from "./work-BAn43SsN.js";
|
|
10
10
|
import { z } from "zod";
|
|
11
11
|
import { createEventSource, createLocalSource, createWebSource } from "@sentry/junior-plugin-api";
|
|
12
12
|
//#region src/chat/task-execution/mailbox-input.ts
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { C as withLogContext, b as setTags, d as logException } from "./logging-
|
|
2
|
-
import { c as getConversationEventStore, u as getConversationStore } from "./viewer-
|
|
3
|
-
import { d as credentialContextForActor } from "./registry-
|
|
4
|
-
import {
|
|
1
|
+
import { C as withLogContext, b as setTags, d as logException } from "./logging-D3aYP0aG.js";
|
|
2
|
+
import { c as getConversationEventStore, u as getConversationStore } from "./viewer-Rnim7alE.js";
|
|
3
|
+
import { d as credentialContextForActor } from "./registry-CmKmKHpp.js";
|
|
4
|
+
import { $ as persistWithRetry, Ct as commitAcceptedReply, Ft as recordAuthorizationCompleted, K as saveTurnCheckpoint, Ot as loadProjection, Qt as buildConversationContext, Ut as hydrateConversationMessages, Wt as persistConversationMessages, an as recordDeliveredAssistantMessage, in as normalizeConversationText, rn as markConversationMessage, sn as upsertConversationMessage } from "./tasks-dJooqiip.js";
|
|
5
5
|
import { K as messageCardText } from "./conversation-T18Xlkx9.js";
|
|
6
6
|
import { f as markTurnFailed, p as startActiveTurn, t as authorizationId } from "./oauth-authorization-BA4Dt6a7.js";
|
|
7
|
-
import { n as getAssistantReplyText } from "./assistant-reply-
|
|
8
|
-
import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-
|
|
9
|
-
import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-
|
|
10
|
-
import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-
|
|
11
|
-
import { d as loadPendingMessageCards, i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, t as finalizeFailedTurnReplyWithEvent } from "./turn-failure-response-
|
|
7
|
+
import { n as getAssistantReplyText } from "./assistant-reply-BddmM66R.js";
|
|
8
|
+
import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-D2CpD6GN.js";
|
|
9
|
+
import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-BfodfmiY.js";
|
|
10
|
+
import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-CsMC-ob0.js";
|
|
11
|
+
import { d as loadPendingMessageCards, i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, t as finalizeFailedTurnReplyWithEvent } from "./turn-failure-response-zB364t7_.js";
|
|
12
12
|
import { randomUUID } from "node:crypto";
|
|
13
13
|
import { createLocalSource, localDestinationSchema } from "@sentry/junior-plugin-api";
|
|
14
14
|
//#region src/chat/local/runner.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Mt as sandboxEgressSignalsResponseSchema } from "./agent-runner-
|
|
1
|
+
import { Mt as sandboxEgressSignalsResponseSchema } from "./agent-runner-Caiof09f.js";
|
|
2
2
|
//#region src/chat/local/sandbox-egress-signals.ts
|
|
3
3
|
const SANDBOX_EGRESS_SIGNALS_PATH = "/api/internal/sandbox-egress/signals";
|
|
4
4
|
const LOCAL_DEV_SERVER_TIMEOUT_MS = 1e3;
|