@sentry/junior 0.243.0 → 0.245.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-DHOGoI03.js → admin-BEbNsG87.js} +1 -1
- package/dist/{agent-hooks-Cqo6ULp6.js → agent-hooks-Caa0Qh_Q.js} +22 -12
- package/dist/{agent-invocations-BzRAZ_nj.js → agent-invocations-BO6ddZax.js} +1 -0
- package/dist/{agent-runner-BZOjoMlZ.js → agent-runner-BEuPFbbv.js} +199 -57
- package/dist/api/schema.d.ts +78 -3
- package/dist/api/schema.js +3 -3
- package/dist/api.js +316 -246
- package/dist/{app-DRLh-8zs.d.ts → app-BYB7szGb.d.ts} +2 -0
- package/dist/app.d.ts +1 -1
- package/dist/app.js +172 -105
- package/dist/{briefs-C4GogKaB.js → briefs-DFAh_jTW.js} +4 -4
- package/dist/{catalog-runtime-jazDa-oO.js → catalog-runtime-wmq_fqff.js} +1 -1
- package/dist/cli/chat.js +12 -12
- 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-Es79bknZ.js → client-Bn9SRFCi.js} +2 -2
- package/dist/{config-gype19qQ.js → config-_XAINZMN.js} +11 -2
- package/dist/{conversation-mt3yJ09u.js → conversation-CvBG57Io.js} +15 -2
- package/dist/{conversation-privacy-BIplVfmz.js → conversation-privacy-BN5SGxsF.js} +1 -1
- package/dist/{credential-sync-BY97dkST.js → credential-sync-BvaUm6HQ.js} +14 -14
- package/dist/{executor-C7bsEF-c.js → executor-CFIqoCNJ.js} +3 -3
- package/dist/{history-DlsoHsoe.js → history-Nte1oVed.js} +3 -0
- package/dist/{images-WmrEAtto.js → images-Ci43I3ek.js} +3 -3
- package/dist/instrumentation.js +2 -2
- package/dist/{job-queue-DQDesz8a.js → job-queue-CGicV7x6.js} +1 -1
- package/dist/{logging-CdZ1LQJ7.js → logging-Bs3dV81s.js} +1 -1
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-authorization-Di0KlyoJ.js → oauth-authorization-COzWmMjO.js} +1 -1
- package/dist/{oauth-callback-server-Cmog7Q3T.js → oauth-callback-server-17c9_39v.js} +2 -2
- package/dist/{pending-auth-CNAlGOyl.js → pending-auth-Bnhg7Q9k.js} +2 -2
- package/dist/{profile-qqt_2di0.js → profile-BA471c-l.js} +4 -4
- package/dist/{prompt-D_cg2iqi.js → prompt-C9Q9cjD3.js} +1 -1
- package/dist/{registry-WOJKAIRI.js → registry-BYNOFO6e.js} +1 -1
- package/dist/{resolve-C8VvY0lg.js → resolve-rpz8No2i.js} +2 -2
- package/dist/{runner-DojxjGmt.js → runner-C8DRk9X6.js} +10 -10
- package/dist/{sandbox-egress-signals-B7azPnsm.js → sandbox-egress-signals-B8hurjFt.js} +1 -1
- package/dist/{schema-nQRsPWSr.js → schema-WRgR9EL6.js} +11 -6
- package/dist/{skills-Zj-9pbSU.js → skills-C4yrD2NR.js} +2 -2
- package/dist/{spawn-DDJ5z9IC.js → spawn-CdAaTXrY.js} +4 -3
- package/dist/{task-queue-CAi-XM8x.js → task-queue-BBxHzlIB.js} +3 -3
- package/dist/{task-runner-CIP2asjP.js → task-runner-BqFapTjs.js} +12 -12
- package/dist/{tasks-Qx6Fos_R.js → tasks-Ddd7OAkp.js} +83 -12
- package/dist/{thread-state-BN_5S1bx.js → thread-state-DqErwbA8.js} +7 -7
- package/dist/{turn-failure-response-B1UW2T7a.js → turn-failure-response-DtL1-fOl.js} +9 -9
- package/dist/{turn-lifecycle-BzeE4sVD.js → turn-lifecycle-B5pzyD6W.js} +1 -1
- package/dist/{turn-session-routing-DsvU39zW.js → turn-session-routing-D6pTU5uF.js} +1 -1
- package/dist/{validation-Dklx_nds.js → validation-BAzlyNIc.js} +1 -1
- package/dist/{version-BvG02ZTN.js → version-CiXDH3oe.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-B7qDM2DM.js → viewer-wCn8xneI.js} +5 -5
- package/dist/{web-authorization-Cqv7bP19.js → web-authorization-d5MtGpfG.js} +6 -6
- package/dist/{web-input-CqnqSfzI.js → web-input-BZTiCtvP.js} +71 -48
- package/dist/{work-D_BBvd4I.js → work-4QPqTd5_.js} +6 -6
- package/dist/{worker-BWdV_5Ys.js → worker-mc62tybz.js} +5 -5
- package/migrations/0052_agent_invocation_title.sql +1 -0
- package/migrations/meta/0052_snapshot.json +3765 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +5 -5
|
@@ -61,6 +61,8 @@ interface RuntimeLimits {
|
|
|
61
61
|
maxAgentDepth?: number;
|
|
62
62
|
/** Automated turns in a row before Junior stops answering automation. */
|
|
63
63
|
maxConsecutiveAutomatedTurns?: number;
|
|
64
|
+
/** Runs one Event automation can start in a rolling hour. */
|
|
65
|
+
maxEventAutomationRunsPerHour?: number;
|
|
64
66
|
/** Run slices one turn may use. */
|
|
65
67
|
maxSlicesPerTurn?: number;
|
|
66
68
|
/** Tool calls one turn may make. */
|
package/dist/app.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as ModelProfileInput, n as createApp, r as JuniorDashboardOptions, t as JuniorAppOptions } from "./app-
|
|
1
|
+
import { i as ModelProfileInput, n as createApp, r as JuniorDashboardOptions, t as JuniorAppOptions } from "./app-BYB7szGb.js";
|
|
2
2
|
import { i as defineJuniorPlugins, n as JuniorPluginSet, r as JuniorPluginSetOptions, t as JuniorPluginInput } from "./plugins-CjfUP5gJ.js";
|
|
3
3
|
import { t as JUNIOR_VERSION } from "./version-CnXZ614E.js";
|
|
4
4
|
export { JUNIOR_VERSION, JuniorAppOptions, type JuniorDashboardOptions, type JuniorPluginInput, type JuniorPluginSet, type JuniorPluginSetOptions, type ModelProfileInput, createApp, defineJuniorPlugins };
|
package/dist/app.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { $t as
|
|
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-
|
|
3
|
-
import { 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-
|
|
1
|
+
import { $t as isInvalidConversationRecordError, B as effectiveTaskOutcomes, Dn as setConfigDefaults, E as requestAttachmentDeletion, En as getConfigDefaults, F as logScheduledAutomationRunSkipped, Ft as ensureConversationWake, Gt as requestConversationWork, I as scheduledAutomationRunAttributes, It as getConversation, Lt as getConversationWorkState, O as parseSlackThreadId, Rt as hasRunnableConversationWork, U as recordSubagentEnded, Ut as removeActiveConversation, Yt as CONVERSATION_WORK_STALE_ENQUEUE_MS, Zt as hasRunnableConversationWork$1, _t as SLACK_EVENT_NAMESPACE, an as shouldPropagateSandboxEgressTrace, b as unpublishedArtifactHeaders, c as deleteMcpAuthSessionsForUserProvider, cn as consumeSandboxEgressAuthRequiredSignal, dt as processWorkspaceSnapshotJob, en as renderTaskInput, fn as formatProviderLabel, ft as ingestEvent, gn as createUserTokenStore, gt as getEventCatalog, hn as startOAuthFlow, i as executeCredentialedEgressRequest, in as normalizeSandboxEgressTracePropagationDomains, it as listPendingAgentInvocationResults, kt as clearExpiredConversationLease, l as deleteMcpServerSessionId, ln as consumeSandboxEgressPermissionDeniedSignal, n as executeAgentRun, on as SANDBOX_EGRESS_PROXY_PATH, qt as stopConversationWork, rn as resolveSandboxEgressProviderForHost, rt as listPendingAgentInvocationMailboxAppends, sn as clearSandboxEgressSignals, t as createAgentRunner, u as deleteMcpStoredOAuthCredentials, un as parseSandboxEgressCredentialToken, v as publicArtifactHeaders, vt as slackChannelMessageEvent, w as collectAttachmentGarbage, wt as appendAndEnqueueInboundMessage, x as lookupSlackUserProfile, xt as eventGuidance, y as readPublicArtifact, yt as slackChannelMessageReplyThreadTs, zt as listActiveConversationIds } from "./agent-runner-BEuPFbbv.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-Bs3dV81s.js";
|
|
3
|
+
import { n as captureMessage, r as continueTrace } from "./sentry-CgWZM_kV.js";
|
|
4
|
+
import { t as JUNIOR_VERSION } from "./version-CiXDH3oe.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-_XAINZMN.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 { D as deleteProviderIdentityForSlackUser, c as getConversationEventStore, d as getDb, f as getSqlExecutor, g as withConversationMutationLock, m as withConversationEventLock, r as readActorIdentity, u as getConversationStore } from "./viewer-
|
|
8
|
-
import { a as juniorAgentInvocations, d as juniorDestinations, i as juniorAgentBindings, s as juniorConversations } from "./agent-invocations-
|
|
9
|
-
import { _ as juniorConversationEvents, a as juniorSchedulerRuns, m as juniorConversationBriefs, o as juniorSchedulerTasks } from "./executor-
|
|
10
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
11
|
-
import {
|
|
12
|
-
import { $ as verifySlackDirectCredentialSubject, At as listConversationAnnotations, Dt as resolveRootVisibility, G as findMatchingWatches, Gt as getWorkspaceTeamId, J as bindEventAutomationCredentialSubject, Kt as runWithWorkspaceTeamId, Q as verifyScheduledAutomationCredentialSubject, V as collectEventMatchKeys, Vt as isDmChannel, X as bindSlackDirectCredentialSubject, Y as bindScheduledAutomationCredentialSubject, Z as verifyEventAutomationCredentialSubject, a as getPluginRoutes, at as setDashboardConversationLinkOptions, d as setPlugins, f as validatePlugins, h as setBriefsConfig, i as getPluginApiRoutes, it as getDashboardTaskLink, lt as createPluginLogger, nt as getDashboardConversationLink, ot as createPluginState, q as takeDueTimerWatches, u as getPlugins, ut as readConversationAccessFromSql, z as cancelSubscriptions, zt as getSlackClient } from "./agent-hooks-
|
|
13
|
-
import {
|
|
14
|
-
import { O as withLock$1, w as getStateAdapter } from "./profile-
|
|
15
|
-
import { c as getThreadStopDecision } from "./pending-auth-
|
|
7
|
+
import { D as deleteProviderIdentityForSlackUser, c as getConversationEventStore, d as getDb, f as getSqlExecutor, g as withConversationMutationLock, m as withConversationEventLock, r as readActorIdentity, u as getConversationStore } from "./viewer-wCn8xneI.js";
|
|
8
|
+
import { a as juniorAgentInvocations, d as juniorDestinations, i as juniorAgentBindings, s as juniorConversations } from "./agent-invocations-BO6ddZax.js";
|
|
9
|
+
import { _ as juniorConversationEvents, a as juniorSchedulerRuns, m as juniorConversationBriefs, o as juniorSchedulerTasks } from "./executor-CFIqoCNJ.js";
|
|
10
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-wmq_fqff.js";
|
|
11
|
+
import { C as eventAutomationRunLimitReason, F as slackMention, G as slackExternalRefIdSchema, S as admitEventAutomationRun, Vt as appendConversationMessages, W as slackEntitySchema, Wt as projectConversationMessages, a as readScheduledAutomation, c as scheduledRunId, d as collectEventAutomationMatchKeys, h as findMatchingEventAutomations, l as withScheduledAutomationLock, n as listScheduledAutomations, qt as settleConversationTitleWork, r as listScheduledAutomationsForTeam, s as saveScheduledAutomationInLock, u as blockEventAutomation } from "./tasks-Ddd7OAkp.js";
|
|
12
|
+
import { $ as verifySlackDirectCredentialSubject, At as listConversationAnnotations, Dt as resolveRootVisibility, G as findMatchingWatches, Gt as getWorkspaceTeamId, J as bindEventAutomationCredentialSubject, Kt as runWithWorkspaceTeamId, Q as verifyScheduledAutomationCredentialSubject, V as collectEventMatchKeys, Vt as isDmChannel, X as bindSlackDirectCredentialSubject, Y as bindScheduledAutomationCredentialSubject, Z as verifyEventAutomationCredentialSubject, a as getPluginRoutes, at as setDashboardConversationLinkOptions, d as setPlugins, f as validatePlugins, h as setBriefsConfig, i as getPluginApiRoutes, it as getDashboardTaskLink, lt as createPluginLogger, nt as getDashboardConversationLink, ot as createPluginState, q as takeDueTimerWatches, u as getPlugins, ut as readConversationAccessFromSql, z as cancelSubscriptions, zt as getSlackClient } from "./agent-hooks-Caa0Qh_Q.js";
|
|
13
|
+
import { H as annotationCard } from "./conversation-CvBG57Io.js";
|
|
14
|
+
import { O as withLock$1, w as getStateAdapter } from "./profile-BA471c-l.js";
|
|
15
|
+
import { c as getThreadStopDecision } from "./pending-auth-Bnhg7Q9k.js";
|
|
16
16
|
import { n as getNextRunAtMs } from "./cadence-D00SCzT1.js";
|
|
17
|
-
import { f as setSandboxResourceConfig, u as getSandboxResourceConfig } from "./resolve-
|
|
18
|
-
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-
|
|
17
|
+
import { f as setSandboxResourceConfig, u as getSandboxResourceConfig } from "./resolve-rpz8No2i.js";
|
|
18
|
+
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-CGicV7x6.js";
|
|
19
19
|
import { D as scheduledRunSchema } from "./automation-gznOMaQ2.js";
|
|
20
20
|
import { i as setExperimentalFeatures, n as getExperimentalFeatures, r as isExperimentalFeatureEnabled } from "./experimental-Qn9rKLgx.js";
|
|
21
|
-
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-
|
|
21
|
+
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-BAzlyNIc.js";
|
|
22
22
|
import { a as pluginRuntimeRegistrationsFromPluginSet, n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "./plugins-egKWjgue.js";
|
|
23
|
-
import { A as withNormalizedThreadId, B as enqueueAgentDispatch, C as buildSlackInboundMessage, D as isSlackMessageStopped, E as verifySlackSignature, F as parseContent, I as renderSlackObjectCard, L as createVercelAttachmentStorage, N as THREAD_OPTOUT_ACK, O as stopSlackThread, P as startProcessingReaction, R as enqueueAgentInvocationResult, S as recordSkippedConversationMessage, T as runWithSlackInstallation, V as GET$3, a as recordWebConversationActivity, c as createProductionSlackWebhookServices, f as createSlackWebApiStatusSender, j as getAuthPausedConversationTurnId, k as normalizeIncomingSlackThreadId, l as getProductionSlackAdapter, n as conversationTurnIdForMessage, o as webActorFromEmail, s as createProductionConversationWorkOptions, t as appendAndEnqueueWebMessage, v as readViewerAutomationSummary, w as clearSlackPendingReactions } from "./web-input-
|
|
24
|
-
import { _ as markDispatchFailed, a as confirmDispatchMailboxAppend, d as getPluginDispatchProjection, f as isTerminalDispatchStatus, k as recordAutomationExecution, l as getDispatchRecord, o as createOrGetDispatch, p as listPendingDispatchMailboxAppends, s as getDispatchConversationId, t as processPluginTask, y as notifyAutomationBlocked } from "./task-runner-
|
|
25
|
-
import { r as enqueueAgentInvocation } from "./work-
|
|
26
|
-
import { s as coerceThreadConversationState } from "./thread-state-
|
|
27
|
-
import { a as GET$4, i as publishAppHomeView, r as GET$5, t as receiveLocalOAuthCredential } from "./credential-sync-
|
|
28
|
-
import { a as registerVercelPluginTaskDevConsumer, n as createVercelPluginTaskCallback, s as queueCallback } from "./task-queue-
|
|
29
|
-
import { t as processConversationWork } from "./worker-
|
|
30
|
-
import { t as bindSpawnAgent } from "./spawn-
|
|
23
|
+
import { A as withNormalizedThreadId, B as enqueueAgentDispatch, C as buildSlackInboundMessage, D as isSlackMessageStopped, E as verifySlackSignature, F as parseContent, I as renderSlackObjectCard, L as createVercelAttachmentStorage, N as THREAD_OPTOUT_ACK, O as stopSlackThread, P as startProcessingReaction, R as enqueueAgentInvocationResult, S as recordSkippedConversationMessage, T as runWithSlackInstallation, V as GET$3, a as recordWebConversationActivity, c as createProductionSlackWebhookServices, f as createSlackWebApiStatusSender, j as getAuthPausedConversationTurnId, k as normalizeIncomingSlackThreadId, l as getProductionSlackAdapter, n as conversationTurnIdForMessage, o as webActorFromEmail, s as createProductionConversationWorkOptions, t as appendAndEnqueueWebMessage, v as readViewerAutomationSummary, w as clearSlackPendingReactions } from "./web-input-BZTiCtvP.js";
|
|
24
|
+
import { _ as markDispatchFailed, a as confirmDispatchMailboxAppend, d as getPluginDispatchProjection, f as isTerminalDispatchStatus, k as recordAutomationExecution, l as getDispatchRecord, o as createOrGetDispatch, p as listPendingDispatchMailboxAppends, s as getDispatchConversationId, t as processPluginTask, y as notifyAutomationBlocked } from "./task-runner-BqFapTjs.js";
|
|
25
|
+
import { r as enqueueAgentInvocation } from "./work-4QPqTd5_.js";
|
|
26
|
+
import { s as coerceThreadConversationState } from "./thread-state-DqErwbA8.js";
|
|
27
|
+
import { a as GET$4, i as publishAppHomeView, r as GET$5, t as receiveLocalOAuthCredential } from "./credential-sync-BvaUm6HQ.js";
|
|
28
|
+
import { a as registerVercelPluginTaskDevConsumer, n as createVercelPluginTaskCallback, s as queueCallback } from "./task-queue-BBxHzlIB.js";
|
|
29
|
+
import { t as processConversationWork } from "./worker-mc62tybz.js";
|
|
30
|
+
import { t as bindSpawnAgent } from "./spawn-CdAaTXrY.js";
|
|
31
31
|
import { createRequire } from "node:module";
|
|
32
32
|
import { Hono } from "hono";
|
|
33
33
|
import { z } from "zod";
|
|
@@ -1439,12 +1439,20 @@ async function getJwks(issuer) {
|
|
|
1439
1439
|
});
|
|
1440
1440
|
return jwks;
|
|
1441
1441
|
}
|
|
1442
|
-
/**
|
|
1443
|
-
|
|
1442
|
+
/**
|
|
1443
|
+
* Verify Vercel signed this Sandbox firewall proxy request for the active VM session.
|
|
1444
|
+
*
|
|
1445
|
+
* `currentDate` is the time for the `exp` and `nbf` checks. It defaults to
|
|
1446
|
+
* now. Evals pass the real time because they replace `Date`.
|
|
1447
|
+
*/
|
|
1448
|
+
async function verifyVercelSandboxOidcToken(token, options = {}) {
|
|
1444
1449
|
const unverified = decodeJwt(token);
|
|
1445
1450
|
if (typeof unverified.iss !== "string") throw new Error("Vercel OIDC token did not include an issuer");
|
|
1446
1451
|
const jwks = await getJwks(unverified.iss);
|
|
1447
|
-
return (await jwtVerify(token, jwks, {
|
|
1452
|
+
return (await jwtVerify(token, jwks, {
|
|
1453
|
+
issuer: unverified.iss,
|
|
1454
|
+
...options.currentDate ? { currentDate: options.currentDate } : void 0
|
|
1455
|
+
})).payload;
|
|
1448
1456
|
}
|
|
1449
1457
|
//#endregion
|
|
1450
1458
|
//#region src/chat/sandbox/egress/proxy.ts
|
|
@@ -1693,7 +1701,8 @@ async function proxySandboxEgressRequest(request, deps = {}) {
|
|
|
1693
1701
|
async function ALL(request, options = {}) {
|
|
1694
1702
|
return await proxySandboxEgressRequest(request, {
|
|
1695
1703
|
interceptHttp: options.interceptHttp,
|
|
1696
|
-
tracePropagation: options.tracePropagation
|
|
1704
|
+
tracePropagation: options.tracePropagation,
|
|
1705
|
+
verifyOidc: options.verifyOidc
|
|
1697
1706
|
});
|
|
1698
1707
|
}
|
|
1699
1708
|
/** Return whether a request should be routed through sandbox egress proxying. */
|
|
@@ -2028,6 +2037,120 @@ function textMentionsBot(text, botUserId) {
|
|
|
2028
2037
|
return new RegExp(`<@${id}(?:\\|[^>]+)?>`).test(outside);
|
|
2029
2038
|
}
|
|
2030
2039
|
//#endregion
|
|
2040
|
+
//#region src/chat/event-automations/ingest.ts
|
|
2041
|
+
/**
|
|
2042
|
+
* Owns event matching and durable event-automation dispatch.
|
|
2043
|
+
*
|
|
2044
|
+
* Each matching automation is independently idempotent. Aggregate failures propagate
|
|
2045
|
+
* so the provider can retry the original delivery.
|
|
2046
|
+
*/
|
|
2047
|
+
/** Bind provider delivery identity to one automation's durable dispatch. */
|
|
2048
|
+
function eventAutomationDispatchKey(taskId, namespace, eventKey) {
|
|
2049
|
+
return `event-automation:${createHash("sha256").update(`${taskId}\0${namespace}\0${eventKey}`).digest("hex").slice(0, 32)}`;
|
|
2050
|
+
}
|
|
2051
|
+
function oneLine(value) {
|
|
2052
|
+
return value.replace(/[\r\n]+/g, " ").replace(/\s+/g, " ").trim().slice(0, 512);
|
|
2053
|
+
}
|
|
2054
|
+
/** Compact destination-visible context for event-automation replies. */
|
|
2055
|
+
function replyAttribution(task) {
|
|
2056
|
+
const detail = oneLine(task.trigger.label).slice(0, 128).trim();
|
|
2057
|
+
return detail ? {
|
|
2058
|
+
label: "Event automation",
|
|
2059
|
+
detail
|
|
2060
|
+
} : { label: "Event automation" };
|
|
2061
|
+
}
|
|
2062
|
+
/** Render plain agent input for one matching event automation. */
|
|
2063
|
+
function eventInput(task, event, outcomes) {
|
|
2064
|
+
const guidance = eventGuidance(getEventCatalog(), event.namespace, task.trigger.resourceType, event.eventType);
|
|
2065
|
+
return renderTaskInput({
|
|
2066
|
+
about: task.trigger.label,
|
|
2067
|
+
creator: slackMention(task.createdBy.slackUserId),
|
|
2068
|
+
instructions: task.task.text,
|
|
2069
|
+
outcomes,
|
|
2070
|
+
guidance,
|
|
2071
|
+
trustedSummary: event.trustedSummary,
|
|
2072
|
+
trustedSummaryMaxLength: EVENT_SUMMARY_MAX_LENGTH,
|
|
2073
|
+
verifiedDetails: event.data,
|
|
2074
|
+
externalText: event.untrustedText,
|
|
2075
|
+
externalTextMaxLength: EVENT_TEXT_MAX_LENGTH
|
|
2076
|
+
});
|
|
2077
|
+
}
|
|
2078
|
+
/** Match a normalized event and dispatch every matching automation. */
|
|
2079
|
+
async function ingestEventAutomations(input, options) {
|
|
2080
|
+
const event = eventSchema.parse(input);
|
|
2081
|
+
const db = getDb();
|
|
2082
|
+
const nowMs = options.nowMs ?? Date.now();
|
|
2083
|
+
const tasks = await findMatchingEventAutomations(db, event, options.teamId);
|
|
2084
|
+
let dispatched = 0;
|
|
2085
|
+
const errors = [];
|
|
2086
|
+
for (const task of tasks) try {
|
|
2087
|
+
const idempotencyKey = eventAutomationDispatchKey(task.id, event.namespace, event.eventKey);
|
|
2088
|
+
if (await admitEventAutomationRun({
|
|
2089
|
+
automationId: task.id,
|
|
2090
|
+
nowMs,
|
|
2091
|
+
runKey: idempotencyKey
|
|
2092
|
+
}) === "limited") {
|
|
2093
|
+
const reason = eventAutomationRunLimitReason();
|
|
2094
|
+
logWarn("event_automation.run_limit.exceeded", {
|
|
2095
|
+
"app.task.id": task.id,
|
|
2096
|
+
"app.task.type": "event"
|
|
2097
|
+
});
|
|
2098
|
+
if (await blockEventAutomation(db, task.id, reason)) {
|
|
2099
|
+
captureMessage("Event automation blocked by run limit", {
|
|
2100
|
+
level: "warning",
|
|
2101
|
+
fingerprint: ["event_automation.run_limit.blocked"],
|
|
2102
|
+
tags: {
|
|
2103
|
+
"app.event.namespace": event.namespace,
|
|
2104
|
+
"app.task.type": "event"
|
|
2105
|
+
},
|
|
2106
|
+
extra: {
|
|
2107
|
+
"app.event.event_type": event.eventType,
|
|
2108
|
+
"app.event_automation.max_runs_per_hour": botConfig.maxEventAutomationRunsPerHour,
|
|
2109
|
+
"app.event_automation.resource_type": task.trigger.resourceType,
|
|
2110
|
+
"app.task.id": task.id
|
|
2111
|
+
}
|
|
2112
|
+
});
|
|
2113
|
+
await notifyAutomationBlocked({
|
|
2114
|
+
automationId: task.id,
|
|
2115
|
+
kind: "event",
|
|
2116
|
+
reason
|
|
2117
|
+
});
|
|
2118
|
+
}
|
|
2119
|
+
continue;
|
|
2120
|
+
}
|
|
2121
|
+
const replyThreadTs = slackChannelMessageReplyThreadTs(event);
|
|
2122
|
+
const destination = replyThreadTs ? {
|
|
2123
|
+
...task.destination,
|
|
2124
|
+
threadTs: replyThreadTs
|
|
2125
|
+
} : task.destination;
|
|
2126
|
+
const outcomes = effectiveTaskOutcomes(task.outcomes, destination);
|
|
2127
|
+
const credentialSubject = task.credentialMode === "creator" ? {
|
|
2128
|
+
type: "user",
|
|
2129
|
+
userId: task.createdBy.slackUserId,
|
|
2130
|
+
allowedWhen: "event-automation",
|
|
2131
|
+
taskId: task.id
|
|
2132
|
+
} : void 0;
|
|
2133
|
+
if ((await dispatchEventAutomation({
|
|
2134
|
+
conversationWorkQueue: options.queue,
|
|
2135
|
+
nowMs,
|
|
2136
|
+
options: {
|
|
2137
|
+
idempotencyKey,
|
|
2138
|
+
...credentialSubject ? { credentialSubject } : void 0,
|
|
2139
|
+
destination,
|
|
2140
|
+
destinationVisibility: task.destinationVisibility,
|
|
2141
|
+
input: eventInput(task, event, outcomes),
|
|
2142
|
+
metadata: { eventAutomationId: task.id },
|
|
2143
|
+
replyAttribution: replyAttribution(task),
|
|
2144
|
+
outcomes
|
|
2145
|
+
}
|
|
2146
|
+
})).status === "created") dispatched += 1;
|
|
2147
|
+
} catch (error) {
|
|
2148
|
+
errors.push(error);
|
|
2149
|
+
}
|
|
2150
|
+
if (errors.length > 0) throw new AggregateError(errors, "Failed to dispatch one or more event automations");
|
|
2151
|
+
return { dispatched };
|
|
2152
|
+
}
|
|
2153
|
+
//#endregion
|
|
2031
2154
|
//#region src/chat/ingress/workspace-membership.ts
|
|
2032
2155
|
const MEMBER_TTL_MS = 3e5;
|
|
2033
2156
|
const NON_MEMBER_TTL_MS = 3e4;
|
|
@@ -2531,7 +2654,26 @@ async function routeParsedMessage(args) {
|
|
|
2531
2654
|
const isDirectMessage = isDmEvent(args.event);
|
|
2532
2655
|
const isSubscribed = !isDirectMessage && !isMention && await args.state.isSubscribed(canonicalThreadId);
|
|
2533
2656
|
const route = isDirectMessage || isMention ? "mention" : isSubscribed ? "subscribed" : void 0;
|
|
2534
|
-
if (!route)
|
|
2657
|
+
if (!route) {
|
|
2658
|
+
const channelMessage = args.event.type === "message" && args.event.channel && args.event.ts ? slackChannelMessageEvent({
|
|
2659
|
+
botId: args.event.bot_id,
|
|
2660
|
+
channelId: args.event.channel,
|
|
2661
|
+
subtype: args.event.subtype,
|
|
2662
|
+
text: args.event.text,
|
|
2663
|
+
threadTs: args.event.thread_ts,
|
|
2664
|
+
ts: args.event.ts,
|
|
2665
|
+
userId: message.author.userId
|
|
2666
|
+
}) : void 0;
|
|
2667
|
+
const teamId = args.installation.teamId;
|
|
2668
|
+
if (channelMessage && teamId) await ingestEventAutomations({
|
|
2669
|
+
...channelMessage,
|
|
2670
|
+
namespace: SLACK_EVENT_NAMESPACE
|
|
2671
|
+
}, {
|
|
2672
|
+
queue: args.queue,
|
|
2673
|
+
teamId
|
|
2674
|
+
});
|
|
2675
|
+
return;
|
|
2676
|
+
}
|
|
2535
2677
|
const stopDecision = getThreadStopDecision({
|
|
2536
2678
|
botUserName: botConfig.userName,
|
|
2537
2679
|
rawText: args.event.text ?? "",
|
|
@@ -3012,81 +3154,6 @@ async function publicArtifactGET(args) {
|
|
|
3012
3154
|
}
|
|
3013
3155
|
}
|
|
3014
3156
|
//#endregion
|
|
3015
|
-
//#region src/chat/event-automations/ingest.ts
|
|
3016
|
-
/**
|
|
3017
|
-
* Owns event matching and durable event-automation dispatch.
|
|
3018
|
-
*
|
|
3019
|
-
* Each matching automation is independently idempotent. Aggregate failures propagate
|
|
3020
|
-
* so the provider can retry the original delivery.
|
|
3021
|
-
*/
|
|
3022
|
-
/** Bind provider delivery identity to one automation's durable dispatch. */
|
|
3023
|
-
function eventAutomationDispatchKey(taskId, namespace, eventKey) {
|
|
3024
|
-
return `event-automation:${createHash("sha256").update(`${taskId}\0${namespace}\0${eventKey}`).digest("hex").slice(0, 32)}`;
|
|
3025
|
-
}
|
|
3026
|
-
function oneLine(value) {
|
|
3027
|
-
return value.replace(/[\r\n]+/g, " ").replace(/\s+/g, " ").trim().slice(0, 512);
|
|
3028
|
-
}
|
|
3029
|
-
/** Compact destination-visible context for event-automation replies. */
|
|
3030
|
-
function replyAttribution(task) {
|
|
3031
|
-
const detail = oneLine(task.trigger.label).slice(0, 128).trim();
|
|
3032
|
-
return detail ? {
|
|
3033
|
-
label: "Event automation",
|
|
3034
|
-
detail
|
|
3035
|
-
} : { label: "Event automation" };
|
|
3036
|
-
}
|
|
3037
|
-
/** Render plain agent input for one matching event automation. */
|
|
3038
|
-
function eventInput(task, event) {
|
|
3039
|
-
const guidance = eventGuidance(getEventCatalog(), event.namespace, task.trigger.resourceType, event.eventType);
|
|
3040
|
-
return renderTaskInput({
|
|
3041
|
-
about: task.trigger.label,
|
|
3042
|
-
creator: slackMention(task.createdBy.slackUserId),
|
|
3043
|
-
instructions: task.task.text,
|
|
3044
|
-
outcomes: effectiveTaskOutcomes(task.outcomes, task.destination),
|
|
3045
|
-
guidance,
|
|
3046
|
-
trustedSummary: event.trustedSummary,
|
|
3047
|
-
trustedSummaryMaxLength: EVENT_SUMMARY_MAX_LENGTH,
|
|
3048
|
-
verifiedDetails: event.data,
|
|
3049
|
-
externalText: event.untrustedText,
|
|
3050
|
-
externalTextMaxLength: EVENT_TEXT_MAX_LENGTH
|
|
3051
|
-
});
|
|
3052
|
-
}
|
|
3053
|
-
/** Match a normalized event and dispatch every matching automation. */
|
|
3054
|
-
async function ingestEventAutomations(input, options) {
|
|
3055
|
-
const event = eventSchema.parse(input);
|
|
3056
|
-
const db = getDb();
|
|
3057
|
-
const nowMs = options.nowMs ?? Date.now();
|
|
3058
|
-
const tasks = await findMatchingEventAutomations(db, event, options.teamId);
|
|
3059
|
-
let dispatched = 0;
|
|
3060
|
-
const errors = [];
|
|
3061
|
-
for (const task of tasks) try {
|
|
3062
|
-
const idempotencyKey = eventAutomationDispatchKey(task.id, event.namespace, event.eventKey);
|
|
3063
|
-
const credentialSubject = task.credentialMode === "creator" ? {
|
|
3064
|
-
type: "user",
|
|
3065
|
-
userId: task.createdBy.slackUserId,
|
|
3066
|
-
allowedWhen: "event-automation",
|
|
3067
|
-
taskId: task.id
|
|
3068
|
-
} : void 0;
|
|
3069
|
-
if ((await dispatchEventAutomation({
|
|
3070
|
-
conversationWorkQueue: options.queue,
|
|
3071
|
-
nowMs,
|
|
3072
|
-
options: {
|
|
3073
|
-
idempotencyKey,
|
|
3074
|
-
...credentialSubject ? { credentialSubject } : void 0,
|
|
3075
|
-
destination: task.destination,
|
|
3076
|
-
destinationVisibility: task.destinationVisibility,
|
|
3077
|
-
input: eventInput(task, event),
|
|
3078
|
-
metadata: { eventAutomationId: task.id },
|
|
3079
|
-
replyAttribution: replyAttribution(task),
|
|
3080
|
-
outcomes: effectiveTaskOutcomes(task.outcomes, task.destination)
|
|
3081
|
-
}
|
|
3082
|
-
})).status === "created") dispatched += 1;
|
|
3083
|
-
} catch (error) {
|
|
3084
|
-
errors.push(error);
|
|
3085
|
-
}
|
|
3086
|
-
if (errors.length > 0) throw new AggregateError(errors, "Failed to dispatch one or more event automations");
|
|
3087
|
-
return { dispatched };
|
|
3088
|
-
}
|
|
3089
|
-
//#endregion
|
|
3090
3157
|
//#region src/chat/events/workspace.ts
|
|
3091
3158
|
/**
|
|
3092
3159
|
* Resolve the single-bot Slack team id for event-automation indexing.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { r as completeObject } from "./client-
|
|
1
|
+
import { r as completeObject } from "./client-Bn9SRFCi.js";
|
|
2
2
|
import { r as defaultModelId } from "./model-profile-BwU8mqwD.js";
|
|
3
|
-
import {
|
|
4
|
-
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-
|
|
3
|
+
import { L as briefCodeChangeSchema, V as parseBriefInput, d as conversationDetailReportSchema, p as conversationEventPageSchema } from "./conversation-CvBG57Io.js";
|
|
4
|
+
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-C9Q9cjD3.js";
|
|
5
5
|
import { CLI_USAGE } from "./cli/run.js";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import { z } from "zod";
|
|
@@ -269,7 +269,7 @@ async function parseRunOptions(argv) {
|
|
|
269
269
|
* `DATABASE_URL` at import, and `briefs pull` must work with only a token.
|
|
270
270
|
*/
|
|
271
271
|
async function configuredDefaultModelId() {
|
|
272
|
-
const { botConfig } = await import("./config-
|
|
272
|
+
const { botConfig } = await import("./config-_XAINZMN.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-BYNOFO6e.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-BEuPFbbv.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-Caa0Qh_Q.js").then((n) => n.t),
|
|
104
|
+
import("../catalog-runtime-wmq_fqff.js").then((n) => n.t),
|
|
105
|
+
import("../validation-BAzlyNIc.js").then((n) => n.r),
|
|
106
|
+
import("../viewer-wCn8xneI.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,16 +155,16 @@ 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-Caa0Qh_Q.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-C8DRk9X6.js");
|
|
161
|
+
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-17c9_39v.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 { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-
|
|
163
|
+
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-B8hurjFt.js");
|
|
164
|
+
const { bindSpawnAgent } = await import("../spawn-CdAaTXrY.js").then((n) => n.n);
|
|
165
|
+
const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-4QPqTd5_.js").then((n) => n.a);
|
|
166
166
|
const { createLocalConversationWork } = await import("../conversation-work-C6y3T5Hx.js");
|
|
167
|
-
const { processConversationWork } = await import("../worker-
|
|
167
|
+
const { processConversationWork } = await import("../worker-mc62tybz.js").then((n) => n.n);
|
|
168
168
|
let agentRunner;
|
|
169
169
|
const localConversationWork = createLocalConversationWork(async (message) => {
|
|
170
170
|
if (!agentRunner) throw new Error("Local agent runner is not ready");
|
package/dist/cli/check.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { D as JUNIOR_HEARTBEAT_ROUTE, M as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, T as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-
|
|
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-Bs3dV81s.js";
|
|
2
|
+
import { _ as parsePluginManifest, g as parseInlinePluginManifest } from "../registry-BYNOFO6e.js";
|
|
3
|
+
import { i as parseSkillFile } from "../skills-C4yrD2NR.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-BEbNsG87.js")).runAdmin(argv);
|
|
29
29
|
}
|
|
30
30
|
async function runBriefs(argv) {
|
|
31
|
-
return await (await import("../briefs-
|
|
31
|
+
return await (await import("../briefs-DFAh_jTW.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, lt as createPluginLogger } from "../agent-hooks-
|
|
4
|
-
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-
|
|
1
|
+
import { d as getDb } from "../viewer-wCn8xneI.js";
|
|
2
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime-wmq_fqff.js";
|
|
3
|
+
import { d as setPlugins, f as validatePlugins, lt as createPluginLogger } from "../agent-hooks-Caa0Qh_Q.js";
|
|
4
|
+
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-BAzlyNIc.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-wmq_fqff.js";
|
|
2
|
+
import { S as disconnectStateAdapter, t as create } from "../profile-BA471c-l.js";
|
|
3
|
+
import { r as resolve } from "../resolve-rpz8No2i.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-_XAINZMN.js";
|
|
2
|
+
import { t as createJuniorSqlExecutor } from "../executor-CFIqoCNJ.js";
|
|
3
|
+
import { t as createPluginCatalogRuntime } from "../registry-BYNOFO6e.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-Bs3dV81s.js";
|
|
2
|
+
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-BN5SGxsF.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-Bn9SRFCi.js";
|
|
3
|
+
import { p as logWarn } from "./logging-Bs3dV81s.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]))?$/;
|
|
@@ -54,6 +54,13 @@ const MAX_TOOL_CALLS_PER_TURN = 250;
|
|
|
54
54
|
* headroom to avoid pausing on legitimate longer-running automation.
|
|
55
55
|
*/
|
|
56
56
|
const MAX_CONSECUTIVE_AUTOMATED_TURNS = 25;
|
|
57
|
+
/**
|
|
58
|
+
* Max runs one Event automation can start in a rolling hour. Each run is a
|
|
59
|
+
* full agent turn, and Event automations skip the consecutive automated-turn
|
|
60
|
+
* limit. Kept low so a broad trigger, such as every message in a channel,
|
|
61
|
+
* blocks quickly instead of starting a turn for each Event.
|
|
62
|
+
*/
|
|
63
|
+
const MAX_EVENT_AUTOMATION_RUNS_PER_HOUR = 10;
|
|
57
64
|
const DEFAULT_FUNCTION_MAX_DURATION_SECONDS = 300;
|
|
58
65
|
const DEFAULT_SLACK_SLASH_COMMAND = "/jr";
|
|
59
66
|
const DEFAULT_PROCESSING_REACTION_EMOJI = "eyes";
|
|
@@ -257,6 +264,7 @@ function readBotConfig(env, functionMaxDurationSeconds) {
|
|
|
257
264
|
maxSlicesPerTurn: MAX_SLICES_PER_TURN,
|
|
258
265
|
maxToolCallsPerTurn: MAX_TOOL_CALLS_PER_TURN,
|
|
259
266
|
maxConsecutiveAutomatedTurns: MAX_CONSECUTIVE_AUTOMATED_TURNS,
|
|
267
|
+
maxEventAutomationRunsPerHour: MAX_EVENT_AUTOMATION_RUNS_PER_HOUR,
|
|
260
268
|
turnTimeoutMs: parseAgentTurnTimeoutMs(env.AGENT_TURN_TIMEOUT_MS, maxTurnTimeoutMs),
|
|
261
269
|
webSearchModelId: validateGatewayModelId(env.AI_WEB_SEARCH_MODEL) ?? DEFAULT_WEB_SEARCH_MODEL_ID
|
|
262
270
|
};
|
|
@@ -370,6 +378,7 @@ function setRuntimeLimits(limits) {
|
|
|
370
378
|
bot.maxAgentDepth = limits.maxAgentDepth;
|
|
371
379
|
}
|
|
372
380
|
if (limits?.maxConsecutiveAutomatedTurns !== void 0) bot.maxConsecutiveAutomatedTurns = requirePositiveLimit("maxConsecutiveAutomatedTurns", limits.maxConsecutiveAutomatedTurns);
|
|
381
|
+
if (limits?.maxEventAutomationRunsPerHour !== void 0) bot.maxEventAutomationRunsPerHour = requirePositiveLimit("maxEventAutomationRunsPerHour", limits.maxEventAutomationRunsPerHour);
|
|
373
382
|
if (limits?.maxSlicesPerTurn !== void 0) bot.maxSlicesPerTurn = requirePositiveLimit("maxSlicesPerTurn", limits.maxSlicesPerTurn);
|
|
374
383
|
if (limits?.maxToolCallsPerTurn !== void 0) bot.maxToolCallsPerTurn = requirePositiveLimit("maxToolCallsPerTurn", limits.maxToolCallsPerTurn);
|
|
375
384
|
if (limits?.turnTimeoutMs !== void 0) bot.turnTimeoutMs = Math.min(requirePositiveLimit("turnTimeoutMs", limits.turnTimeoutMs), resolveMaxTurnTimeoutMs(chatConfig.functionMaxDurationSeconds));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as conversationTurnFailureReasonSchema, i as conversationTurnFailureCodeSchema, m as usageSchema } from "./history-
|
|
1
|
+
import { a as conversationTurnFailureReasonSchema, i as conversationTurnFailureCodeSchema, m as usageSchema } from "./history-Nte1oVed.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { codeChangeStateSchema, conversationAnnotationInputSchema, conversationEventPresentationSchema, conversationSidebarAnnotationSchema, objectFactFields, objectTypeSchema } from "@sentry/junior-plugin-api";
|
|
4
4
|
//#region src/chat/automations/card.ts
|
|
@@ -623,6 +623,9 @@ const conversationReportSubagentEventDataSchema = z.object({
|
|
|
623
623
|
startedAt: z.string().datetime(),
|
|
624
624
|
childConversationId: z.string().min(1),
|
|
625
625
|
subagentKind: z.string().min(1),
|
|
626
|
+
agentName: z.string().min(1).optional(),
|
|
627
|
+
task: z.string().min(1).optional(),
|
|
628
|
+
title: z.string().min(1).optional(),
|
|
626
629
|
parentToolCallId: z.string().min(1).optional(),
|
|
627
630
|
status: z.enum([
|
|
628
631
|
"running",
|
|
@@ -763,7 +766,17 @@ const forkConversationBodySchema = z.object({
|
|
|
763
766
|
idempotencyKey: z.string().trim().min(1).max(200)
|
|
764
767
|
}).strict();
|
|
765
768
|
const forkConversationResponseSchema = z.object({ conversationId: z.string() }).strict();
|
|
769
|
+
/** One Conversation in the agent tree of a child Conversation. */
|
|
770
|
+
const conversationAgentTreeNodeSchema = z.object({
|
|
771
|
+
conversationId: z.string().min(1),
|
|
772
|
+
label: z.string().min(1)
|
|
773
|
+
}).strict();
|
|
766
774
|
const conversationDetailReportSchema = conversationSummaryReportSchema.extend({
|
|
775
|
+
/**
|
|
776
|
+
* The parent chain of a child Conversation, root first, with this
|
|
777
|
+
* Conversation last. Root Conversations omit it.
|
|
778
|
+
*/
|
|
779
|
+
agentTree: z.array(conversationAgentTreeNodeSchema).min(2).optional(),
|
|
767
780
|
/** The viewer can fork this conversation from an assistant reply. */
|
|
768
781
|
canFork: z.boolean().optional(),
|
|
769
782
|
forkedFromConversationId: z.string().optional(),
|
|
@@ -855,4 +868,4 @@ const conversationStatsReportSchema = z.object({
|
|
|
855
868
|
windowStart: z.string()
|
|
856
869
|
}).strict();
|
|
857
870
|
//#endregion
|
|
858
|
-
export {
|
|
871
|
+
export { forkConversationBodySchema as A, conversationBriefSchema as B, conversationReportEventSchema as C, conversationUsageSchema as D, conversationSummaryReportSchema as E, INPUT_IMAGE_TYPES as F, readMessageCardRefs as G, annotationCard as H, isVisionImageMediaType as I, removedCardSchema as K, briefCodeChangeSchema as L, MAX_INPUT_IMAGES as M, MAX_INPUT_IMAGE_BYTES as N, createConversationBodySchema as O, readMessageAttachments as P, briefLinkSchema as R, conversationReportEventDataSchema as S, conversationStatsReportSchema as T, messageCardRef as U, parseBriefInput as V, messageCardText as W, conversationParamsSchema as _, cancelConversationPendingMessagesBodySchema as a, conversationPendingMessageSchema as b, conversationAttachmentParamsSchema as c, conversationDetailReportSchema as d, conversationEventHistorySchema as f, conversationFeedSchema as g, conversationFeedQuerySchema as h, archiveConversationResponseSchema as i, forkConversationResponseSchema as j, createConversationMessageBodySchema as k, conversationAuxiliaryCostsSchema as l, conversationEventsQuerySchema as m, actorIdentitySchema as n, cancelConversationPendingMessagesResponseSchema as o, conversationEventPageSchema as p, resolveMessageCards as q, archiveConversationBodySchema as r, conversationActivityPreviewSchema as s, acceptedConversationMessageSchema as t, conversationDetailQuerySchema as u, conversationPendingAuthorizationSchema as v, conversationStatsItemSchema as w, conversationPendingMessagesReportSchema as x, conversationPendingMessageDeliverySchema as y, briefOutcomeStatusSchema as z };
|