@sentry/junior 0.304.0 → 0.305.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{adapter-context-B1IpoELr.js → adapter-context-BpvbUki8.js} +2 -2
- package/dist/{admin-BnVFGo_z.js → admin-CoDt35ny.js} +2 -2
- package/dist/{agent-runner-CoEeZSRh.js → agent-runner-C5d6rY5g.js} +75 -38
- package/dist/api.js +28 -28
- package/dist/app.js +38 -47
- package/dist/{background-compaction-queue-WLPNSF_b.js → background-compaction-queue-BTqMIfTA.js} +7 -3
- package/dist/{briefs-CagVVefw.js → briefs-BRdznF7c.js} +2 -2
- package/dist/{catalog-runtime-B8ZXvXWm.js → catalog-runtime-J52Tej47.js} +1 -1
- package/dist/cli/chat.js +15 -15
- package/dist/cli/check.js +3 -3
- package/dist/cli/main.js +3 -3
- package/dist/cli/plugins.js +4 -4
- package/dist/cli/snapshot-create.js +5 -5
- package/dist/cli/upgrade.js +3 -3
- package/dist/{config-DdO1BNcw.js → config-CBZp0udd.js} +2 -2
- package/dist/{connections-D20kp0j5.js → connections-BYmuJ6Vm.js} +6 -6
- package/dist/{continue-in-slack-BKEVMBj1.js → continue-in-slack-Cvot6S38.js} +5 -5
- package/dist/{conversation-privacy-L1SK_v0V.js → conversation-privacy-D2pOzBNl.js} +1 -1
- package/dist/{conversation-turn-BptVJylj.js → conversation-turn-CI8WDpnK.js} +15 -15
- package/dist/{credential-sync-D1J1CGzL.js → credential-sync-COqnZ1Dx.js} +13 -13
- package/dist/{db-EKJnkrIb.js → db-DU84dCVu.js} +3 -3
- package/dist/{executor-CoIZmFK8.js → executor-CFyrgOu1.js} +2 -2
- package/dist/{install-BT2Pf6HP.js → install-CQ76CfRw.js} +2 -2
- package/dist/instrumentation.js +2 -2
- package/dist/{lineage-C5DGQCS_.js → lineage-DLd2UxVP.js} +2 -2
- package/dist/{logging-QSZuMcvo.js → logging-BPNTQVFu.js} +1 -1
- package/dist/{message-TtxftRHj.js → message-BWJLeQ5e.js} +8 -8
- package/dist/{model-input-BHXfA29g.js → model-input-DoM9Ht-d.js} +2 -2
- package/dist/nitro.js +4 -4
- package/dist/{oauth-callback-server-B0enqHtZ.js → oauth-callback-server-DeHbnAQl.js} +2 -2
- package/dist/{projection-CNKK7doO.js → projection-CcFBVFUo.js} +15 -12
- package/dist/{prompt-DSjhoKu5.js → prompt-C5LREK2p.js} +3 -3
- package/dist/{queue-CDxkit82.js → queue-B2AAL3ym.js} +4 -4
- package/dist/{registry-DBDNUUmz.js → registry-BjZZqKqi.js} +1 -1
- package/dist/{resolve-CQLhMWSu.js → resolve-CeJgXuH1.js} +3 -3
- package/dist/{result-B-pauj42.js → result-icDrueyB.js} +8 -8
- package/dist/{runner-B3KxKks5.js → runner-nVfMkMMB.js} +8 -8
- package/dist/{sandbox-egress-signals-DJJX9ClG.js → sandbox-egress-signals-H9vQ5qRf.js} +1 -1
- package/dist/{service-account-2HmlNPvy.js → service-account-DU5865XA.js} +5 -5
- package/dist/{service-account-DQLqkSVv.js → service-account-Dw06p3zm.js} +3 -3
- package/dist/{session-stop-DEeZKqbX.js → session-stop-uotLtp4g.js} +79 -22
- package/dist/{skills-2UrD7JkN.js → skills-Bex1EaO5.js} +2 -2
- package/dist/{slack-conversation-unfurl-Dd129Uov.js → slack-conversation-unfurl-EPG3riWF.js} +9 -9
- package/dist/{spawn-eMho9HDJ.js → spawn-CoD3vDuS.js} +6 -6
- package/dist/{state-Bveuc4Zh.js → state-nCR4Muhn.js} +4 -4
- package/dist/{stop-D_ltJLDS.js → stop-BFVd0P0m.js} +29 -30
- package/dist/{store-COeYnPL_.js → store-Ca6G962n.js} +5 -5
- package/dist/{task-queue-CBIDXZpV.js → task-queue-BLPZU6kC.js} +3 -3
- package/dist/{task-runner-CJF7zIJL.js → task-runner-xsOPIxCZ.js} +6 -6
- package/dist/{thread-context-Cg0jt0aE.js → thread-context-BOvZhsKK.js} +7 -7
- package/dist/{turn-session-routing-CaY3Tp8m.js → turn-session-routing-2bW2qfeb.js} +7 -7
- package/dist/{turn-user-message-tcom1RYd.js → turn-user-message-BrhuyYrH.js} +3 -3
- package/dist/{validation-EU91JwIT.js → validation-BnY9K5WB.js} +1 -1
- package/dist/{version-BYRPhY5G.js → version-qROlRQGF.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-Cf8ISkAc.js → viewer-CxUiOraX.js} +3 -3
- package/dist/{warmup-TgY4S1vx.js → warmup--Gkz7iB-.js} +21 -24
- package/dist/{worker-C6Uq4OKD.js → worker-DJ8d9fmD.js} +7 -7
- package/package.json +6 -6
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { B as messageCardText } from "./conversation-BOqdRtUx.js";
|
|
2
|
-
import { c as buildDeliveredTurnStatePatch, l as loadPendingMessageCards, o as completeAuthPauseTurn, r as finalizeFailedTurnReplyWithEvent, t as buildTurnThreadContext } from "./thread-context-
|
|
3
|
-
import { A as latestConversationMessageSeq, I as upsertConversationMessage, M as normalizeConversationText, N as recordDeliveredAssistantMessage, W as authorizationId, a as loadProjection, b as persistConversationMessages, bn as persistWithRetry, d as recordAuthorizationCompleted, j as markConversationMessage, nt as saveTurnCheckpoint, t as commitAcceptedReply, un as getAssistantReplyText, v as hydrateConversationMessages } from "./projection-
|
|
4
|
-
import { S as setTags, T as withLogContext, p as logException } from "./logging-
|
|
5
|
-
import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-
|
|
6
|
-
import { a as getPersistedThreadState, c as coerceThreadConversationState, i as getPersistedSandboxState, s as persistThreadStateById } from "./turn-session-routing-
|
|
7
|
-
import { _ as ConversationTurnLifecycleService, g as startActiveTurn, h as markTurnFailed } from "./turn-user-message-
|
|
8
|
-
import { f as credentialContextForActor } from "./registry-
|
|
9
|
-
import { P as SYSTEM_IDENTITY_ID, a as getConversationStore, r as getConversationEventStore } from "./db-
|
|
2
|
+
import { c as buildDeliveredTurnStatePatch, l as loadPendingMessageCards, o as completeAuthPauseTurn, r as finalizeFailedTurnReplyWithEvent, t as buildTurnThreadContext } from "./thread-context-BOvZhsKK.js";
|
|
3
|
+
import { A as latestConversationMessageSeq, I as upsertConversationMessage, M as normalizeConversationText, N as recordDeliveredAssistantMessage, W as authorizationId, a as loadProjection, b as persistConversationMessages, bn as persistWithRetry, d as recordAuthorizationCompleted, j as markConversationMessage, nt as saveTurnCheckpoint, t as commitAcceptedReply, un as getAssistantReplyText, v as hydrateConversationMessages } from "./projection-CcFBVFUo.js";
|
|
4
|
+
import { S as setTags, T as withLogContext, p as logException } from "./logging-BPNTQVFu.js";
|
|
5
|
+
import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-xsOPIxCZ.js";
|
|
6
|
+
import { a as getPersistedThreadState, c as coerceThreadConversationState, i as getPersistedSandboxState, s as persistThreadStateById } from "./turn-session-routing-2bW2qfeb.js";
|
|
7
|
+
import { _ as ConversationTurnLifecycleService, g as startActiveTurn, h as markTurnFailed } from "./turn-user-message-BrhuyYrH.js";
|
|
8
|
+
import { f as credentialContextForActor } from "./registry-BjZZqKqi.js";
|
|
9
|
+
import { P as SYSTEM_IDENTITY_ID, a as getConversationStore, r as getConversationEventStore } from "./db-DU84dCVu.js";
|
|
10
10
|
import { randomUUID } from "node:crypto";
|
|
11
11
|
import { createLocalSource, localDestinationSchema } from "@sentry/junior-plugin-api";
|
|
12
12
|
// src/chat/local/runner.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { qa as sandboxEgressSignalsResponseSchema } from "./projection-
|
|
1
|
+
import { qa as sandboxEgressSignalsResponseSchema } from "./projection-CcFBVFUo.js";
|
|
2
2
|
// 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;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { K as isRecord, b as setSpanAttributes, h as logWarn } from "./logging-
|
|
2
|
-
import { c as fetchWithBoundedOAuthErrorBodies, i as resolvePluginHeaderEnvRefs } from "./registry-
|
|
3
|
-
import { $ as MUTATION_LOCK_TTL_MS, X as getStateAdapter, _t as parseDestination, nt as withLock, tt as fenceLock } from "./db-
|
|
4
|
-
import { n as readEncryptedState, r as findLegacyWebActorUserId, t as createEncryptedState } from "./state-
|
|
5
|
-
import { n as botConfig } from "./config-
|
|
1
|
+
import { K as isRecord, b as setSpanAttributes, h as logWarn } from "./logging-BPNTQVFu.js";
|
|
2
|
+
import { c as fetchWithBoundedOAuthErrorBodies, i as resolvePluginHeaderEnvRefs } from "./registry-BjZZqKqi.js";
|
|
3
|
+
import { $ as MUTATION_LOCK_TTL_MS, X as getStateAdapter, _t as parseDestination, nt as withLock, tt as fenceLock } from "./db-DU84dCVu.js";
|
|
4
|
+
import { n as readEncryptedState, r as findLegacyWebActorUserId, t as createEncryptedState } from "./state-nCR4Muhn.js";
|
|
5
|
+
import { n as botConfig } from "./config-CBZp0udd.js";
|
|
6
6
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
7
7
|
import { randomUUID } from "node:crypto";
|
|
8
8
|
import { sourceSchema } from "@sentry/junior-plugin-api";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-
|
|
2
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
3
|
-
import { J as disconnectStateAdapter } from "./db-
|
|
1
|
+
import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-DU5865XA.js";
|
|
2
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-J52Tej47.js";
|
|
3
|
+
import { J as disconnectStateAdapter } from "./db-DU84dCVu.js";
|
|
4
4
|
import { CLI_USAGE } from "./cli/run.js";
|
|
5
5
|
import { createServer } from "node:http";
|
|
6
6
|
// src/cli/service-account.ts
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
|
-
import { Bn as TURN_CONTEXT_TAG, Da as postSlackMessage, Di as verifyTimerWatchCredentialSubject, Fn as stripRuntimeTurnContext, Gn as renderTag$1, Hn as escapeTagText, Io as buildSentryConversationUrl, Ki as listWorkspaces, Kn as renderUntrustedTag, Ln as CAPABILITY_SECTION_TAG, M as normalizeConversationText, Mr as getReviewItem, Oi as JUNIOR_THREAD_STATE_TTL_MS, Pn as retainRuntimeTurnContext, Rn as REQUEST_CONTEXT_SECTION_TAG, Tn as hasRuntimeTurnContext, Vn as escapeClosingTags, Wn as renderChildTag, _a as slackMention, ar as getPluginSystemPromptContributions, cr as getPlugins, ct as listTurnSummaries, di as cancelSubscriptions, do as sandboxSkillFile, eo as ToolInputError, fn as NO_REPLY_TOOL_NAME, fo as sandboxSkillPathResolution, ha as normalizeSlackReplyMarkdown, in as REPLY_TOOL_NAME, ir as getPluginSlackConversationLink, ji as getDashboardObjectIconLink, ki as getDashboardConversationLink, lo as SANDBOX_WORKSPACE_ROOT, ma as formatSlackLink, oo as SANDBOX_DATA_ROOT, ot as getStoredTurnFields, pa as escapeSlackMrkdwnText, qn as tagJson, so as SANDBOX_REPOS_ROOT, sr as getPluginUserPromptContributions, st as getTurnRecord, uo as sandboxSkillDir, vn as REPORT_BLOCKED_TOOL_NAME, x as toStoredConversationMessage, zn as SESSION_CONTEXT_SECTION_TAG } from "./projection-
|
|
3
|
-
import { P as SYSTEM_IDENTITY_ID, T as isPersonInput, X as getStateAdapter, a as getConversationStore, mt as nextDetailVersion, o as getDb, r as getConversationEventStore, s as getSqlExecutor } from "./db-
|
|
4
|
-
import { H as escapeXmlText, V as escapeXml, n as botConfig, z as renderCurrentInstruction } from "./config-
|
|
2
|
+
import { Bn as TURN_CONTEXT_TAG, Da as postSlackMessage, Di as verifyTimerWatchCredentialSubject, Fn as stripRuntimeTurnContext, Gn as renderTag$1, Hn as escapeTagText, Io as buildSentryConversationUrl, Ki as listWorkspaces, Kn as renderUntrustedTag, Ln as CAPABILITY_SECTION_TAG, M as normalizeConversationText, Mr as getReviewItem, Na as slackExternalRefIdSchema, Oi as JUNIOR_THREAD_STATE_TTL_MS, Pn as retainRuntimeTurnContext, Rn as REQUEST_CONTEXT_SECTION_TAG, Tn as hasRuntimeTurnContext, Vn as escapeClosingTags, Wn as renderChildTag, _a as slackMention, ar as getPluginSystemPromptContributions, cr as getPlugins, ct as listTurnSummaries, di as cancelSubscriptions, do as sandboxSkillFile, eo as ToolInputError, fn as NO_REPLY_TOOL_NAME, fo as sandboxSkillPathResolution, ha as normalizeSlackReplyMarkdown, in as REPLY_TOOL_NAME, ir as getPluginSlackConversationLink, ji as getDashboardObjectIconLink, ki as getDashboardConversationLink, lo as SANDBOX_WORKSPACE_ROOT, ma as formatSlackLink, oo as SANDBOX_DATA_ROOT, ot as getStoredTurnFields, pa as escapeSlackMrkdwnText, qn as tagJson, so as SANDBOX_REPOS_ROOT, sr as getPluginUserPromptContributions, st as getTurnRecord, uo as sandboxSkillDir, vn as REPORT_BLOCKED_TOOL_NAME, x as toStoredConversationMessage, zn as SESSION_CONTEXT_SECTION_TAG } from "./projection-CcFBVFUo.js";
|
|
3
|
+
import { P as SYSTEM_IDENTITY_ID, T as isPersonInput, X as getStateAdapter, a as getConversationStore, mt as nextDetailVersion, o as getDb, r as getConversationEventStore, s as getSqlExecutor } from "./db-DU84dCVu.js";
|
|
4
|
+
import { H as escapeXmlText, V as escapeXml, n as botConfig, z as renderCurrentInstruction } from "./config-CBZp0udd.js";
|
|
5
5
|
import { a as listReferenceFiles, c as soulPathCandidates, l as worldPathCandidates } from "./package-discovery-x4AvVhMj.js";
|
|
6
|
-
import { G as normalizeIdentityEmail, h as logWarn, m as logInfo, p as logException, v as serializeGenAiAttribute } from "./logging-
|
|
7
|
-
import { a as EVENT_SYSTEM_ACTOR, b as conversationNoteEvent, g as JUNIOR_NATIVE_EVENT_NAMESPACE, i as EVENT_MESSAGE_AUTHOR, o as isEventConversationMessage, r as EVENT_AUTHOR_ID } from "./prompt-
|
|
6
|
+
import { G as normalizeIdentityEmail, h as logWarn, m as logInfo, p as logException, v as serializeGenAiAttribute } from "./logging-BPNTQVFu.js";
|
|
7
|
+
import { a as EVENT_SYSTEM_ACTOR, b as conversationNoteEvent, g as JUNIOR_NATIVE_EVENT_NAMESPACE, i as EVENT_MESSAGE_AUTHOR, o as isEventConversationMessage, r as EVENT_AUTHOR_ID } from "./prompt-C5LREK2p.js";
|
|
8
8
|
import { c as formatUserInputAnswer, h as isVisionImageMediaType, v as userCustomizationTextSchema } from "./web-message-id-lNodcCOI.js";
|
|
9
|
-
import { F as juniorUsers, N as juniorConversations, P as juniorIdentities } from "./executor-
|
|
10
|
-
import { i as parseSkillFile } from "./skills-
|
|
11
|
-
import { a as toCanonicalInputMessage } from "./conversation-privacy-
|
|
9
|
+
import { F as juniorUsers, N as juniorConversations, P as juniorIdentities } from "./executor-CFyrgOu1.js";
|
|
10
|
+
import { i as parseSkillFile } from "./skills-Bex1EaO5.js";
|
|
11
|
+
import { a as toCanonicalInputMessage } from "./conversation-privacy-D2pOzBNl.js";
|
|
12
12
|
import { o as isUserActor, t as createActor } from "./actor-D2iXzvlN.js";
|
|
13
|
-
import { r as appendAndEnqueueInboundMessage } from "./store-
|
|
14
|
-
import { bt as eventGuidance, gt as CORE_EVENT_NAMESPACE, yt as eventCatalogEntry } from "./turn-session-routing-
|
|
15
|
-
import { h as credentialSubjectSchema } from "./registry-
|
|
13
|
+
import { r as appendAndEnqueueInboundMessage } from "./store-Ca6G962n.js";
|
|
14
|
+
import { bt as eventGuidance, gt as CORE_EVENT_NAMESPACE, yt as eventCatalogEntry } from "./turn-session-routing-2bW2qfeb.js";
|
|
15
|
+
import { h as credentialSubjectSchema } from "./registry-BjZZqKqi.js";
|
|
16
16
|
import * as z from "zod";
|
|
17
17
|
import { getCurrentSystemMessage, getSystemMessageText } from "@earendil-works/pi-ai/compat";
|
|
18
18
|
import path from "node:path";
|
|
@@ -555,6 +555,12 @@ const AUTOMATION_RUN_RULES = [
|
|
|
555
555
|
`- Use \`${NO_REPLY_TOOL_NAME}\` when the run worked and nothing should be posted, such as when a condition in the instruction is not met, or when a temporary failure stopped the work.`
|
|
556
556
|
];
|
|
557
557
|
/**
|
|
558
|
+
* How Slack text writes people and channels. The Slack identity block has it.
|
|
559
|
+
* A child agent's Turn is always `local`, so its job rules repeat it: its
|
|
560
|
+
* input and tool results can still hold Slack text.
|
|
561
|
+
*/
|
|
562
|
+
const SLACK_MENTION_FORMAT_RULE = "Slack text shows people as `<@U…>` and channels as `<#C…>`.";
|
|
563
|
+
/**
|
|
558
564
|
* Block 2, `<child-agent-run>`: the job rules for a run that a parent agent
|
|
559
565
|
* started. No person reads the run, and only its `reply` reaches the parent.
|
|
560
566
|
*/
|
|
@@ -562,7 +568,8 @@ const CHILD_AGENT_RUN_RULES = [
|
|
|
562
568
|
"- A parent agent started you. Your input is a task or message from the parent, a result or message from one of your own child agents, or an event from one of your own watches. That input is the job. No person reads this run.",
|
|
563
569
|
"- Do the work now. Do not ask questions, ask for approval, or offer options.",
|
|
564
570
|
`- Assistant text is never delivered. End each Turn with one of \`${REPLY_TOOL_NAME}\`, \`${NO_REPLY_TOOL_NAME}\`, or \`${REPORT_BLOCKED_TOOL_NAME}\`. \`${REPLY_TOOL_NAME}\` sends your finished work to the parent. Use \`${NO_REPLY_TOOL_NAME}\` when the parent needs nothing from this Turn, such as a watch event that changed nothing. When the task cannot be finished, use \`${REPORT_BLOCKED_TOOL_NAME}\`.`,
|
|
565
|
-
"- Your reply is to the parent agent, not to a person. Call each person by the Slack mention that your input gives for them, not by a provider handle or a name, so the parent knows who they are."
|
|
571
|
+
"- Your reply is to the parent agent, not to a person. Call each person by the Slack mention that your input gives for them, not by a provider handle or a name, so the parent knows who they are.",
|
|
572
|
+
`- ${SLACK_MENTION_FORMAT_RULE}`
|
|
566
573
|
];
|
|
567
574
|
/**
|
|
568
575
|
* Block 2, `<evidence>`: what Junior may claim and how it checks. It covers
|
|
@@ -942,7 +949,7 @@ function buildIdentitySection(platform) {
|
|
|
942
949
|
return [
|
|
943
950
|
"# Identity",
|
|
944
951
|
`Your Slack username is \`${botConfig.userName}\`. Your Slack user ID is \`slack.bot_user_id\` in the runtime context.`,
|
|
945
|
-
|
|
952
|
+
`${SLACK_MENTION_FORMAT_RULE} A mention of your own user ID means you.`
|
|
946
953
|
].join("\n");
|
|
947
954
|
}
|
|
948
955
|
/**
|
|
@@ -1565,7 +1572,7 @@ function isAutomatedTurnSource(source) {
|
|
|
1565
1572
|
}
|
|
1566
1573
|
/** Plain notice when automatic updates stop until the user replies. */
|
|
1567
1574
|
function buildAutomatedTurnLimitResponse(args) {
|
|
1568
|
-
return `I stopped automatic updates after ${args.maxTurns}
|
|
1575
|
+
return `I stopped automatic updates after ${args.maxTurns} automated turns without a new message from you. Turns with no reply also count. Send a message or @mention me in this thread to continue.`;
|
|
1569
1576
|
}
|
|
1570
1577
|
/**
|
|
1571
1578
|
* Allow one automated wake, or refuse once the consecutive-turn limit is full.
|
|
@@ -1675,6 +1682,54 @@ async function recordFinishedTurnForAutomatedLimit(args) {
|
|
|
1675
1682
|
state: args.state
|
|
1676
1683
|
});
|
|
1677
1684
|
}
|
|
1685
|
+
// src/chat/slack/annotation-ref.ts
|
|
1686
|
+
const KEY_DIGEST_LENGTH = 22;
|
|
1687
|
+
const legacyRefSchema = z.tuple([
|
|
1688
|
+
z.string().min(1),
|
|
1689
|
+
z.string().min(1),
|
|
1690
|
+
z.string().min(1)
|
|
1691
|
+
]);
|
|
1692
|
+
function decodeLegacyAnnotationRef(id) {
|
|
1693
|
+
try {
|
|
1694
|
+
return legacyRefSchema.safeParse(JSON.parse(Buffer.from(id, "base64url").toString("utf8"))).data;
|
|
1695
|
+
} catch {
|
|
1696
|
+
return;
|
|
1697
|
+
}
|
|
1698
|
+
}
|
|
1699
|
+
/** Return the fixed-size digest that identifies one annotation in a reference. */
|
|
1700
|
+
function annotationKeyDigest(plugin, key) {
|
|
1701
|
+
return createHash("sha256").update(JSON.stringify([plugin, key])).digest("base64url").slice(0, KEY_DIGEST_LENGTH);
|
|
1702
|
+
}
|
|
1703
|
+
/**
|
|
1704
|
+
* Build the Slack `external_ref.id` for an annotation, or null when the
|
|
1705
|
+
* Conversation ID is too long for Slack's limit.
|
|
1706
|
+
*/
|
|
1707
|
+
function encodeAnnotationRef(conversationId, plugin, key) {
|
|
1708
|
+
const id = annotationKeyDigest(plugin, key) + Buffer.from(conversationId, "utf8").toString("base64url");
|
|
1709
|
+
return slackExternalRefIdSchema.safeParse(id).success ? id : null;
|
|
1710
|
+
}
|
|
1711
|
+
/**
|
|
1712
|
+
* Split a current or legacy annotation `external_ref.id` into its
|
|
1713
|
+
* Conversation ID and key digest.
|
|
1714
|
+
*/
|
|
1715
|
+
function decodeAnnotationRef(id) {
|
|
1716
|
+
const legacy = decodeLegacyAnnotationRef(id);
|
|
1717
|
+
if (legacy) {
|
|
1718
|
+
const [conversationId, plugin, key] = legacy;
|
|
1719
|
+
return {
|
|
1720
|
+
conversationId,
|
|
1721
|
+
keyDigest: annotationKeyDigest(plugin, key)
|
|
1722
|
+
};
|
|
1723
|
+
}
|
|
1724
|
+
const keyDigest = id.slice(0, KEY_DIGEST_LENGTH);
|
|
1725
|
+
const encoded = id.slice(KEY_DIGEST_LENGTH);
|
|
1726
|
+
const conversationId = Buffer.from(encoded, "base64url").toString("utf8");
|
|
1727
|
+
if (!conversationId || Buffer.from(conversationId, "utf8").toString("base64url") !== encoded) return null;
|
|
1728
|
+
return {
|
|
1729
|
+
conversationId,
|
|
1730
|
+
keyDigest
|
|
1731
|
+
};
|
|
1732
|
+
}
|
|
1678
1733
|
// src/chat/slack/automation-card.ts
|
|
1679
1734
|
function preview(text, length) {
|
|
1680
1735
|
const compact = text.replace(/\s+/g, " ").trim();
|
|
@@ -1766,7 +1821,8 @@ function renderSlackObjectCard(card, conversationId, surface = "preview") {
|
|
|
1766
1821
|
warning ? escapeSlackMrkdwnText(`Needs attention: ${warning}`) : null,
|
|
1767
1822
|
...facts.map((field) => escapeSlackMrkdwnText(`${field.label}: ${field.value}`))
|
|
1768
1823
|
].filter(Boolean).join("\n");
|
|
1769
|
-
|
|
1824
|
+
const refId = encodeAnnotationRef(conversationId, card.plugin, card.key);
|
|
1825
|
+
if (!card.url || !refId) return {
|
|
1770
1826
|
entity: null,
|
|
1771
1827
|
text
|
|
1772
1828
|
};
|
|
@@ -1826,11 +1882,7 @@ function renderSlackObjectCard(card, conversationId, surface = "preview") {
|
|
|
1826
1882
|
}
|
|
1827
1883
|
},
|
|
1828
1884
|
external_ref: {
|
|
1829
|
-
id:
|
|
1830
|
-
conversationId,
|
|
1831
|
-
card.plugin,
|
|
1832
|
-
card.key
|
|
1833
|
-
]), "utf8").toString("base64url"),
|
|
1885
|
+
id: refId,
|
|
1834
1886
|
type: "annotation"
|
|
1835
1887
|
},
|
|
1836
1888
|
url: card.url
|
|
@@ -3183,6 +3235,11 @@ async function loadPromptTurnContext(args) {
|
|
|
3183
3235
|
workspaces
|
|
3184
3236
|
};
|
|
3185
3237
|
}
|
|
3238
|
+
/** Choose the platform whose system prompt a Turn gets. */
|
|
3239
|
+
function promptPlatform(run, promptMode) {
|
|
3240
|
+
if (promptMode === "child_agent") return "local";
|
|
3241
|
+
return (run.delivery || promptMode === "automation") && run.location?.provider === "slack" ? "slack" : "local";
|
|
3242
|
+
}
|
|
3186
3243
|
/** Assemble prompt history, instructions, and telemetry input for one slice. */
|
|
3187
3244
|
async function assemblePrompt(args) {
|
|
3188
3245
|
const source = args.run.source;
|
|
@@ -3191,7 +3248,7 @@ async function assemblePrompt(args) {
|
|
|
3191
3248
|
const trimmedPrompt = shouldPromptAgent ? withoutTrailingUncheckpointedUserPrompt(args.priorPiMessages, requestContentParts) : { messages: args.existingSessionPiMessages };
|
|
3192
3249
|
const promptHistoryMessages = trimmedPrompt.messages;
|
|
3193
3250
|
const needsBootstrapContextForPrompt = shouldPromptAgent && !replayedPrompt && !hasRuntimeTurnContext(promptHistoryMessages);
|
|
3194
|
-
const platform = (args.run
|
|
3251
|
+
const platform = promptPlatform(args.run, args.promptMode);
|
|
3195
3252
|
const baseInstructions = await buildDeploymentSystemPrompt(platform, args.promptMode);
|
|
3196
3253
|
const { conversationNotes, pluginUserPromptContributions, userCustomization, workspaces } = args.turnContext;
|
|
3197
3254
|
const disabledTools = loadsTurnContext ? args.disabledTools : [];
|
|
@@ -3481,4 +3538,4 @@ async function saveStoppedConversationEvents(conversationId, messages) {
|
|
|
3481
3538
|
}
|
|
3482
3539
|
}]);
|
|
3483
3540
|
}
|
|
3484
|
-
export {
|
|
3541
|
+
export { SLACK_EVENT_NAMESPACE as $, enqueueEventNotification as A, resolveEventMentions as B, listActiveMailboxTurns as C, turnInputFactsFromConversationMessage as D, sourceFromTurnInput as E, renderTaskInput as F, recordFinishedTurnForAutomatedLimit as G, annotationKeyDigest as H, maybePostAutomatedTurnLimitNotice as I, conversationSubtreeColumns as J, resetAutomatedTurnLimit as K, postAutomatedTurnLimitNoticeForConversation as L, isEventMailboxMetadata as M, renderEventBatchInputs as N, legacyWebMailboxMetadataSchema as O, timerWatchCredentialSubject as P, getEventCatalog as Q, resolveSlackReplyTarget as R, listActiveMailboxTurnSources as S, writeAgentHistory as St, resolveMailboxTurnWork as T, decodeAnnotationRef as U, renderSlackObjectCard as V, admitAutomatedTurn as W, isExperimentalFeatureEnabled as X, getExperimentalFeatures as Y, setExperimentalFeatures as Z, readUserCustomization as _, showsAgentsInstructions as _t, session_stop_exports as a, WORKSPACE_SNAPSHOT_FAILED_EVENT as at, getAuthPausedConversationTurnId as b, readAgentHistory as bt, loadReviewItemInput as c, workspaceSnapshotWatch as ct, buildPromptInput as d, AGENTS_REMOVAL_NOTICE as dt, requireSlackChannelMessageScope as et, buildSteeringPiMessage as f, AGENTS_REPLACEMENT_NOTICE as ft, withoutSavedSteeringMessages as g, renderAgentsInstructions as gt, loadPromptTurnContext as h, readRepositoryInstructions as ht, resumeStoppedConversationTree as i, slackChannelMessageTrigger as it, eventBatchMessageMeta as j, EVENT_WAIT_MS as k, savedInputInstruction as l, buildDeploymentSystemPrompt as lt, instructionForInputs as m, findVisibleAgentsInstructions as mt, isSkippedAfterConversationStop as n, slackChannelMessageReplyThreadTs as nt, skipInputAfterConversationStop as o, WORKSPACE_SNAPSHOT_READY_EVENT as ot, instructionActorFor as p, buildAgentsInstructionsMessage as pt, conversationSubtree as q, markConversationsStopped as r, slackChannelMessageRunsAutomation as rt, eventReviewItemInputs as s, workspaceSnapshotFinishedEvent as st, getConversationStoppedAtMs as t, slackChannelMessageEvent as tt, assemblePrompt as u, JUNIOR_PERSONALITY as ut, saveUserCustomization as v, foldLeadingSystemMessages as vt, parseEventMessages as w, getEventBatchDelayMs as x, withAgentRequest as xt, addConversationNote as y, foldSystemMessages as yt, sendSlackReply as z };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
2
|
import { s as skillRoots } from "./package-discovery-x4AvVhMj.js";
|
|
3
|
-
import { h as logWarn } from "./logging-
|
|
4
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
3
|
+
import { h as logWarn } from "./logging-BPNTQVFu.js";
|
|
4
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-J52Tej47.js";
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import fs from "node:fs/promises";
|
package/dist/{slack-conversation-unfurl-Dd129Uov.js → slack-conversation-unfurl-EPG3riWF.js}
RENAMED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
|
-
import { Ao as readLatestConversationBrief, Ea as postSlackEphemeralMessage, Li as parseDashboardConversationLink, Tt as deferConversationMove, ka as unfurlSlackLinks, ma as formatSlackLink, pa as escapeSlackMrkdwnText, ps as getWorkspaceTeamId, xo as readConversationAccessFromSql } from "./projection-
|
|
2
|
+
import { Ao as readLatestConversationBrief, Ea as postSlackEphemeralMessage, Li as parseDashboardConversationLink, Tt as deferConversationMove, ka as unfurlSlackLinks, ma as formatSlackLink, pa as escapeSlackMrkdwnText, ps as getWorkspaceTeamId, xo as readConversationAccessFromSql } from "./projection-CcFBVFUo.js";
|
|
3
3
|
import { _ as slackUserIdSchema, b as slackMessageTsSchema, f as parseSlackTeamId, g as slackTeamIdSchema, h as slackChannelIdSchema, m as slackBotIdSchema, n as createSlackActor, p as parseSlackUserId, s as parseActorUserId, u as parseSlackChannelId } from "./actor-D2iXzvlN.js";
|
|
4
|
-
import { a as getConversationStore, it as getConversationIdByProviderConversation, o as getDb, q as createCache, s as getSqlExecutor } from "./db-
|
|
5
|
-
import { I as lookupSlackBot, L as lookupSlackUserProfile, pr as checkSlackChannelReadAccess } from "./warmup
|
|
6
|
-
import { E as withSpan } from "./logging-
|
|
7
|
-
import { i as readActorIdentity } from "./viewer-
|
|
8
|
-
import { t as runWithSlackInstallation } from "./adapter-context-
|
|
9
|
-
import { a as isMovableToSlack, i as continueConversationInSlack, n as alreadyContinuesInSlackMessage, t as BUSY } from "./continue-in-slack-
|
|
10
|
-
import "./store-
|
|
11
|
-
import { n as botConfig } from "./config-
|
|
4
|
+
import { a as getConversationStore, it as getConversationIdByProviderConversation, o as getDb, q as createCache, s as getSqlExecutor } from "./db-DU84dCVu.js";
|
|
5
|
+
import { I as lookupSlackBot, L as lookupSlackUserProfile, pr as checkSlackChannelReadAccess } from "./warmup--Gkz7iB-.js";
|
|
6
|
+
import { E as withSpan } from "./logging-BPNTQVFu.js";
|
|
7
|
+
import { i as readActorIdentity } from "./viewer-CxUiOraX.js";
|
|
8
|
+
import { t as runWithSlackInstallation } from "./adapter-context-BpvbUki8.js";
|
|
9
|
+
import { a as isMovableToSlack, i as continueConversationInSlack, n as alreadyContinuesInSlackMessage, t as BUSY } from "./continue-in-slack-Cvot6S38.js";
|
|
10
|
+
import "./store-Ca6G962n.js";
|
|
11
|
+
import { n as botConfig } from "./config-CBZp0udd.js";
|
|
12
12
|
import * as z from "zod";
|
|
13
13
|
// src/chat/ingress/workspace-membership.ts
|
|
14
14
|
const MEMBER_TTL_MS = 3e5;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
|
-
import { M as toolInvocationDestination, j as actorFromRun } from "./agent-runner-
|
|
3
|
-
import { n as botConfig } from "./config-
|
|
4
|
-
import { t as readConversationLineage } from "./lineage-
|
|
5
|
-
import { _ as getConversationWorkState } from "./store-
|
|
6
|
-
import { En as getAgentBinding, Sn as AgentDepthLimitError, Ut as getAgentInvocation, ln as createAndEnqueueAgentInvocation } from "./warmup
|
|
7
|
-
import { I as getUnnamedAgentConversationId, T as getAgentInvocationId, k as getAgentInvocationMessageId } from "./turn-user-message-
|
|
2
|
+
import { M as toolInvocationDestination, j as actorFromRun } from "./agent-runner-C5d6rY5g.js";
|
|
3
|
+
import { n as botConfig } from "./config-CBZp0udd.js";
|
|
4
|
+
import { t as readConversationLineage } from "./lineage-DLd2UxVP.js";
|
|
5
|
+
import { _ as getConversationWorkState } from "./store-Ca6G962n.js";
|
|
6
|
+
import { En as getAgentBinding, Sn as AgentDepthLimitError, Ut as getAgentInvocation, ln as createAndEnqueueAgentInvocation } from "./warmup--Gkz7iB-.js";
|
|
7
|
+
import { I as getUnnamedAgentConversationId, T as getAgentInvocationId, k as getAgentInvocationMessageId } from "./turn-user-message-BrhuyYrH.js";
|
|
8
8
|
// src/chat/agent-invocations/spawn.ts
|
|
9
9
|
var spawn_exports = /* @__PURE__ */ __exportAll({ bindSpawnAgent: () => bindSpawnAgent });
|
|
10
10
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { i as getChatConfig } from "./config-
|
|
2
|
-
import { h as logWarn } from "./logging-
|
|
3
|
-
import { o as getDb } from "./db-
|
|
4
|
-
import { F as juniorUsers } from "./executor-
|
|
1
|
+
import { i as getChatConfig } from "./config-CBZp0udd.js";
|
|
2
|
+
import { h as logWarn } from "./logging-BPNTQVFu.js";
|
|
3
|
+
import { o as getDb } from "./db-DU84dCVu.js";
|
|
4
|
+
import { F as juniorUsers } from "./executor-CFyrgOu1.js";
|
|
5
5
|
import { createCipheriv, createDecipheriv, createHash, randomBytes } from "node:crypto";
|
|
6
6
|
import { eq } from "drizzle-orm";
|
|
7
7
|
// src/chat/conversations/legacy-web-actor-id.ts
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { $ as loadTurnCheckpoint, $n as applyPluginFormatMarkdown, A as latestConversationMessageSeq, Ai as getDashboardLinkFilter, Ao as readLatestConversationBrief, Bo as getSlackFileId, Co as conversationIsMemberRoot, D as estimateConversationMessagesTokens, Do as viewerMarksFromParticipant, Dr as closeReviewItem, E as buildConversationContext, Eo as conversationViewerMarks, Es as lookupSlackUserNames, F as turnHasReply, Fr as listWaitingConversations, Go as slackAttachmentsVersionQuery, Gr as isOnlyAssignee, H as PluginCredentialFailureError, Ho as readAttachmentVisionSummary, Ht as releaseInboundMessage, I as upsertConversationMessage, Ii as isDashboardLink, In as trimTrailingAssistantMessages, Io as buildSentryConversationUrl, K as AuthorizationFlowDisabledError, Li as parseDashboardConversationLink, M as normalizeConversationText, Mi as getDashboardPersonLink, Mo as readConversationEventPageAfter, Mr as getReviewItem, N as recordDeliveredAssistantMessage, No as readConversationEventPageAround, Ns as piMessageFromHistoryItem, O as getConversationMessageSlackTs, Oa as removeReactionFromMessage, P as trimConversationMessages, Pr as listReplyActionItems, Ri as parseDashboardPersonLink, Rr as takeReviewItem, S as resolveConversationTitle, So as conversationHasParticipantUser, Ss as listConversationAnnotationsById, To as conversationPinnedForUser, Ts as lookupSlackUser, V as createPluginEgress, Vr as canActOnReviewItem, Wo as recordSlackAttachment, Wr as canUserReadReviewItem, X as clearPendingAuth, Xr as reviewItemNeedsSomeone, Yn as createUserTokenStore, Zo as storeAttachment, _o as createPluginLogger, a as loadProjection, at as failTurnRecord, b as persistConversationMessages, ba as truncateStatusText, bn as persistWithRetry, bo as createConversationAccessReader, cr as getPlugins, cs as normalizeSlackConversationId, ct as listTurnSummaries, d as recordAuthorizationCompleted, di as cancelSubscriptions, ds as withSlackRetries, es as SlackActionError, et as lostWorkerBeforeFirstSave, fa as SLACK_USER_MENTION_RE, ga as normalizeSlackStatusText, h as recordSubscribedReplyRoute, i as loadConversationProjection, is as getSlackClient, it as completeTurnRecord, j as markConversationMessage, jo as readConversationEventPage, js as configValueSchema, k as isHumanConversationMessage, ki as getDashboardConversationLink, ks as createPluginCache, lt as recordTurnSummary, n as commitMessages, nt as saveTurnCheckpoint, o as loadTurnProjection, os as isDmChannel, qo as isFileAttachment, rs as getHeaderString, rt as abandonTurnRecord, ss as isSlackRequestTimeout, st as getTurnRecord, t as commitAcceptedReply, tn as buildTurnErrorResponse, ts as downloadPrivateSlackFile, tt as pauseLostWorkerTurn, ua as resolveBaseUrl, un as getAssistantReplyText, us as streamPrivateSlackFile, v as hydrateConversationMessages, va as slackMentionedUserIds, w as fallbackShortTitle, wo as conversationIsNotUnsubscribedRoot, xa as addReactionToMessage, xo as readConversationAccessFromSql, xs as listConversationAnnotations, y as persistConversationMessageWindow, ya as wrapBareSlackUserIds, yo as canAddConversationMessages, zo as notInheritedByForkChild } from "./projection-
|
|
2
|
-
import { F as textCharsForTokens, P as estimateTextTokens, V as escapeXml, X as isProviderRetryError, c as getSlackClientSecret, i as getChatConfig, k as resolveGatewayModel, l as getSlackSigningSecret, n as botConfig, o as getSlackBotToken, s as getSlackClientId, y as normalizeSlackEmojiName } from "./config-
|
|
3
|
-
import { E as withSpan, G as normalizeIdentityEmail, J as toOptionalString, K as isRecord, S as setTags, T as withLogContext, b as setSpanAttributes, f as logError, h as logWarn, m as logInfo, n as createChatSdkLogger, o as getActiveTraceContext, p as logException, q as toOptionalNumber, s as getActiveTraceId, t as buildTurnFailureResponse, y as setSentryUser } from "./logging-
|
|
1
|
+
import { $ as loadTurnCheckpoint, $n as applyPluginFormatMarkdown, A as latestConversationMessageSeq, Ai as getDashboardLinkFilter, Ao as readLatestConversationBrief, Bo as getSlackFileId, Co as conversationIsMemberRoot, D as estimateConversationMessagesTokens, Do as viewerMarksFromParticipant, Dr as closeReviewItem, E as buildConversationContext, Eo as conversationViewerMarks, Es as lookupSlackUserNames, F as turnHasReply, Fr as listWaitingConversations, Go as slackAttachmentsVersionQuery, Gr as isOnlyAssignee, H as PluginCredentialFailureError, Ho as readAttachmentVisionSummary, Ht as releaseInboundMessage, I as upsertConversationMessage, Ii as isDashboardLink, In as trimTrailingAssistantMessages, Io as buildSentryConversationUrl, K as AuthorizationFlowDisabledError, Li as parseDashboardConversationLink, M as normalizeConversationText, Mi as getDashboardPersonLink, Mo as readConversationEventPageAfter, Mr as getReviewItem, N as recordDeliveredAssistantMessage, No as readConversationEventPageAround, Ns as piMessageFromHistoryItem, O as getConversationMessageSlackTs, Oa as removeReactionFromMessage, P as trimConversationMessages, Pr as listReplyActionItems, Ri as parseDashboardPersonLink, Rr as takeReviewItem, S as resolveConversationTitle, So as conversationHasParticipantUser, Ss as listConversationAnnotationsById, To as conversationPinnedForUser, Ts as lookupSlackUser, V as createPluginEgress, Vr as canActOnReviewItem, Wo as recordSlackAttachment, Wr as canUserReadReviewItem, X as clearPendingAuth, Xr as reviewItemNeedsSomeone, Yn as createUserTokenStore, Zo as storeAttachment, _o as createPluginLogger, a as loadProjection, at as failTurnRecord, b as persistConversationMessages, ba as truncateStatusText, bn as persistWithRetry, bo as createConversationAccessReader, cr as getPlugins, cs as normalizeSlackConversationId, ct as listTurnSummaries, d as recordAuthorizationCompleted, di as cancelSubscriptions, ds as withSlackRetries, es as SlackActionError, et as lostWorkerBeforeFirstSave, fa as SLACK_USER_MENTION_RE, ga as normalizeSlackStatusText, h as recordSubscribedReplyRoute, i as loadConversationProjection, is as getSlackClient, it as completeTurnRecord, j as markConversationMessage, jo as readConversationEventPage, js as configValueSchema, k as isHumanConversationMessage, ki as getDashboardConversationLink, ks as createPluginCache, lt as recordTurnSummary, n as commitMessages, nt as saveTurnCheckpoint, o as loadTurnProjection, os as isDmChannel, qo as isFileAttachment, rs as getHeaderString, rt as abandonTurnRecord, ss as isSlackRequestTimeout, st as getTurnRecord, t as commitAcceptedReply, tn as buildTurnErrorResponse, ts as downloadPrivateSlackFile, tt as pauseLostWorkerTurn, ua as resolveBaseUrl, un as getAssistantReplyText, us as streamPrivateSlackFile, v as hydrateConversationMessages, va as slackMentionedUserIds, w as fallbackShortTitle, wo as conversationIsNotUnsubscribedRoot, xa as addReactionToMessage, xo as readConversationAccessFromSql, xs as listConversationAnnotations, y as persistConversationMessageWindow, ya as wrapBareSlackUserIds, yo as canAddConversationMessages, zo as notInheritedByForkChild } from "./projection-CcFBVFUo.js";
|
|
2
|
+
import { F as textCharsForTokens, P as estimateTextTokens, V as escapeXml, X as isProviderRetryError, c as getSlackClientSecret, i as getChatConfig, k as resolveGatewayModel, l as getSlackSigningSecret, n as botConfig, o as getSlackBotToken, s as getSlackClientId, y as normalizeSlackEmojiName } from "./config-CBZp0udd.js";
|
|
3
|
+
import { E as withSpan, G as normalizeIdentityEmail, J as toOptionalString, K as isRecord, S as setTags, T as withLogContext, b as setSpanAttributes, f as logError, h as logWarn, m as logInfo, n as createChatSdkLogger, o as getActiveTraceContext, p as logException, q as toOptionalNumber, s as getActiveTraceId, t as buildTurnFailureResponse, y as setSentryUser } from "./logging-BPNTQVFu.js";
|
|
4
4
|
import { h as startSpan } from "./sentry-CPbZjomA.js";
|
|
5
|
-
import { t as JUNIOR_VERSION } from "./version-
|
|
5
|
+
import { t as JUNIOR_VERSION } from "./version-qROlRQGF.js";
|
|
6
6
|
import { f as parseSlackTeamId, i as isActorUserId, n as createSlackActor, o as isUserActor, r as createSlackResumeActor, s as parseActorUserId, t as createActor, u as parseSlackChannelId, v as parseSlackMessageTs } from "./actor-D2iXzvlN.js";
|
|
7
|
-
import { A as conversationKindFromRow, D as postsRunNotices, E as isTopLevelKind, I as resolveActorIdentityId, K as readCachedUserByEmail, L as saveActorAvatar, Q as setStateValues, X as getStateAdapter, Z as getStateValues, _ as readConversationTrees, a as getConversationStore, at as parseSessionSource, b as lastMessageAtSql, dt as resolveRootConversationId, et as acquireActiveLock, f as copyMessageLinks, gt as createSlackDestination, h as conversationAncestors, j as locationFromRow, k as turnBehavior, lt as agentTurnUsageSchema, m as withConversationEventLock, mt as nextDetailVersion, o as getDb, ot as addAgentTurnUsage, q as createCache, r as getConversationEventStore, s as getSqlExecutor, ut as hasAgentTurnUsage, v as setArchivedAt, vt as requireSlackDestination, w as deliversFinalText, y as loadConversationSlackTenantIds } from "./db-
|
|
8
|
-
import { D as juniorConversationAnnotations, F as juniorUsers, I as juniorDestinations, M as juniorMessageAttachments, N as juniorConversations, O as juniorCodeChanges, P as juniorIdentities, T as juniorConversationEvents, g as juniorAgentInvocations, j as juniorAttachments, l as juniorReviewItems, s as juniorReviewItemConversations, v as juniorConversationParticipants, x as juniorConversationBriefs } from "./executor-
|
|
7
|
+
import { A as conversationKindFromRow, D as postsRunNotices, E as isTopLevelKind, I as resolveActorIdentityId, K as readCachedUserByEmail, L as saveActorAvatar, Q as setStateValues, X as getStateAdapter, Z as getStateValues, _ as readConversationTrees, a as getConversationStore, at as parseSessionSource, b as lastMessageAtSql, dt as resolveRootConversationId, et as acquireActiveLock, f as copyMessageLinks, gt as createSlackDestination, h as conversationAncestors, j as locationFromRow, k as turnBehavior, lt as agentTurnUsageSchema, m as withConversationEventLock, mt as nextDetailVersion, o as getDb, ot as addAgentTurnUsage, q as createCache, r as getConversationEventStore, s as getSqlExecutor, ut as hasAgentTurnUsage, v as setArchivedAt, vt as requireSlackDestination, w as deliversFinalText, y as loadConversationSlackTenantIds } from "./db-DU84dCVu.js";
|
|
8
|
+
import { D as juniorConversationAnnotations, F as juniorUsers, I as juniorDestinations, M as juniorMessageAttachments, N as juniorConversations, O as juniorCodeChanges, P as juniorIdentities, T as juniorConversationEvents, g as juniorAgentInvocations, j as juniorAttachments, l as juniorReviewItems, s as juniorReviewItemConversations, v as juniorConversationParticipants, x as juniorConversationBriefs } from "./executor-CFyrgOu1.js";
|
|
9
9
|
import { d as contextProvenance, p as instructionProvenanceFor, t as KNOWN_CONVERSATION_EVENT_TYPES } from "./history-m2-ceTTX.js";
|
|
10
|
-
import { d as actorLogContext, f as credentialContextForActor } from "./registry-
|
|
11
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
12
|
-
import { A as RetryableDeliveryError, N as shouldEmitDevAgentTrace, T as safeLinkUrl, _ as createSlackReviewItemShow, a as buildAuthPauseResponse, c as createClientMetadata, l as readMcpClientInformation, m as resolveDestinationVisibility, n as executeAgentRun, s as getMcpOAuthCallbackPath, t as createAgentRunner, u as latestProgressStatus } from "./agent-runner-
|
|
13
|
-
import { d as PluginMcpClient, u as McpAuthorizationRequiredError, v as getMcpStoredOAuthCredentials } from "./service-account-
|
|
14
|
-
import { i as webActorUserIds } from "./state-
|
|
15
|
-
import { a as EVENT_SYSTEM_ACTOR, c as completeDecision, o as isEventConversationMessage, u as completeText } from "./prompt-
|
|
16
|
-
import { f as identityAvatarUrl, g as userAvatarUrlsFromIdentities, h as readUserAvatarUrls } from "./viewer-
|
|
10
|
+
import { d as actorLogContext, f as credentialContextForActor } from "./registry-BjZZqKqi.js";
|
|
11
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-J52Tej47.js";
|
|
12
|
+
import { A as RetryableDeliveryError, N as shouldEmitDevAgentTrace, T as safeLinkUrl, _ as createSlackReviewItemShow, a as buildAuthPauseResponse, c as createClientMetadata, l as readMcpClientInformation, m as resolveDestinationVisibility, n as executeAgentRun, s as getMcpOAuthCallbackPath, t as createAgentRunner, u as latestProgressStatus } from "./agent-runner-C5d6rY5g.js";
|
|
13
|
+
import { d as PluginMcpClient, u as McpAuthorizationRequiredError, v as getMcpStoredOAuthCredentials } from "./service-account-DU5865XA.js";
|
|
14
|
+
import { i as webActorUserIds } from "./state-nCR4Muhn.js";
|
|
15
|
+
import { a as EVENT_SYSTEM_ACTOR, c as completeDecision, o as isEventConversationMessage, u as completeText } from "./prompt-C5LREK2p.js";
|
|
16
|
+
import { f as identityAvatarUrl, g as userAvatarUrlsFromIdentities, h as readUserAvatarUrls } from "./viewer-CxUiOraX.js";
|
|
17
17
|
import { J as readMessageAttachments, W as MAX_ATTACHMENT_BYTES, f as conversationEventPageSchema, u as conversationDetailReportSchema } from "./conversation-BOqdRtUx.js";
|
|
18
18
|
import { t as readJuniorSecret } from "./secrets-DHaJ5TTn.js";
|
|
19
|
-
import { G as
|
|
20
|
-
import { An as createPausedTurns, Dt as webActorFromUser, Et as recordWebConversationActivity, Fn as canJoinTurn, Hn as AgentRunError, In as canShareTurn, Jn as throwApiError, Mi as gapSegment, Mt as verifyAttachmentUploads, Nn as wakePausedTurn, Pn as getTurnAuthorization, Qn as parseSlackMessageReference, St as appendAndEnqueueWebMessage, Tt as createConversationId, Un as executeTurn, Vn as getWebAuthorization, Wt as getChildAgentLabel, Xn as renderAttachmentText, Zn as renderBlockText, _n as cancelSignInWait, _r as isConversationMember, br as listThreadReplies, c as isConversationWorkDone, cr as readSlackRawMessageContext, d as addHistoryPeriod, f as firstLiveSavingsDate, ft as conversationReadPositionQuery, gn as stopChildAgentsOf, gr as getConversationInfo, hn as stopChildAgentsBelow, hr as getChannelMessage, i as GLOBAL_GAPS_TTL_MS, ji as NO_REPLY_GAP_MS, jn as getPausedTurnRequest, ki as MINUTE_MS, kn as supersedeTurnForInput, kt as AttachmentUploadError, l as listConversationWork, li as readConversationSourceTask, lr as resolveSlackChannelIdFromMessage, m as replaceHistorySavings, mn as dropOwnUnreadLoopReplies, n as CONVERSATION_STATE_TTL_MS, o as segmentGapsKey, p as idlePeriodSavings, r as GLOBAL_GAPS_MAX, sr as parseSlackThreadId, t as ANSWER_TOOL_ENDINGS, ut as readLastUserMessageAtByConversation, v as connectedState, vr as isPublicSlackChannel, vt as deliverReviewItemChange, wt as createAndEnqueueConversation, xt as acceptsWebMessages, y as providerCacheTtlMs } from "./warmup
|
|
21
|
-
import { C as markDispatchCompleted, F as readAutomationTitlesByConversationId, S as markDispatchBlocked, T as markDispatchRunning, _ as getDispatchTurnId, a as getPersistedThreadState, c as coerceThreadConversationState, d as confirmDispatchMailboxAppend, g as getDispatchRecord, h as getDispatchInputMessageId, i as getPersistedSandboxState, m as getDispatchIdForConversation, n as resolveTurnSessionRouting, o as persistThreadRuntimeState, p as getDispatchConversationId, r as getLocationConfigurationService, s as persistThreadStateById, t as resolveConversationRouting, u as claimDispatchMailboxAppend, w as markDispatchFailed, x as markDispatchAwaitingResume, y as isTerminalDispatchStatus } from "./turn-session-routing-
|
|
19
|
+
import { G as recordFinishedTurnForAutomatedLimit, I as maybePostAutomatedTurnLimitNotice, J as conversationSubtreeColumns, O as legacyWebMailboxMetadataSchema, R as resolveSlackReplyTarget, T as resolveMailboxTurnWork, X as isExperimentalFeatureEnabled, c as loadReviewItemInput, f as buildSteeringPiMessage, g as withoutSavedSteeringMessages, l as savedInputInstruction, o as skipInputAfterConversationStop, p as instructionActorFor, q as conversationSubtree, r as markConversationsStopped, z as sendSlackReply } from "./session-stop-uotLtp4g.js";
|
|
20
|
+
import { An as createPausedTurns, Dt as webActorFromUser, Et as recordWebConversationActivity, Fn as canJoinTurn, Hn as AgentRunError, In as canShareTurn, Jn as throwApiError, Mi as gapSegment, Mt as verifyAttachmentUploads, Nn as wakePausedTurn, Pn as getTurnAuthorization, Qn as parseSlackMessageReference, St as appendAndEnqueueWebMessage, Tt as createConversationId, Un as executeTurn, Vn as getWebAuthorization, Wt as getChildAgentLabel, Xn as renderAttachmentText, Zn as renderBlockText, _n as cancelSignInWait, _r as isConversationMember, br as listThreadReplies, c as isConversationWorkDone, cr as readSlackRawMessageContext, d as addHistoryPeriod, f as firstLiveSavingsDate, ft as conversationReadPositionQuery, gn as stopChildAgentsOf, gr as getConversationInfo, hn as stopChildAgentsBelow, hr as getChannelMessage, i as GLOBAL_GAPS_TTL_MS, ji as NO_REPLY_GAP_MS, jn as getPausedTurnRequest, ki as MINUTE_MS, kn as supersedeTurnForInput, kt as AttachmentUploadError, l as listConversationWork, li as readConversationSourceTask, lr as resolveSlackChannelIdFromMessage, m as replaceHistorySavings, mn as dropOwnUnreadLoopReplies, n as CONVERSATION_STATE_TTL_MS, o as segmentGapsKey, p as idlePeriodSavings, r as GLOBAL_GAPS_MAX, sr as parseSlackThreadId, t as ANSWER_TOOL_ENDINGS, ut as readLastUserMessageAtByConversation, v as connectedState, vr as isPublicSlackChannel, vt as deliverReviewItemChange, wt as createAndEnqueueConversation, xt as acceptsWebMessages, y as providerCacheTtlMs } from "./warmup--Gkz7iB-.js";
|
|
21
|
+
import { C as markDispatchCompleted, F as readAutomationTitlesByConversationId, S as markDispatchBlocked, T as markDispatchRunning, _ as getDispatchTurnId, a as getPersistedThreadState, c as coerceThreadConversationState, d as confirmDispatchMailboxAppend, g as getDispatchRecord, h as getDispatchInputMessageId, i as getPersistedSandboxState, m as getDispatchIdForConversation, n as resolveTurnSessionRouting, o as persistThreadRuntimeState, p as getDispatchConversationId, r as getLocationConfigurationService, s as persistThreadStateById, t as resolveConversationRouting, u as claimDispatchMailboxAppend, w as markDispatchFailed, x as markDispatchAwaitingResume, y as isTerminalDispatchStatus } from "./turn-session-routing-2bW2qfeb.js";
|
|
22
22
|
import { h as isVisionImageMediaType, l as isEmptyUserInputAnswer, m as detectImageMediaType, t as webMessageId, u as normalizeUserInputAnswer } from "./web-message-id-lNodcCOI.js";
|
|
23
|
-
import { L as buildDeterministicAssistantMessageId, R as buildDeterministicTurnId, a as ConversationTurnBoundaryError, c as TurnInputDeferredError, d as isTurnInputCommitLostError, f as isTurnInputDeferredError, g as startActiveTurn, h as markTurnFailed, i as getTurnUserSlackMessageTs, l as getConversationTurnBoundaryError, m as markTurnCompleted, o as CooperativeTurnYieldError, p as markTurnClosed, r as getTurnUserReplyAttachmentContext, s as TurnInputCommitLostError, t as getTurnUserMessage, u as isCooperativeTurnYieldError, v as getTurnLifecycle } from "./turn-user-message-
|
|
24
|
-
import { o as getVercelConversationWorkQueue, p as getTurnRequestDeadline } from "./background-compaction-queue-
|
|
25
|
-
import { D as stopConversationWork, E as steerWebPendingMessages, _ as getConversationWorkState, a as cancelHumanFacingPendingMessages, g as getConversation, h as ensureConversationWake, r as appendAndEnqueueInboundMessage, s as claimInboundMessage } from "./store-
|
|
26
|
-
import { t as runWithSlackInstallation } from "./adapter-context-
|
|
23
|
+
import { L as buildDeterministicAssistantMessageId, R as buildDeterministicTurnId, a as ConversationTurnBoundaryError, c as TurnInputDeferredError, d as isTurnInputCommitLostError, f as isTurnInputDeferredError, g as startActiveTurn, h as markTurnFailed, i as getTurnUserSlackMessageTs, l as getConversationTurnBoundaryError, m as markTurnCompleted, o as CooperativeTurnYieldError, p as markTurnClosed, r as getTurnUserReplyAttachmentContext, s as TurnInputCommitLostError, t as getTurnUserMessage, u as isCooperativeTurnYieldError, v as getTurnLifecycle } from "./turn-user-message-BrhuyYrH.js";
|
|
24
|
+
import { o as getVercelConversationWorkQueue, p as getTurnRequestDeadline } from "./background-compaction-queue-BTqMIfTA.js";
|
|
25
|
+
import { D as stopConversationWork, E as steerWebPendingMessages, _ as getConversationWorkState, a as cancelHumanFacingPendingMessages, g as getConversation, h as ensureConversationWake, r as appendAndEnqueueInboundMessage, s as claimInboundMessage } from "./store-Ca6G962n.js";
|
|
26
|
+
import { t as runWithSlackInstallation } from "./adapter-context-BpvbUki8.js";
|
|
27
27
|
import { D as personObjectCard, E as messageObjectCard, O as webPageObjectCard, T as conversationObjectCard, m as healthReportSchema, r as conversationFeedSchema, t as conversationFeedBriefSchema, u as conversationPendingMessagesReportSchema } from "./conversation-feed-CgpgP7yi.js";
|
|
28
|
-
import { c as withTurnSpan, n as createConversationTurnWorker, o as getTurnInputSpanAttributes, r as canPauseConversationDelivery, s as turnInputTelemetry } from "./conversation-turn-
|
|
29
|
-
import { n as buildStoredAttachmentPromptText } from "./model-input-
|
|
30
|
-
import { i as enqueueAgentInvocationResult, n as createDeliverToParent, s as withAgentInvocationResultActors, t as createChildConversationWorker } from "./result-
|
|
31
|
-
import { t as bindMessageAgent } from "./message-
|
|
32
|
-
import { t as readConversationLineage } from "./lineage-
|
|
33
|
-
import { t as bindSpawnAgent } from "./spawn-
|
|
34
|
-
import { a as requireTurnFailureEventId, c as buildDeliveredTurnStatePatch, i as getAgentTurnDiagnosticsAttributes, l as loadPendingMessageCards, n as loadThreadContextTrimFloor, o as completeAuthPauseTurn, r as finalizeFailedTurnReplyWithEvent, s as persistAuthPauseTurnState, t as buildTurnThreadContext } from "./thread-context-
|
|
35
|
-
import { n as scheduleSessionCompletedPluginTasks } from "./task-runner-
|
|
36
|
-
import { r as canContinueInSlack } from "./continue-in-slack-
|
|
28
|
+
import { c as withTurnSpan, n as createConversationTurnWorker, o as getTurnInputSpanAttributes, r as canPauseConversationDelivery, s as turnInputTelemetry } from "./conversation-turn-CI8WDpnK.js";
|
|
29
|
+
import { n as buildStoredAttachmentPromptText } from "./model-input-DoM9Ht-d.js";
|
|
30
|
+
import { i as enqueueAgentInvocationResult, n as createDeliverToParent, s as withAgentInvocationResultActors, t as createChildConversationWorker } from "./result-icDrueyB.js";
|
|
31
|
+
import { t as bindMessageAgent } from "./message-BWJLeQ5e.js";
|
|
32
|
+
import { t as readConversationLineage } from "./lineage-DLd2UxVP.js";
|
|
33
|
+
import { t as bindSpawnAgent } from "./spawn-CoD3vDuS.js";
|
|
34
|
+
import { a as requireTurnFailureEventId, c as buildDeliveredTurnStatePatch, i as getAgentTurnDiagnosticsAttributes, l as loadPendingMessageCards, n as loadThreadContextTrimFloor, o as completeAuthPauseTurn, r as finalizeFailedTurnReplyWithEvent, s as persistAuthPauseTurnState, t as buildTurnThreadContext } from "./thread-context-BOvZhsKK.js";
|
|
35
|
+
import { n as scheduleSessionCompletedPluginTasks } from "./task-runner-xsOPIxCZ.js";
|
|
36
|
+
import { r as canContinueInSlack } from "./continue-in-slack-Cvot6S38.js";
|
|
37
37
|
import * as z from "zod";
|
|
38
38
|
import { createHash, createHmac, randomUUID, timingSafeEqual } from "node:crypto";
|
|
39
39
|
import { and, asc, count, desc, eq, gt, gte, inArray, isNotNull, isNull, lte, ne, not, or, sql } from "drizzle-orm";
|
|
@@ -6705,7 +6705,6 @@ function createConversationWork(options) {
|
|
|
6705
6705
|
}));
|
|
6706
6706
|
const childWorker = createChildConversationWorker(options.agentRunner, {
|
|
6707
6707
|
enqueueResult,
|
|
6708
|
-
maxAgentDepth: botConfig.maxAgentDepth,
|
|
6709
6708
|
queue: options.queue,
|
|
6710
6709
|
runTurn: conversationTurnWorker,
|
|
6711
6710
|
state: options.state
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as getConversationStore } from "./db-
|
|
2
|
-
import { p as logException } from "./logging-
|
|
3
|
-
import "./background-compaction-queue-
|
|
4
|
-
import { At as getConversationWorkStates$1, Bt as recordConversationRetry$1, Dt as dropPendingMessages$1, Et as drainConversationMailbox$1, Ft as listActiveConversationIds$1, Gt as startConversationWork$1, Ht as releaseInboundMessage, It as markConversationWorkEnqueued$1, Jt as takeDeferredConversationMove, Kt as steerWebPendingMessages$1, Mt as hasRunnableConversationWork, Ot as getConversation$1, St as completeConversationWork$1, Ut as requestAnotherSlice$1, Vt as releaseConversationWork$1, Wt as requestConversationWork$1, _t as checkInConversationWork$1, bt as clearExpiredConversationLease$1, ft as ackMessages$1, gt as cancelHumanFacingPendingMessages$1, ht as beginConversationResume$1, kt as getConversationWorkState$1, mt as appendInboundMessage, pt as appendExclusiveInboundMessage, qt as stopConversationWork$1, vt as claimInboundMessage$1, wt as deadLetterAttempt$1, xt as completeConversationStop$1, yt as clearConsumedConversationWake$1, zt as recordAttemptFailure$1 } from "./projection-
|
|
1
|
+
import { a as getConversationStore } from "./db-DU84dCVu.js";
|
|
2
|
+
import { p as logException } from "./logging-BPNTQVFu.js";
|
|
3
|
+
import "./background-compaction-queue-BTqMIfTA.js";
|
|
4
|
+
import { At as getConversationWorkStates$1, Bt as recordConversationRetry$1, Dt as dropPendingMessages$1, Et as drainConversationMailbox$1, Ft as listActiveConversationIds$1, Gt as startConversationWork$1, Ht as releaseInboundMessage, It as markConversationWorkEnqueued$1, Jt as takeDeferredConversationMove, Kt as steerWebPendingMessages$1, Mt as hasRunnableConversationWork, Ot as getConversation$1, St as completeConversationWork$1, Ut as requestAnotherSlice$1, Vt as releaseConversationWork$1, Wt as requestConversationWork$1, _t as checkInConversationWork$1, bt as clearExpiredConversationLease$1, ft as ackMessages$1, gt as cancelHumanFacingPendingMessages$1, ht as beginConversationResume$1, kt as getConversationWorkState$1, mt as appendInboundMessage, pt as appendExclusiveInboundMessage, qt as stopConversationWork$1, vt as claimInboundMessage$1, wt as deadLetterAttempt$1, xt as completeConversationStop$1, yt as clearConsumedConversationWake$1, zt as recordAttemptFailure$1 } from "./projection-CcFBVFUo.js";
|
|
5
5
|
// src/chat/task-execution/store.ts
|
|
6
6
|
function metadataStore(options) {
|
|
7
7
|
return options.conversationStore ?? getConversationStore();
|
|
@@ -304,7 +304,7 @@ async function runDeferredMove(args) {
|
|
|
304
304
|
const move = await takeDeferredConversationMove(args);
|
|
305
305
|
if (move === void 0) return;
|
|
306
306
|
try {
|
|
307
|
-
const { continueDeferredSlackClick } = await import("./slack-conversation-unfurl-
|
|
307
|
+
const { continueDeferredSlackClick } = await import("./slack-conversation-unfurl-EPG3riWF.js").then((n) => n.r);
|
|
308
308
|
await continueDeferredSlackClick(move, args.getSlackAdapter);
|
|
309
309
|
} catch (error) {
|
|
310
310
|
logException(error, "slack.continue_here.deferred.failed", { "gen_ai.conversation.id": args.conversationId });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h as logWarn } from "./logging-
|
|
2
|
-
import { a as queueCallback, d as verifyQueueMessage, f as getQueueProvider, l as QUEUE_SIGNATURE_MAX_AGE_MS, u as signQueueMessage } from "./background-compaction-queue-
|
|
1
|
+
import { h as logWarn } from "./logging-BPNTQVFu.js";
|
|
2
|
+
import { a as queueCallback, d as verifyQueueMessage, f as getQueueProvider, l as QUEUE_SIGNATURE_MAX_AGE_MS, u as signQueueMessage } from "./background-compaction-queue-BTqMIfTA.js";
|
|
3
3
|
import * as z from "zod";
|
|
4
4
|
import { createHash } from "node:crypto";
|
|
5
5
|
// src/chat/plugins/task-queue.ts
|
|
@@ -60,7 +60,7 @@ function pluginTaskCallback() {
|
|
|
60
60
|
maxDeliveries: PLUGIN_TASK_MAX_DELIVERIES,
|
|
61
61
|
onRejected: logPluginTaskQueueMessageRejected,
|
|
62
62
|
run: async (message) => {
|
|
63
|
-
const { processPluginTask } = await import("./task-runner-
|
|
63
|
+
const { processPluginTask } = await import("./task-runner-xsOPIxCZ.js").then((n) => n.r);
|
|
64
64
|
await processPluginTask(message);
|
|
65
65
|
},
|
|
66
66
|
topic: PLUGIN_TASK_QUEUE_TOPIC,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
|
-
import { Bi as createPluginState, Dn as instructionTextForProjection, Fn as stripRuntimeTurnContext, Mn as isToolResultMessage, Nn as normalizeToolNameFromResult, Oo as createPluginConversationEvents, Sn as getPiMessageRole, _o as createPluginLogger, cr as getPlugins, fr as coreTaskRegistrations, go as createPluginModelCostRecorder, io as createPluginModel, jn as isToolResultError, ks as createPluginCache, ro as createPluginEmbedder, st as getTurnRecord, v as hydrateConversationMessages } from "./projection-
|
|
3
|
-
import { X as getStateAdapter, a as getConversationStore, o as getDb } from "./db-
|
|
4
|
-
import { E as withSpan } from "./logging-
|
|
5
|
-
import { a as getPersistedThreadState, c as coerceThreadConversationState, g as getDispatchRecord, t as resolveConversationRouting } from "./turn-session-routing-
|
|
6
|
-
import { i as readActorIdentity } from "./viewer-
|
|
2
|
+
import { Bi as createPluginState, Dn as instructionTextForProjection, Fn as stripRuntimeTurnContext, Mn as isToolResultMessage, Nn as normalizeToolNameFromResult, Oo as createPluginConversationEvents, Sn as getPiMessageRole, _o as createPluginLogger, cr as getPlugins, fr as coreTaskRegistrations, go as createPluginModelCostRecorder, io as createPluginModel, jn as isToolResultError, ks as createPluginCache, ro as createPluginEmbedder, st as getTurnRecord, v as hydrateConversationMessages } from "./projection-CcFBVFUo.js";
|
|
3
|
+
import { X as getStateAdapter, a as getConversationStore, o as getDb } from "./db-DU84dCVu.js";
|
|
4
|
+
import { E as withSpan } from "./logging-BPNTQVFu.js";
|
|
5
|
+
import { a as getPersistedThreadState, c as coerceThreadConversationState, g as getDispatchRecord, t as resolveConversationRouting } from "./turn-session-routing-2bW2qfeb.js";
|
|
6
|
+
import { i as readActorIdentity } from "./viewer-CxUiOraX.js";
|
|
7
7
|
import { v as parseSlackMessageTs } from "./actor-D2iXzvlN.js";
|
|
8
8
|
import { m as sameActorIdentity } from "./history-m2-ceTTX.js";
|
|
9
|
-
import { i as pluginTaskParamsSchema, r as pluginTaskId, s as sendVercelPluginTask } from "./task-queue-
|
|
9
|
+
import { i as pluginTaskParamsSchema, r as pluginTaskId, s as sendVercelPluginTask } from "./task-queue-BLPZU6kC.js";
|
|
10
10
|
import { pluginRunContextSchema } from "@sentry/junior-plugin-api";
|
|
11
11
|
// src/chat/plugins/task-runner.ts
|
|
12
12
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { E as buildConversationContext, X as clearPendingAuth, j as markConversationMessage, v as hydrateConversationMessages, xs as listConversationAnnotations } from "./projection-
|
|
2
|
-
import { J as getProviderErrorUserMessage, K as findProviderError, U as ProviderError, q as getProviderErrorAttributes } from "./config-
|
|
3
|
-
import { K as isRecord, b as setSpanAttributes, t as buildTurnFailureResponse } from "./logging-
|
|
4
|
-
import { o as getDb, r as getConversationEventStore } from "./db-
|
|
1
|
+
import { E as buildConversationContext, X as clearPendingAuth, j as markConversationMessage, v as hydrateConversationMessages, xs as listConversationAnnotations } from "./projection-CcFBVFUo.js";
|
|
2
|
+
import { J as getProviderErrorUserMessage, K as findProviderError, U as ProviderError, q as getProviderErrorAttributes } from "./config-CBZp0udd.js";
|
|
3
|
+
import { K as isRecord, b as setSpanAttributes, t as buildTurnFailureResponse } from "./logging-BPNTQVFu.js";
|
|
4
|
+
import { o as getDb, r as getConversationEventStore } from "./db-DU84dCVu.js";
|
|
5
5
|
import { H as removedCardSchema, U as resolveMessageCards, V as readMessageCardRefs } from "./conversation-BOqdRtUx.js";
|
|
6
|
-
import { a as getPersistedThreadState, c as coerceThreadConversationState, s as persistThreadStateById } from "./turn-session-routing-
|
|
7
|
-
import { S as listChildMessages, m as markTurnCompleted, n as getTurnUserMessageId, p as markTurnClosed, x as isAgentInvocationResult } from "./turn-user-message-
|
|
8
|
-
import { _ as getConversationWorkState } from "./store-
|
|
6
|
+
import { a as getPersistedThreadState, c as coerceThreadConversationState, s as persistThreadStateById } from "./turn-session-routing-2bW2qfeb.js";
|
|
7
|
+
import { S as listChildMessages, m as markTurnCompleted, n as getTurnUserMessageId, p as markTurnClosed, x as isAgentInvocationResult } from "./turn-user-message-BrhuyYrH.js";
|
|
8
|
+
import { _ as getConversationWorkState } from "./store-Ca6G962n.js";
|
|
9
9
|
// src/chat/conversations/pending-cards.ts
|
|
10
10
|
/**
|
|
11
11
|
* Add the cards that tool results selected since the last visible assistant
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { As as createDurableLocationConfigurationService, Da as postSlackMessage, Fi as getDashboardTaskLink, Oi as JUNIOR_THREAD_STATE_TTL_MS, b as persistConversationMessages, eo as ToolInputError, ma as formatSlackLink, pa as escapeSlackMrkdwnText, w as fallbackShortTitle, wa as openSlackDirectMessage } from "./projection-
|
|
2
|
-
import { n as botConfig } from "./config-
|
|
3
|
-
import { J as toOptionalString, K as isRecord, _ as runBestEffort, h as logWarn, q as toOptionalNumber } from "./logging-
|
|
4
|
-
import { X as getStateAdapter, ct as agentTurnTotalTokens, o as getDb, st as agentTurnCostUsd } from "./db-
|
|
5
|
-
import { N as juniorConversations, d as juniorAutomationVersions, f as juniorAutomations, u as juniorAutomationRuns } from "./executor-
|
|
6
|
-
import { h as credentialSubjectSchema } from "./registry-
|
|
1
|
+
import { As as createDurableLocationConfigurationService, Da as postSlackMessage, Fi as getDashboardTaskLink, Oi as JUNIOR_THREAD_STATE_TTL_MS, b as persistConversationMessages, eo as ToolInputError, ma as formatSlackLink, pa as escapeSlackMrkdwnText, w as fallbackShortTitle, wa as openSlackDirectMessage } from "./projection-CcFBVFUo.js";
|
|
2
|
+
import { n as botConfig } from "./config-CBZp0udd.js";
|
|
3
|
+
import { J as toOptionalString, K as isRecord, _ as runBestEffort, h as logWarn, q as toOptionalNumber } from "./logging-BPNTQVFu.js";
|
|
4
|
+
import { X as getStateAdapter, ct as agentTurnTotalTokens, o as getDb, st as agentTurnCostUsd } from "./db-DU84dCVu.js";
|
|
5
|
+
import { N as juniorConversations, d as juniorAutomationVersions, f as juniorAutomations, u as juniorAutomationRuns } from "./executor-CFyrgOu1.js";
|
|
6
|
+
import { h as credentialSubjectSchema } from "./registry-BjZZqKqi.js";
|
|
7
7
|
import { B as automationTaskColumns, H as automationTaskSchema, M as scheduledAutomationSchema, S as automationVersionSchema, V as automationTaskDescription, k as eventAutomationSchema, z as automationSkillNameSchema } from "./automation-CuA3yEcD.js";
|
|
8
8
|
import * as z from "zod";
|
|
9
9
|
import { createHash } from "node:crypto";
|
|
@@ -1750,7 +1750,7 @@ function slackSourceForDestination(args) {
|
|
|
1750
1750
|
* Reads parent Conversations when this Conversation has no Destination.
|
|
1751
1751
|
*/
|
|
1752
1752
|
async function resolveConversationRouting(args) {
|
|
1753
|
-
const conversationStore = args.conversationStore ?? (await import("./db-
|
|
1753
|
+
const conversationStore = args.conversationStore ?? (await import("./db-DU84dCVu.js").then((n) => n.n)).getConversationStore();
|
|
1754
1754
|
const chain = await loadConversationChain(args.conversationId, conversationStore);
|
|
1755
1755
|
let destination;
|
|
1756
1756
|
let source;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Yt as readInboundMessageSender } from "./projection-
|
|
1
|
+
import { Yt as readInboundMessageSender } from "./projection-CcFBVFUo.js";
|
|
2
2
|
import { v as parseSlackMessageTs } from "./actor-D2iXzvlN.js";
|
|
3
|
-
import { r as getConversationEventStore, s as getSqlExecutor } from "./db-
|
|
4
|
-
import { g as juniorAgentInvocations } from "./executor-
|
|
3
|
+
import { r as getConversationEventStore, s as getSqlExecutor } from "./db-DU84dCVu.js";
|
|
4
|
+
import { g as juniorAgentInvocations } from "./executor-CFyrgOu1.js";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
import { inArray } from "drizzle-orm";
|
|
7
7
|
// src/chat/state/turn-id.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
2
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-J52Tej47.js";
|
|
3
3
|
import { isDeepStrictEqual } from "node:util";
|
|
4
4
|
// src/chat/plugins/validation.ts
|
|
5
5
|
var validation_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// package.json
|
|
2
|
-
var version = "0.
|
|
2
|
+
var version = "0.305.0";
|
|
3
3
|
// src/version.ts
|
|
4
4
|
/** Installed Junior package version, or `unknown` when package metadata is unavailable. */
|
|
5
5
|
const JUNIOR_VERSION = typeof version === "string" && version.trim() ? version : "unknown";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as JUNIOR_VERSION } from "./version-
|
|
1
|
+
export { t as JUNIOR_VERSION } from "./version-qROlRQGF.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { F as findActorIdentityId, G as clearCachedUser, K as readCachedUserByEmail, o as getDb } from "./db-
|
|
2
|
-
import { F as juniorUsers, P as juniorIdentities } from "./executor-
|
|
3
|
-
import { G as normalizeIdentityEmail, U as GOOGLE_IDENTITY_PROVIDER } from "./logging-
|
|
1
|
+
import { F as findActorIdentityId, G as clearCachedUser, K as readCachedUserByEmail, o as getDb } from "./db-DU84dCVu.js";
|
|
2
|
+
import { F as juniorUsers, P as juniorIdentities } from "./executor-CFyrgOu1.js";
|
|
3
|
+
import { G as normalizeIdentityEmail, U as GOOGLE_IDENTITY_PROVIDER } from "./logging-BPNTQVFu.js";
|
|
4
4
|
import { createHash, randomUUID } from "node:crypto";
|
|
5
5
|
import { and, asc, eq, inArray, isNotNull } from "drizzle-orm";
|
|
6
6
|
import { identitySchema, userSchema } from "@sentry/junior-plugin-api";
|