@sentry/junior 0.291.0 → 0.293.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-zphAlWE2.js → adapter-CMJfmHso.js} +1 -1
- package/dist/{admin-B3WR7Y6e.js → admin-uuecrKuD.js} +2 -2
- package/dist/{agent-runner-ke-hOiuv.js → agent-runner-DHq1pjUg.js} +283 -155
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +3 -3
- package/dist/api.d.ts +1 -1
- package/dist/api.js +43 -38
- package/dist/{app-C47PT68y.d.ts → app-fWzCHFIb.d.ts} +2 -2
- package/dist/app.d.ts +1 -1
- package/dist/app.js +422 -394
- package/dist/{assistant-reply-BV8SZaVd.js → assistant-reply-CIApSfor.js} +1 -1
- package/dist/{automation-CrsYnvdV.js → automation-BE3z19VN.js} +71 -22
- package/dist/{background-compaction-queue-QDH_JS3D.js → background-compaction-queue-D7ncdEa6.js} +4 -4
- package/dist/{briefs-Bdv9BG5J.js → briefs-NpgMEFh1.js} +2 -2
- package/dist/{catalog-runtime-yGnL9ywD.js → catalog-runtime-DwbTyNRD.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 +4 -4
- package/dist/cli/upgrade.d.ts +1 -1
- package/dist/cli/upgrade.js +4 -3
- package/dist/{config-UsaBOQgC.js → config-B4b-NXH5.js} +2 -2
- package/dist/{connections-CePSRCoR.js → connections-Dz_AQg5p.js} +6 -6
- package/dist/{conversation-pending-messages-Cd7ShwBs.js → conversation-pending-messages-1Kad1Mif.js} +4 -1
- package/dist/{conversation-privacy-B3wmawmz.js → conversation-privacy-DRsSgLGO.js} +1 -1
- package/dist/{credential-sync-LNRLXZCn.js → credential-sync-ClCnnGVj.js} +13 -13
- package/dist/{db-7glZCI18.d.ts → db-BbpttyKH.d.ts} +1 -1
- package/dist/{db-c__lw9GH.js → db-CoA7_Xqu.js} +3 -3
- package/dist/{executor-N8-D5Gvv.js → executor-SWyHhit0.js} +51 -15
- package/dist/instrumentation.js +2 -2
- package/dist/{logging-DbXHuhac.js → logging-BN5drSEZ.js} +1 -1
- package/dist/{message-D1MEh8iR.js → message-D4qjpW1C.js} +9 -9
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +2 -2
- package/dist/{oauth-callback-server-DUtqhYwP.js → oauth-callback-server-Xi-mTLOV.js} +2 -2
- package/dist/{projection-D7XadqRY.js → projection-DXl4ftyL.js} +140 -50
- package/dist/{prompt-CzEV4BF4.js → prompt-Dmx6IfWZ.js} +3 -3
- package/dist/{registry-CTtGtXZP.js → registry-DosVt9f9.js} +1 -1
- package/dist/{resolve-nUuQ8yyH.js → resolve-BDjWJC9s.js} +3 -3
- package/dist/{result-Cr9tUdfS.js → result-CaAFpf4B.js} +8 -8
- package/dist/{runner-D7NMbBim.js → runner-h96Mkss6.js} +7 -7
- package/dist/{sandbox-egress-signals-BJAyfzOD.js → sandbox-egress-signals-rK91BW7i.js} +1 -1
- package/dist/{schema-CC2RxDAV.d.ts → schema-CHsBmXIj.d.ts} +246 -45
- package/dist/{schema-CVV5r-qP.js → schema-C_v8wb80.js} +2 -2
- package/dist/{service-account-_ml5D4Tk.js → service-account-BpGpScaT.js} +3 -3
- package/dist/{service-account-CP1oBWTc.js → service-account-WUMVuqVL.js} +3 -3
- package/dist/{session-stop-BbsyIbK2.js → session-stop-xYK15HUu.js} +20 -41
- package/dist/{skills-CayJ8-Bj.js → skills-DHApyCjj.js} +10 -9
- package/dist/{spawn-CktAopv_.js → spawn-BQQrwGNe.js} +5 -5
- package/dist/{stop-BUzUJuN_.js → stop-CBeD6_Gs.js} +34 -28
- package/dist/{store-lotbeXq3.js → store-xtibD98L.js} +3 -3
- package/dist/{task-runner-BinM1l5g.js → task-runner-BYPN4BEO.js} +65 -90
- package/dist/{turn-failure-response-DH5nE6HJ.js → turn-failure-response-jNVl00MD.js} +7 -7
- package/dist/{validation-I0CqX5NC.js → validation-DGeB_moV.js} +1 -1
- package/dist/{version-C3sVz3bv.js → version-C6nqU3Qc.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-so1MPU10.js → viewer-9KLQibjn.js} +3 -3
- package/dist/{warmup-BH9HRBCI.js → warmup-7S6z068f.js} +56 -24
- package/dist/{work-Cw6Fzvfz.js → work-xwX6unUE.js} +11 -11
- package/dist/{worker-qEykG39-.js → worker-CiCCfwd4.js} +6 -6
- package/migrations/0095_web_linked_slack_identity_repair.sql +252 -0
- package/migrations/0096_automation_task_kind.sql +75 -0
- package/migrations/meta/0095_snapshot.json +4452 -0
- package/migrations/meta/0096_snapshot.json +4490 -0
- package/migrations/meta/_journal.json +14 -0
- package/package.json +5 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
2
|
-
import { t as disconnectStateAdapter } from "./adapter-
|
|
3
|
-
import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-
|
|
1
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-DwbTyNRD.js";
|
|
2
|
+
import { t as disconnectStateAdapter } from "./adapter-CMJfmHso.js";
|
|
3
|
+
import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-BpGpScaT.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,19 +1,19 @@
|
|
|
1
1
|
import { v as __exportAll } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import {
|
|
3
|
-
import { F as renderCurrentInstruction, L as escapeXml, R as escapeXmlText, n as botConfig } from "./config-
|
|
4
|
-
import { h as logWarn, m as logInfo, p as logException, v as serializeGenAiAttribute } from "./logging-
|
|
2
|
+
import { $i as postSlackMessage, Bn as getPluginSlackConversationLink, Cn as escapeTagText, Dn as renderUntrustedTag, En as renderTag$1, Gt as isPersonInput, Hi as formatSlackLink, Ja as sandboxSkillFile, Ka as SANDBOX_WORKSPACE_ROOT, M as normalizeConversationText, On as tagJson, Sn as escapeClosingTags, Tn as renderChildTag, Ua as SANDBOX_DATA_ROOT, Ui as normalizeSlackReplyMarkdown, Un as getPluginUserPromptContributions, Ur as cancelSubscriptions, Vi as escapeSlackMrkdwnText, Vn as getPluginSystemPromptContributions, Wn as getPlugins, Ya as sandboxSkillPathResolution, _n as stripRuntimeTurnContext, ai as verifyTimerWatchCredentialSubject, bn as SESSION_CONTEXT_SECTION_TAG, ci as getDashboardObjectIconLink, dr as getReviewItem, gn as retainRuntimeTurnContext, hn as normalizeToolNameFromResult, mi as ToolInputError, mn as isToolResultMessage, oi as JUNIOR_THREAD_STATE_TTL_MS, ot as getTurnRecord, pn as isToolResultError, qa as sandboxSkillDir, si as getDashboardConversationLink, sn as hasRuntimeTurnContext, st as listTurnSummaries, un as isAssistantMessage, x as toStoredConversationMessage, xi as listWorkspaces, xn as TURN_CONTEXT_TAG, yn as REQUEST_CONTEXT_SECTION_TAG, yo as buildSentryConversationUrl } from "./projection-DXl4ftyL.js";
|
|
3
|
+
import { F as renderCurrentInstruction, L as escapeXml, R as escapeXmlText, n as botConfig } from "./config-B4b-NXH5.js";
|
|
4
|
+
import { h as logWarn, m as logInfo, p as logException, v as serializeGenAiAttribute } from "./logging-BN5drSEZ.js";
|
|
5
5
|
import { o as isUserActor, t as createActor } from "./actor-6jsm_v96.js";
|
|
6
|
-
import { J as nextDetailVersion, T as SYSTEM_IDENTITY_ID, a as getConversationStore, o as getDb, r as getConversationEventStore, s as getSqlExecutor } from "./db-
|
|
7
|
-
import { A as juniorConversations, M as juniorUsers } from "./executor-
|
|
6
|
+
import { J as nextDetailVersion, T as SYSTEM_IDENTITY_ID, a as getConversationStore, o as getDb, r as getConversationEventStore, s as getSqlExecutor } from "./db-CoA7_Xqu.js";
|
|
7
|
+
import { A as juniorConversations, M as juniorUsers } from "./executor-SWyHhit0.js";
|
|
8
8
|
import { i as isVisionImageMediaType } from "./media-BepyEUNm.js";
|
|
9
9
|
import { a as listReferenceFiles, c as soulPathCandidates, l as worldPathCandidates } from "./package-discovery-DJhGdS4c.js";
|
|
10
|
-
import { h as credentialSubjectSchema } from "./registry-
|
|
11
|
-
import { a as EVENT_SYSTEM_ACTOR, d as JUNIOR_NATIVE_EVENT_NAMESPACE, h as conversationNoteEvent, i as EVENT_MESSAGE_AUTHOR, o as isEventConversationMessage, r as EVENT_AUTHOR_ID } from "./prompt-
|
|
12
|
-
import { r as getStateAdapter } from "./adapter-
|
|
13
|
-
import { i as NO_REPLY_TOOL_NAME, r as sanitizeAssistantText } from "./assistant-reply-
|
|
10
|
+
import { h as credentialSubjectSchema } from "./registry-DosVt9f9.js";
|
|
11
|
+
import { a as EVENT_SYSTEM_ACTOR, d as JUNIOR_NATIVE_EVENT_NAMESPACE, h as conversationNoteEvent, i as EVENT_MESSAGE_AUTHOR, o as isEventConversationMessage, r as EVENT_AUTHOR_ID } from "./prompt-Dmx6IfWZ.js";
|
|
12
|
+
import { r as getStateAdapter } from "./adapter-CMJfmHso.js";
|
|
13
|
+
import { i as NO_REPLY_TOOL_NAME, r as sanitizeAssistantText } from "./assistant-reply-CIApSfor.js";
|
|
14
14
|
import { D as userCustomizationTextSchema, v as formatUserInputAnswer } from "./reporting-window-B3Ze-Qnt.js";
|
|
15
|
-
import { r as appendAndEnqueueInboundMessage } from "./store-
|
|
16
|
-
import {
|
|
15
|
+
import { r as appendAndEnqueueInboundMessage } from "./store-xtibD98L.js";
|
|
16
|
+
import { _t as CORE_EVENT_NAMESPACE, bt as eventCatalogEntry, xt as eventGuidance } from "./task-runner-BYPN4BEO.js";
|
|
17
17
|
import path from "node:path";
|
|
18
18
|
import { isDeepStrictEqual } from "node:util";
|
|
19
19
|
import * as z from "zod";
|
|
@@ -46,25 +46,6 @@ const automationResultSchema = z.discriminatedUnion("result", [
|
|
|
46
46
|
})
|
|
47
47
|
]);
|
|
48
48
|
/**
|
|
49
|
-
* Return whether the runtime delivers the final response of a run. It
|
|
50
|
-
* does not for a dispatch with no outcomes. It does not for an Automation
|
|
51
|
-
* run, which posts only its declared message, after the run.
|
|
52
|
-
*/
|
|
53
|
-
function deliversFinalText(dispatch) {
|
|
54
|
-
return dispatch?.outcomes?.length !== 0 && !dispatch?.declaresResult;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Return whether the runtime may post a failure reply or a status notice,
|
|
58
|
-
* such as an auth prompt, for a run outside `finishedRunReply`. The rule is
|
|
59
|
-
* the same as for a final response. A chat Turn may post, also in a thread that an
|
|
60
|
-
* Automation Conversation owns. A dispatch with no outcomes posts nothing. An
|
|
61
|
-
* Automation run posts only a declared message; its failed execution shows on
|
|
62
|
-
* the Automation.
|
|
63
|
-
*/
|
|
64
|
-
function postsRunNotices(dispatch) {
|
|
65
|
-
return deliversFinalText(dispatch);
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
49
|
* Return the text to post after a run ends, if any. A chat Turn already
|
|
69
50
|
* delivered a successful reply, so it posts only its failure reply. An
|
|
70
51
|
* Automation run posts only a declared message. It never posts a failure
|
|
@@ -104,6 +85,7 @@ function runDispatchOutcome(result) {
|
|
|
104
85
|
};
|
|
105
86
|
return { outcome: "completed" };
|
|
106
87
|
}
|
|
88
|
+
/** Reminder for an Automation run that stopped without a declared result. */
|
|
107
89
|
const MISSING_RESULT_REMINDER = "This automation run has not ended. Your text was not delivered. Call `finishAutomationRun` now with one result.";
|
|
108
90
|
/**
|
|
109
91
|
* Return agent history plus a reminder when the model stopped without a
|
|
@@ -1232,10 +1214,9 @@ async function assemblePrompt(args) {
|
|
|
1232
1214
|
const trimmedPrompt = shouldPromptAgent ? withoutTrailingUncheckpointedUserPrompt(args.priorPiMessages, requestContentParts) : { messages: args.existingSessionPiMessages };
|
|
1233
1215
|
const promptHistoryMessages = trimmedPrompt.messages;
|
|
1234
1216
|
const needsBootstrapContextForPrompt = shouldPromptAgent && !replayedPrompt && !hasRuntimeTurnContext(promptHistoryMessages);
|
|
1235
|
-
const
|
|
1236
|
-
const platform = (args.run.delivery || promptMode === "automation") && args.run.location?.provider === "slack" ? "slack" : "local";
|
|
1217
|
+
const platform = (args.run.delivery || args.promptMode === "automation") && args.run.location?.provider === "slack" ? "slack" : "local";
|
|
1237
1218
|
const pluginSystemPrompt = buildPluginSystemPromptContributions(await getPluginSystemPromptContributions(platform));
|
|
1238
|
-
const baseInstructions = [buildSystemPrompt(platform, promptMode), pluginSystemPrompt].filter((section) => Boolean(section)).join("\n\n");
|
|
1219
|
+
const baseInstructions = [buildSystemPrompt(platform, args.promptMode), pluginSystemPrompt].filter((section) => Boolean(section)).join("\n\n");
|
|
1239
1220
|
const { conversationNotes, pluginUserPromptContributions, userCustomization, workspaces } = args.turnContext;
|
|
1240
1221
|
const disabledTools = loadsTurnContext ? args.disabledTools : [];
|
|
1241
1222
|
const turnContextPrompt = needsBootstrapContextForPrompt || pluginUserPromptContributions.length > 0 || (conversationNotes?.length ?? 0) > 0 || disabledTools.length > 0 || userCustomization ? buildTurnContextPrompt({
|
|
@@ -2012,8 +1993,8 @@ function externalTextTag(text, source) {
|
|
|
2012
1993
|
* The job comes before Event data. Empty optional fields are omitted.
|
|
2013
1994
|
*/
|
|
2014
1995
|
function renderTaskInput(args) {
|
|
2015
|
-
const instructions = args.instructions
|
|
2016
|
-
if (!instructions) throw new Error("Task instructions are required");
|
|
1996
|
+
const instructions = args.instructions?.trim() ?? "";
|
|
1997
|
+
if (!instructions && !args.skill) throw new Error("Task instructions are required");
|
|
2017
1998
|
const about = args.about?.trim();
|
|
2018
1999
|
const creator = args.creator?.trim();
|
|
2019
2000
|
const people = (args.people ?? []).map((person) => oneLine(person)).filter(Boolean);
|
|
@@ -2030,7 +2011,8 @@ function renderTaskInput(args) {
|
|
|
2030
2011
|
did: "did what this Event describes",
|
|
2031
2012
|
handles: args.doneBy.handle ? [oneLine(args.doneBy.handle)] : []
|
|
2032
2013
|
}] : []),
|
|
2033
|
-
|
|
2014
|
+
...args.skill ? [instructions ? `Run the ${args.skill} skill. The instructions below add context for this run.` : `Run the ${args.skill} skill.`] : [],
|
|
2015
|
+
...instructions ? [renderChildTag("instructions", escapeClosingTags(creator ? mentionCreator(instructions, oneLine(creator)) : instructions))] : [],
|
|
2034
2016
|
...guidance ? [guidanceTag(guidance)] : [],
|
|
2035
2017
|
...trustedSummary ? [renderChildTag("summary", escapeClosingTags(clip(trustedSummary, args.trustedSummaryMaxLength)))] : [],
|
|
2036
2018
|
...verifiedDetailsTag(args.verifiedDetails),
|
|
@@ -2901,7 +2883,7 @@ async function resumeStoppedConversationTree(conversationId, sentAtMs) {
|
|
|
2901
2883
|
*/
|
|
2902
2884
|
async function skipInputAfterConversationStop(context) {
|
|
2903
2885
|
const messages = context.attempt.messages;
|
|
2904
|
-
const personInput = messages.filter(isPersonInput);
|
|
2886
|
+
const personInput = messages.filter((message) => isPersonInput(message.source));
|
|
2905
2887
|
if (personInput.length > 0) {
|
|
2906
2888
|
await resumeStoppedConversationTree(context.conversationId, Math.max(...personInput.map((message) => message.createdAtMs)));
|
|
2907
2889
|
return { context };
|
|
@@ -2930,9 +2912,6 @@ async function skipInputAfterConversationStop(context) {
|
|
|
2930
2912
|
await context.attempt.ack();
|
|
2931
2913
|
return { skipped: { status: "completed" } };
|
|
2932
2914
|
}
|
|
2933
|
-
function isPersonInput(message) {
|
|
2934
|
-
return message.source === "web" || message.source === "slack";
|
|
2935
|
-
}
|
|
2936
2915
|
function isEventInput(message) {
|
|
2937
2916
|
return message.source === "event" && isEventMailboxMetadata(message.input.metadata);
|
|
2938
2917
|
}
|
|
@@ -2976,4 +2955,4 @@ async function saveStoppedConversationEvents(conversationId, messages) {
|
|
|
2976
2955
|
}
|
|
2977
2956
|
}]);
|
|
2978
2957
|
}
|
|
2979
|
-
export { withoutSavedSteeringMessages as $, requireSlackChannelMessageScope as A, maybePostAutomatedTurnLimitNotice as B, enqueueEventNotification as C, timerWatchCredentialSubject as D, renderEventBatchInputs as E, WORKSPACE_SNAPSHOT_FAILED_EVENT as F, admitAutomatedTurn as G, resolveSlackReplyTarget as H, WORKSPACE_SNAPSHOT_READY_EVENT as I, assemblePrompt as J, recordFinishedTurnForAutomatedLimit as K, workspaceSnapshotFinishedEvent as L, slackChannelMessageReplyThreadTs as M, slackChannelMessageRunsAutomation as N, getEventCatalog as O, slackChannelMessageTrigger as P, loadPromptTurnContext as Q, workspaceSnapshotWatch as R, EVENT_WAIT_MS as S, isEventMailboxMetadata as T, sendSlackReply as U, postAutomatedTurnLimitNoticeForConversation as V, renderSlackObjectCard as W, buildSteeringPiMessage as X, buildPromptInput as Y, instructionForInputs as Z, sourceFromTurnInput as _, session_stop_exports as a, addConversationNote as at, conversationSubtree as b, loadReviewItemInput as c, readBlockedReport as ct, getAuthPausedConversationTurnId as d,
|
|
2958
|
+
export { withoutSavedSteeringMessages as $, requireSlackChannelMessageScope as A, maybePostAutomatedTurnLimitNotice as B, enqueueEventNotification as C, timerWatchCredentialSubject as D, renderEventBatchInputs as E, WORKSPACE_SNAPSHOT_FAILED_EVENT as F, admitAutomatedTurn as G, resolveSlackReplyTarget as H, WORKSPACE_SNAPSHOT_READY_EVENT as I, assemblePrompt as J, recordFinishedTurnForAutomatedLimit as K, workspaceSnapshotFinishedEvent as L, slackChannelMessageReplyThreadTs as M, slackChannelMessageRunsAutomation as N, getEventCatalog as O, slackChannelMessageTrigger as P, loadPromptTurnContext as Q, workspaceSnapshotWatch as R, EVENT_WAIT_MS as S, isEventMailboxMetadata as T, sendSlackReply as U, postAutomatedTurnLimitNoticeForConversation as V, renderSlackObjectCard as W, buildSteeringPiMessage as X, buildPromptInput as Y, instructionForInputs as Z, sourceFromTurnInput as _, session_stop_exports as a, addConversationNote as at, conversationSubtree as b, loadReviewItemInput as c, readBlockedReport as ct, getAuthPausedConversationTurnId as d, finishedRunReply as dt, readUserCustomization as et, getEventBatchDelayMs as f, readAutomationResult as ft, resolveMailboxTurnWork as g, parseWebMessages as h, resumeStoppedConversationTree as i, setExperimentalFeatures as it, slackChannelMessageEvent as j, SLACK_EVENT_NAMESPACE as k, savedInputInstruction as l, FINISH_AUTOMATION_RUN_TOOL_NAME as lt, parseEventMessages as m, runDispatchOutcome as mt, isWatchEvent as n, getExperimentalFeatures as nt, skipInputAfterConversationStop as o, JUNIOR_PERSONALITY as ot, listActiveMailboxTurns as p, remindMissingAutomationResult as pt, resetAutomatedTurnLimit as q, markConversationsStopped as r, isExperimentalFeatureEnabled as rt, eventReviewItemInputs as s, REPORT_BLOCKED_TOOL_NAME as st, getConversationStoppedAtMs as t, saveUserCustomization as tt, getActiveConversationTurnId as u, automationResultSchema as ut, turnInputFactsFromConversationMessage as v, eventBatchMessageMeta as w, conversationSubtreeColumns as x, legacyWebMailboxMetadataSchema as y, renderTaskInput as z };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { v as __exportAll } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import { h as logWarn } from "./logging-
|
|
2
|
+
import { h as logWarn } from "./logging-BN5drSEZ.js";
|
|
3
3
|
import { s as skillRoots } from "./package-discovery-DJhGdS4c.js";
|
|
4
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
4
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-DwbTyNRD.js";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import * as z from "zod";
|
|
7
7
|
import fs from "node:fs/promises";
|
|
@@ -258,22 +258,23 @@ function isCommonEnvironmentVariable(name) {
|
|
|
258
258
|
"XDG_CONFIG_HOME"
|
|
259
259
|
].includes(name.toUpperCase());
|
|
260
260
|
}
|
|
261
|
-
/**
|
|
261
|
+
/**
|
|
262
|
+
* Extract an explicit skill invocation from a user message. `$name` is the
|
|
263
|
+
* canonical form; `/name` still works for older messages and automations.
|
|
264
|
+
*/
|
|
262
265
|
function parseSkillInvocation(messageText, availableSkills) {
|
|
263
266
|
const trimmed = messageText.trim();
|
|
264
267
|
const escapePattern = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
265
|
-
const slashMatch = /(?:^|\s)\/([a-z0-9]+(?:-[a-z0-9]+)*)/i.exec(trimmed);
|
|
266
|
-
if (slashMatch?.[1]) {
|
|
267
|
-
const skillName = slashMatch[1].toLowerCase();
|
|
268
|
-
if (!availableSkills.some((skill) => skill.name === skillName)) return null;
|
|
269
|
-
return { skillName };
|
|
270
|
-
}
|
|
271
268
|
for (const match of trimmed.matchAll(/(?:^|\s)\$([a-z0-9]+(?:-[a-z0-9]+)*)/gi)) {
|
|
272
269
|
const skillName = match[1]?.toLowerCase();
|
|
273
270
|
if (!skillName) continue;
|
|
274
271
|
if (isCommonEnvironmentVariable(skillName)) continue;
|
|
275
272
|
if (availableSkills.some((skill) => skill.name === skillName)) return { skillName };
|
|
276
273
|
}
|
|
274
|
+
for (const match of trimmed.matchAll(/(?:^|\s)\/([a-z0-9]+(?:-[a-z0-9]+)*)(?![a-z0-9/-])/gi)) {
|
|
275
|
+
const skillName = match[1]?.toLowerCase();
|
|
276
|
+
if (skillName && availableSkills.some((skill) => skill.name === skillName)) return { skillName };
|
|
277
|
+
}
|
|
277
278
|
const namedSkill = availableSkills.find((skill) => {
|
|
278
279
|
if (skill.disableModelInvocation !== true) return false;
|
|
279
280
|
const skillPattern = escapePattern(skill.name);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { v as __exportAll } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import { n as botConfig } from "./config-
|
|
3
|
-
import { o as getDb, x as conversationKindFromRow } from "./db-
|
|
4
|
-
import { A as juniorConversations } from "./executor-
|
|
5
|
-
import {
|
|
6
|
-
import { n as createAndEnqueueAgentInvocation } from "./work-
|
|
2
|
+
import { n as botConfig } from "./config-B4b-NXH5.js";
|
|
3
|
+
import { o as getDb, x as conversationKindFromRow } from "./db-CoA7_Xqu.js";
|
|
4
|
+
import { A as juniorConversations } from "./executor-SWyHhit0.js";
|
|
5
|
+
import { en as AgentDepthLimitError, hn as toolInvocationDestination, mn as actorFromRun } from "./agent-runner-DHq1pjUg.js";
|
|
6
|
+
import { n as createAndEnqueueAgentInvocation } from "./work-xwX6unUE.js";
|
|
7
7
|
import { desc, eq, sql } from "drizzle-orm";
|
|
8
8
|
// src/chat/conversations/lineage.ts
|
|
9
9
|
/**
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import { h as startSpan } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import { $ as loadTurnCheckpoint, $
|
|
3
|
-
import { A as estimateTextTokens, E as resolveGatewayModel, L as escapeXml, W as isProviderRetryError, c as getSlackClientSecret, i as getChatConfig, j as textCharsForTokens, l as getSlackSigningSecret, n as botConfig, o as getSlackBotToken, s as getSlackClientId, v as normalizeSlackEmojiName } from "./config-
|
|
4
|
-
import { E as withSpan, G as isRecord, K as toOptionalNumber, 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 toOptionalString, s as getActiveTraceId, t as buildTurnFailureResponse, y as setSentryUser } from "./logging-
|
|
5
|
-
import { t as JUNIOR_VERSION } from "./version-
|
|
2
|
+
import { $ as loadTurnCheckpoint, $i as postSlackMessage, A as latestConversationMessageSeq, An as createUserTokenStore, Ao as listConversationAnnotations, Bo as piMessageFromHistoryItem, Cr as canUserReadReviewItem, D as estimateConversationMessagesTokens, E as buildConversationContext, Eo as slackAttachmentsVersionQuery, F as turnHasReply, Fo as lookupSlackUserNames, H as PluginCredentialFailureError, Hi as formatSlackLink, I as upsertConversationMessage, Io as createPluginCache, Ji as deleteSlackMessage, K as AuthorizationFlowDisabledError, Ki as truncateStatusText, Kt as postsRunNotices, M as normalizeConversationText, Mn as webActorUserIds, N as recordDeliveredAssistantMessage, Nt as moveIdleConversationDestination, O as getConversationMessageSlackTs, Or as reviewItemNeedsSomeone, P as trimConversationMessages, Po as lookupSlackUser, Qt as buildTurnErrorResponse, Ro as configValueSchema, Rt as releaseInboundMessage, S as resolveConversationTitle, So as getSlackFileId, To as recordSlackAttachment, Ur as cancelSubscriptions, Vi as escapeSlackMrkdwnText, Wi as normalizeSlackStatusText, Wn as getPlugins, Wt as deliversFinalText, X as clearPendingAuth, Yi as getSlackMessagePermalink, _r as takeReviewItem, a as loadProjection, ao as conversationHasParticipantUser, at as failTurnRecord, b as persistConversationMessages, br as canActOnReviewItem, co as conversationPinnedForUser, ct as recordTurnSummary, d as recordAuthorizationCompleted, dr as getReviewItem, ea as removeReactionFromMessage, eo as createPluginLogger, et as lostWorkerBeforeFirstSave, fa as isDmChannel, go as readConversationEventPageAround, h as recordSubscribedReplyRoute, ha as withSlackRetries, ho as readConversationEventPageAfter, i as loadConversationProjection, io as readConversationAccessFromSql, it as completeTurnRecord, j as markConversationMessage, jo as listConversationAnnotationsById, k as isHumanConversationMessage, la as getHeaderString, lo as conversationViewerMarks, mo as readConversationEventPage, mr as listWaitingConversations, n as commitMessages, nn as persistWithRetry, no as canAddConversationMessages, nt as saveTurnCheckpoint, o as loadTurnProjection, oa as SlackActionError, oo as conversationIsMemberRoot, ot as getTurnRecord, pa as normalizeSlackConversationId, po as readLatestConversationBrief, pr as listReplyActionItems, qi as addReactionToMessage, ro as createConversationAccessReader, rt as abandonTurnRecord, sa as downloadPrivateSlackFile, si as getDashboardConversationLink, so as conversationIsNotUnsubscribedRoot, sr as closeReviewItem, st as listTurnSummaries, t as commitAcceptedReply, tt as pauseLostWorkerTurn, ua as getSlackClient, uo as viewerMarksFromParticipant, v as hydrateConversationMessages, vn as trimTrailingAssistantMessages, w as fallbackShortTitle, wo as readAttachmentVisionSummary, wr as isOnlyAssignee, xo as notInheritedByForkChild, y as persistConversationMessageWindow, yo as buildSentryConversationUrl } from "./projection-DXl4ftyL.js";
|
|
3
|
+
import { A as estimateTextTokens, E as resolveGatewayModel, L as escapeXml, W as isProviderRetryError, c as getSlackClientSecret, i as getChatConfig, j as textCharsForTokens, l as getSlackSigningSecret, n as botConfig, o as getSlackBotToken, s as getSlackClientId, v as normalizeSlackEmojiName } from "./config-B4b-NXH5.js";
|
|
4
|
+
import { E as withSpan, G as isRecord, K as toOptionalNumber, 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 toOptionalString, s as getActiveTraceId, t as buildTurnFailureResponse, y as setSentryUser } from "./logging-BN5drSEZ.js";
|
|
5
|
+
import { t as JUNIOR_VERSION } from "./version-C6nqU3Qc.js";
|
|
6
6
|
import { f as parseSlackTeamId, h as parseSlackMessageTs, i as isActorUserId, n as createSlackActor, o as isUserActor, r as createSlackResumeActor, s as parseActorUserId, t as createActor, u as parseSlackChannelId } from "./actor-6jsm_v96.js";
|
|
7
|
-
import { B as addAgentTurnUsage, C as setFirstConversationLocation, D as resolveActorIdentityId, G as resolveRootConversationId, J as nextDetailVersion, L as claimProviderConversation, O as saveActorAvatar, Q as requireSlackDestination, R as getConversationIdByProviderConversation, S as locationFromRow, U as agentTurnUsageSchema, W as hasAgentTurnUsage, X as createSlackDestination, _ as setArchivedAt, a as getConversationStore, b as withConversationMutationLock, g as readConversationTrees, m as conversationAncestors, o as getDb, p as withConversationEventLock, r as getConversationEventStore, s as getSqlExecutor, v as loadConversationSlackTenantIds, x as conversationKindFromRow, z as parseSessionSource } from "./db-
|
|
8
|
-
import { A as juniorConversations, D as juniorCodeChanges, E as juniorConversationAnnotations, M as juniorUsers, N as juniorDestinations, _ as juniorConversationReadPositions, b as juniorConversationBriefs, j as juniorIdentities, l as juniorReviewItems, s as juniorReviewItemConversations, v as juniorConversationParticipants, w as juniorConversationEvents } from "./executor-
|
|
7
|
+
import { B as addAgentTurnUsage, C as setFirstConversationLocation, D as resolveActorIdentityId, G as resolveRootConversationId, J as nextDetailVersion, L as claimProviderConversation, O as saveActorAvatar, Q as requireSlackDestination, R as getConversationIdByProviderConversation, S as locationFromRow, U as agentTurnUsageSchema, W as hasAgentTurnUsage, X as createSlackDestination, _ as setArchivedAt, a as getConversationStore, b as withConversationMutationLock, g as readConversationTrees, m as conversationAncestors, o as getDb, p as withConversationEventLock, r as getConversationEventStore, s as getSqlExecutor, v as loadConversationSlackTenantIds, x as conversationKindFromRow, z as parseSessionSource } from "./db-CoA7_Xqu.js";
|
|
8
|
+
import { A as juniorConversations, D as juniorCodeChanges, E as juniorConversationAnnotations, M as juniorUsers, N as juniorDestinations, _ as juniorConversationReadPositions, b as juniorConversationBriefs, j as juniorIdentities, l as juniorReviewItems, s as juniorReviewItemConversations, v as juniorConversationParticipants, w as juniorConversationEvents } from "./executor-SWyHhit0.js";
|
|
9
9
|
import { _ as instructionProvenanceFor, a as KNOWN_CONVERSATION_EVENT_TYPES, h as contextProvenance, i as isVisionImageMediaType, r as detectImageMediaType } from "./media-BepyEUNm.js";
|
|
10
|
-
import { d as actorLogContext, f as credentialContextForActor } from "./registry-
|
|
11
|
-
import { A as runWithSlackInstallation, At as cancelSignInWait, B as listThreadReplies, Bt as canShareTurn, Dt as stopChildAgentsOf, Et as stopChildAgentsBelow, F as resolveSlackChannelIdFromThreadId, Ft as getPausedTurnRequest, I as checkSlackChannelReadAccess, Jt as withTurnSpan, Kt as getTurnInputSpanAttributes, L as joinPublicChannelForRead, Lt as wakePausedTurn, M as parseSlackThreadId, N as readSlackRawMessageContext, Nt as supersedeTurnForInput, P as resolveSlackChannelIdFromMessage, Pt as createPausedTurns, R as getConversationInfo, Rt as getTurnAuthorization, S as createSlackReviewItemShow, St as markConversationRead, Tt as throwApiError, Ut as AgentRunError, V as resolveDestinationVisibility, Wt as executeTurn, X as readConversationSourceTask, Xt as getWebAuthorization, Zt as canPauseConversationDelivery, at as deliverReviewItemChange, b as renderAttachmentText, ct as acceptsWebMessages, dt as createAndEnqueueConversation, ft as createConversationId, ht as decodeInputImages, i as buildAuthPauseResponse, jt as createConversationTurnWorker, lt as appendAndEnqueueWebMessage, mt as webActorFromUser, n as executeAgentRun, p as latestProgressStatus, pn as
|
|
12
|
-
import { a as EVENT_SYSTEM_ACTOR, c as completeDecision, o as isEventConversationMessage, u as completeText } from "./prompt-
|
|
10
|
+
import { d as actorLogContext, f as credentialContextForActor } from "./registry-DosVt9f9.js";
|
|
11
|
+
import { A as runWithSlackInstallation, At as cancelSignInWait, B as listThreadReplies, Bt as canShareTurn, Dt as stopChildAgentsOf, Et as stopChildAgentsBelow, F as resolveSlackChannelIdFromThreadId, Ft as getPausedTurnRequest, I as checkSlackChannelReadAccess, Jt as withTurnSpan, Kt as getTurnInputSpanAttributes, L as joinPublicChannelForRead, Lt as wakePausedTurn, M as parseSlackThreadId, N as readSlackRawMessageContext, Nt as supersedeTurnForInput, P as resolveSlackChannelIdFromMessage, Pt as createPausedTurns, R as getConversationInfo, Rt as getTurnAuthorization, S as createSlackReviewItemShow, St as markConversationRead, Tt as throwApiError, Ut as AgentRunError, V as resolveDestinationVisibility, Wt as executeTurn, X as readConversationSourceTask, Xt as getWebAuthorization, Zt as canPauseConversationDelivery, at as deliverReviewItemChange, b as renderAttachmentText, ct as acceptsWebMessages, dt as createAndEnqueueConversation, ft as createConversationId, gn as shouldEmitDevAgentTrace, ht as decodeInputImages, i as buildAuthPauseResponse, jt as createConversationTurnWorker, lt as appendAndEnqueueWebMessage, mt as webActorFromUser, n as executeAgentRun, on as listedConversation, p as latestProgressStatus, pn as RetryableDeliveryError, pt as recordWebConversationActivity, qt as turnInputTelemetry, t as createAgentRunner, x as renderBlockText, xt as conversationReadPositionQuery, yt as storeAttachment, zt as canJoinTurn } from "./agent-runner-DHq1pjUg.js";
|
|
12
|
+
import { a as EVENT_SYSTEM_ACTOR, c as completeDecision, o as isEventConversationMessage, u as completeText } from "./prompt-Dmx6IfWZ.js";
|
|
13
13
|
import { r as acquireActiveLock } from "./locks-D-0h111u.js";
|
|
14
|
-
import { f as identityAvatarUrl, h as readUserAvatarUrls } from "./viewer-
|
|
15
|
-
import { a as setStateValues, i as getStateValues, r as getStateAdapter } from "./adapter-
|
|
14
|
+
import { f as identityAvatarUrl, h as readUserAvatarUrls } from "./viewer-9KLQibjn.js";
|
|
15
|
+
import { a as setStateValues, i as getStateValues, r as getStateAdapter } from "./adapter-CMJfmHso.js";
|
|
16
16
|
import { W as readMessageAttachments, d as conversationEventPageSchema, l as conversationDetailReportSchema, m as conversationFeedSchema } from "./conversation-CtjR1Zcx.js";
|
|
17
|
-
import { c as listConversationWork, l as readLastUserMessageAtByConversation, s as isConversationWorkDone } from "./warmup-
|
|
18
|
-
import { g as getVercelConversationWorkQueue, k as getTurnRequestDeadline } from "./background-compaction-queue-
|
|
19
|
-
import { a as persistAuthPauseTurnState, at as getConversationTurnBoundaryError, b as getChildAgentLabel, c as getTurnUserSlackMessageTs, ct as isTurnInputDeferredError, d as loadThreadContextTrimFloor, dt as markTurnFailed, ft as startActiveTurn, i as completeAuthPauseTurn, it as TurnInputDeferredError, l as buildDeliveredTurnStatePatch, lt as markTurnClosed, m as loadPendingMessageCards, mt as buildDeterministicTurnId, n as getAgentTurnDiagnosticsAttributes, nt as CooperativeTurnYieldError, o as getTurnUserMessage, ot as isCooperativeTurnYieldError, p as getTurnLifecycle, pt as buildDeterministicAssistantMessageId, r as requireTurnFailureEventId, rt as TurnInputCommitLostError, s as getTurnUserReplyAttachmentContext, st as isTurnInputCommitLostError, t as finalizeFailedTurnReplyWithEvent, tt as ConversationTurnBoundaryError, u as buildTurnThreadContext, ut as markTurnCompleted } from "./turn-failure-response-
|
|
20
|
-
import { n as getAssistantReplyText } from "./assistant-reply-
|
|
21
|
-
import { $ as withoutSavedSteeringMessages, B as maybePostAutomatedTurnLimitNotice, H as resolveSlackReplyTarget, K as recordFinishedTurnForAutomatedLimit, U as sendSlackReply, X as buildSteeringPiMessage, b as conversationSubtree, c as loadReviewItemInput, dt as
|
|
17
|
+
import { c as listConversationWork, l as readLastUserMessageAtByConversation, s as isConversationWorkDone } from "./warmup-7S6z068f.js";
|
|
18
|
+
import { g as getVercelConversationWorkQueue, k as getTurnRequestDeadline } from "./background-compaction-queue-D7ncdEa6.js";
|
|
19
|
+
import { a as persistAuthPauseTurnState, at as getConversationTurnBoundaryError, b as getChildAgentLabel, c as getTurnUserSlackMessageTs, ct as isTurnInputDeferredError, d as loadThreadContextTrimFloor, dt as markTurnFailed, ft as startActiveTurn, i as completeAuthPauseTurn, it as TurnInputDeferredError, l as buildDeliveredTurnStatePatch, lt as markTurnClosed, m as loadPendingMessageCards, mt as buildDeterministicTurnId, n as getAgentTurnDiagnosticsAttributes, nt as CooperativeTurnYieldError, o as getTurnUserMessage, ot as isCooperativeTurnYieldError, p as getTurnLifecycle, pt as buildDeterministicAssistantMessageId, r as requireTurnFailureEventId, rt as TurnInputCommitLostError, s as getTurnUserReplyAttachmentContext, st as isTurnInputCommitLostError, t as finalizeFailedTurnReplyWithEvent, tt as ConversationTurnBoundaryError, u as buildTurnThreadContext, ut as markTurnCompleted } from "./turn-failure-response-jNVl00MD.js";
|
|
20
|
+
import { n as getAssistantReplyText } from "./assistant-reply-CIApSfor.js";
|
|
21
|
+
import { $ as withoutSavedSteeringMessages, B as maybePostAutomatedTurnLimitNotice, H as resolveSlackReplyTarget, K as recordFinishedTurnForAutomatedLimit, U as sendSlackReply, X as buildSteeringPiMessage, b as conversationSubtree, c as loadReviewItemInput, dt as finishedRunReply, g as resolveMailboxTurnWork, l as savedInputInstruction, mt as runDispatchOutcome, o as skipInputAfterConversationStop, r as markConversationsStopped, rt as isExperimentalFeatureEnabled, x as conversationSubtreeColumns, y as legacyWebMailboxMetadataSchema } from "./session-stop-xYK15HUu.js";
|
|
22
22
|
import { b as normalizeUserInputAnswer, p as webMessageId, y as isEmptyUserInputAnswer } from "./reporting-window-B3Ze-Qnt.js";
|
|
23
|
-
import { T as stopConversationWork, a as cancelHumanFacingPendingMessages, g as getConversationWorkState, h as getConversation, m as ensureConversationWake, r as appendAndEnqueueInboundMessage, s as claimInboundMessage, w as steerWebPendingMessages } from "./store-
|
|
24
|
-
import { _ as markDispatchBlocked,
|
|
25
|
-
import { d as healthReportSchema, s as conversationPendingMessagesReportSchema } from "./conversation-pending-messages-
|
|
26
|
-
import { r as endActiveAgentInvocations, s as resolveThreadTurnWork } from "./work-
|
|
27
|
-
import { a as withAgentInvocationResultActors, n as enqueueAgentInvocationResult, t as createChildConversationWorker } from "./result-
|
|
28
|
-
import { t as bindMessageAgent } from "./message-
|
|
29
|
-
import { r as readConversationLineage, t as bindSpawnAgent } from "./spawn-
|
|
23
|
+
import { T as stopConversationWork, a as cancelHumanFacingPendingMessages, g as getConversationWorkState, h as getConversation, m as ensureConversationWake, r as appendAndEnqueueInboundMessage, s as claimInboundMessage, w as steerWebPendingMessages } from "./store-xtibD98L.js";
|
|
24
|
+
import { _ as markDispatchBlocked, a as claimDispatchMailboxAppend, at as readAutomationTitlesByConversationId, b as markDispatchRunning, c as getDispatchConversationId, d as getDispatchRecord, dt as getLocationConfigurationService, f as getDispatchTurnId, ft as getPersistedSandboxState, g as markDispatchAwaitingResume, gt as coerceThreadConversationState, ht as persistThreadStateById, lt as resolveConversationRouting, m as isTerminalDispatchStatus, mt as persistThreadRuntimeState, n as scheduleSessionCompletedPluginTasks, o as confirmDispatchMailboxAppend, pt as getPersistedThreadState, u as getDispatchInputMessageId, ut as resolveTurnSessionRouting, v as markDispatchCompleted, y as markDispatchFailed } from "./task-runner-BYPN4BEO.js";
|
|
25
|
+
import { d as healthReportSchema, s as conversationPendingMessagesReportSchema } from "./conversation-pending-messages-1Kad1Mif.js";
|
|
26
|
+
import { r as endActiveAgentInvocations, s as resolveThreadTurnWork } from "./work-xwX6unUE.js";
|
|
27
|
+
import { a as withAgentInvocationResultActors, n as enqueueAgentInvocationResult, t as createChildConversationWorker } from "./result-CaAFpf4B.js";
|
|
28
|
+
import { t as bindMessageAgent } from "./message-D4qjpW1C.js";
|
|
29
|
+
import { r as readConversationLineage, t as bindSpawnAgent } from "./spawn-BQQrwGNe.js";
|
|
30
30
|
import { createHash, createHmac, timingSafeEqual } from "node:crypto";
|
|
31
31
|
import * as z from "zod";
|
|
32
32
|
import { and, asc, desc, eq, gt, inArray, isNotNull, isNull, lte, max, ne, or, sql } from "drizzle-orm";
|
|
@@ -67,6 +67,7 @@ function buildDispatchRoutingContext(dispatch) {
|
|
|
67
67
|
plugin: dispatch.plugin,
|
|
68
68
|
replyAttribution: dispatch.replyAttribution,
|
|
69
69
|
outcomes: dispatch.outcomes,
|
|
70
|
+
...dispatch.skill ? { skill: dispatch.skill } : void 0,
|
|
70
71
|
...dispatch.source.kind === "scheduled_automation" || dispatch.source.kind === "event_automation" ? { declaresResult: true } : void 0
|
|
71
72
|
},
|
|
72
73
|
surface: "api"
|
|
@@ -9440,7 +9441,7 @@ async function conversationRows(db, { codeRepository, conversationIds, filter, i
|
|
|
9440
9441
|
return db.select({
|
|
9441
9442
|
...conversationRecordColumns,
|
|
9442
9443
|
awaitingAuthorization: treeAwaitsAuthorization(juniorConversations.conversationId)
|
|
9443
|
-
}).from(juniorConversations).leftJoin(juniorDestinations, conversationRecordJoins.location).leftJoin(juniorIdentities, conversationRecordJoins.identity).leftJoin(juniorUsers, conversationRecordJoins.user).where(and(
|
|
9444
|
+
}).from(juniorConversations).leftJoin(juniorDestinations, conversationRecordJoins.location).leftJoin(juniorIdentities, conversationRecordJoins.identity).leftJoin(juniorUsers, conversationRecordJoins.user).where(and(listedConversation(), conversationFeedMembershipFilter(status, filter), conversationIds ? inArray(juniorConversations.conversationId, conversationIds) : void 0, codeRepository ? conversationCodeRepositoryFilter(codeRepository.id, codeRepository.viewerUserId) : void 0, query ? or(sql`strpos(lower(coalesce(${juniorConversations.title}, '')), ${query}) > 0`, sql`exists (
|
|
9444
9445
|
select 1
|
|
9445
9446
|
from ${juniorConversationBriefs}
|
|
9446
9447
|
where ${juniorConversationBriefs.conversationId} = ${juniorConversations.conversationId}
|
|
@@ -9485,8 +9486,10 @@ const feedAnnotated = alias(juniorConversations, "feed_annotated");
|
|
|
9485
9486
|
* dashboard can record which inputs moved it.
|
|
9486
9487
|
*
|
|
9487
9488
|
* The token holds only what a feed row shows, so a Task's own writes do not
|
|
9488
|
-
* move it. Every Event of a live Turn moves `last_activity_at`, but
|
|
9489
|
-
*
|
|
9489
|
+
* move it. Every Event of a live Turn moves `last_activity_at`, but a
|
|
9490
|
+
* running row shows its running state in place of the age, so the token
|
|
9491
|
+
* holds no activity for it. Other rows show an age in whole minutes, so the
|
|
9492
|
+
* token holds its minute. The end of the Turn moves the status.
|
|
9490
9493
|
* The rows are in feed order, so a move that reorders them moves the token.
|
|
9491
9494
|
* The newest Message of each role stands for the preview and participants.
|
|
9492
9495
|
* The row shows only whether a reply is unread, so a scroll that moves the
|
|
@@ -9518,13 +9521,16 @@ function conversationFeedVersionQuery(db, userId) {
|
|
|
9518
9521
|
pinPosition: pin.pinPosition,
|
|
9519
9522
|
stoppedAt: juniorConversations.stoppedAt,
|
|
9520
9523
|
title: juniorConversations.title,
|
|
9521
|
-
activity:
|
|
9524
|
+
activity: sql`case
|
|
9525
|
+
when ${juniorConversations.executionStatus} in ('idle', 'failed')
|
|
9526
|
+
then ${shownActivityMinute(juniorConversations.lastActivityAt)}
|
|
9527
|
+
end`.as("activity"),
|
|
9522
9528
|
assistantSeq: sql`(${latestMessageSeqQuery(db, "assistant", conversationId)})`.as("assistant_seq"),
|
|
9523
9529
|
userSeq: sql`(${latestMessageSeqQuery(db, "user", conversationId)})`.as("user_seq"),
|
|
9524
9530
|
unread: unreadReplySql(db, userId, conversationId, read.lastReadSeq).as("unread"),
|
|
9525
9531
|
threads: sql`(${tree})`.as("threads"),
|
|
9526
9532
|
annotations: sql`(${annotations})`.as("annotations")
|
|
9527
|
-
}).from(juniorConversations).leftJoin(pin, and(eq(pin.rootConversationId, conversationId), eq(pin.userId, userId))).leftJoin(read, and(eq(read.conversationId, conversationId), eq(read.userId, userId))).where(and(
|
|
9533
|
+
}).from(juniorConversations).leftJoin(pin, and(eq(pin.rootConversationId, conversationId), eq(pin.userId, userId))).leftJoin(read, and(eq(read.conversationId, conversationId), eq(read.userId, userId))).where(and(listedConversation(), conversationFeedMembershipFilter("active", {
|
|
9528
9534
|
kind: "viewer",
|
|
9529
9535
|
userId
|
|
9530
9536
|
}))).orderBy(desc(isNotNull(pin.pinnedAt)), desc(juniorConversations.lastActivityAt), asc(conversationId)).limit(CONVERSATION_FEED_LIMIT).as("feed_page");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Bt as requestConversationWork$1, Ct as deadLetterAttempt$1, Et as getConversationWorkState$1, Ft as recordAttemptFailure$1, Ht as steerWebPendingMessages$1, It as recordConversationRetry$1, Lt as releaseConversationWork$1, Mt as markConversationWorkEnqueued$1, Ot as hasRunnableConversationWork, Rt as releaseInboundMessage, Tt as getConversation$1, Ut as stopConversationWork$1, Vt as startConversationWork$1, _t as claimInboundMessage$1, bt as completeConversationStop$1, dt as ackMessages$1, ft as appendExclusiveInboundMessage, gt as checkInConversationWork$1, ht as cancelHumanFacingPendingMessages$1, jt as listActiveConversationIds$1, mt as beginConversationResume$1, pt as appendInboundMessage, vt as clearConsumedConversationWake$1, wt as drainConversationMailbox$1, xt as completeConversationWork$1, yt as clearExpiredConversationLease$1, zt as requestAnotherSlice$1 } from "./projection-
|
|
2
|
-
import { a as getConversationStore } from "./db-
|
|
3
|
-
import "./background-compaction-queue-
|
|
1
|
+
import { Bt as requestConversationWork$1, Ct as deadLetterAttempt$1, Et as getConversationWorkState$1, Ft as recordAttemptFailure$1, Ht as steerWebPendingMessages$1, It as recordConversationRetry$1, Lt as releaseConversationWork$1, Mt as markConversationWorkEnqueued$1, Ot as hasRunnableConversationWork, Rt as releaseInboundMessage, Tt as getConversation$1, Ut as stopConversationWork$1, Vt as startConversationWork$1, _t as claimInboundMessage$1, bt as completeConversationStop$1, dt as ackMessages$1, ft as appendExclusiveInboundMessage, gt as checkInConversationWork$1, ht as cancelHumanFacingPendingMessages$1, jt as listActiveConversationIds$1, mt as beginConversationResume$1, pt as appendInboundMessage, vt as clearConsumedConversationWake$1, wt as drainConversationMailbox$1, xt as completeConversationWork$1, yt as clearExpiredConversationLease$1, zt as requestAnotherSlice$1 } from "./projection-DXl4ftyL.js";
|
|
2
|
+
import { a as getConversationStore } from "./db-CoA7_Xqu.js";
|
|
3
|
+
import "./background-compaction-queue-D7ncdEa6.js";
|
|
4
4
|
// src/chat/task-execution/store.ts
|
|
5
5
|
function metadataStore(options) {
|
|
6
6
|
return options.conversationStore ?? getConversationStore();
|