@sentry/junior 0.315.0 → 0.317.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{admin-5jUYY46p.js → admin-CAugg87B.js} +1 -1
- package/dist/{agent-runner-C7GNLRB6.js → agent-runner-AjrEV6Qe.js} +13532 -12811
- package/dist/{reporting-window-C4dbzDiR.js → agent-status-BA5x3Xtp.js} +33 -1
- package/dist/{agent-update-delivery-BNEYQsAf.js → agent-update-delivery-B_YIZcgf.js} +10 -37
- package/dist/api/schema.d.ts +609 -104
- package/dist/api/schema.js +6 -6
- package/dist/api.js +373 -469
- package/dist/{app-D_bAXRDe.d.ts → app-MoNAsVV5.d.ts} +52 -28
- package/dist/app.d.ts +1 -1
- package/dist/app.js +177 -132
- package/dist/catalog-runtime-DfSpJZdY.js +6 -0
- package/dist/{change-record-Bqsa5ZXE.d.ts → change-record-BzJgLsv7.d.ts} +60 -1
- package/dist/{adapter-context-BlSGE44V.js → channel-access-j-YAVYK4.js} +2 -42
- package/dist/{chat-core-engine-CxkwRpn9.js → chat-core-engine-aH85nEHv.js} +4 -3
- package/dist/{child-message--2G3Ft26.js → child-message-DHjQLEd1.js} +1 -1
- package/dist/cli/chat.js +23 -23
- package/dist/cli/check.js +5 -5
- package/dist/cli/main.js +2 -2
- package/dist/cli/plugins.js +5 -4
- package/dist/cli/snapshot-create.js +5 -2
- package/dist/cli/upgrade.js +27 -5
- package/dist/config-CHQ8X251.js +2422 -0
- package/dist/{continue-in-slack-BGKjIdFp.js → continue-in-slack-D-FZ8Fin.js} +2 -3
- package/dist/{conversation-feed-Sl8lKKmR.js → conversation-feed--9S0_PXL.js} +9 -4
- package/dist/{proxy-path-Dc-0jXGi.js → conversation-privacy-B1uXn5sf.js} +2 -16
- package/dist/{conversation-turn-BoLK9i6g.js → conversation-turn-BUE_7xaN.js} +102 -172
- package/dist/{create-BOycVH9h.js → create-DoDIYgtZ.js} +12 -10
- package/dist/{credential-sync-Mn4OdkEh.js → credential-sync-BJOqGnjV.js} +17 -12
- package/dist/{db-DXTOYRzR.js → db-BFmyYZtJ.js} +20276 -27398
- package/dist/{deployment-CG3TchWh.js → deployment-DXq9ZLU4.js} +17 -15
- package/dist/{engine-context-dyWlfNdD.js → engine-context-CgQ7mlHt.js} +264 -50
- package/dist/{html-CfXEwl_h.js → html-B3VKTGbJ.js} +6 -2
- package/dist/instrumentation.js +15 -7
- package/dist/{job-runner-CySgpi9v.js → job-runner-A1lCkybD.js} +397 -22
- package/dist/{lineage-tRTOcrsL.js → lineage-Bktb0UcV.js} +1 -1
- package/dist/{list-DXBz8SYL.js → list-Bxvg5wXf.js} +260 -698
- package/dist/{logging-czs0nqLC.js → logging--smS7XRK.js} +2 -2
- package/dist/{mailbox-turn-79Nv1JXv.js → mailbox-turn-uSXhUFc9.js} +648 -2957
- package/dist/{message-BTox2Cmb.js → message-BNenhsmB.js} +12 -22
- package/dist/{model-input-IRGa98V7.js → model-input-BReSnwHp.js} +3 -3
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +20 -6
- package/dist/{oauth-callback-server-NXK7AlBp.js → oauth-callback-server-CE4soEIY.js} +2 -2
- package/dist/{oauth-relay-6NBPSpFE.js → oauth-relay-C36gX1gH.js} +2 -2
- package/dist/{package-discovery-BI6T_RkD.js → package-discovery-DD9vencX.js} +1 -50
- package/dist/{parent-result-Dg6P6roR.js → parent-result-Ck1rFYRQ.js} +93 -106
- package/dist/{plugins-BXMdNdyA.js → plugins-D_Ru4CWc.js} +1 -1
- package/dist/profile-BQ-iBDsZ.js +4657 -0
- package/dist/{transcript-BHhJVY0P.js → prompt-Dv7gkpD6.js} +97 -103
- package/dist/proxy-path-BHYoKZdq.js +15 -0
- package/dist/registry-iXMT5Jmh.js +3279 -0
- package/dist/reports-WKHfGTsU.js +195 -0
- package/dist/{resolve-BUFkmxkT.js → resolve-tony4ibz.js} +9 -29
- package/dist/{result-DfATzX77.js → result-Bta_dlWa.js} +42 -117
- package/dist/run-conversation-DL6ru7iW.js +336 -0
- package/dist/{runner-CmKP3inb.js → runner-BstDRbD9.js} +7 -7
- package/dist/{sandbox-egress-signals-DYo5BsM7.js → sandbox-egress-signals-oSJMJOnn.js} +1 -1
- package/dist/{schema-DrBMdPmv.js → schema-DfqrHACA.js} +67 -84
- package/dist/sender-actors-CPglLd5R.js +83 -0
- package/dist/{service-account-CxTX7nnR.js → service-account-CTV_jaNu.js} +3 -1
- package/dist/{skills-BlHUDj7k.js → skills-BCEU41zM.js} +4 -4
- package/dist/{slack-conversation-unfurl-Dhe3lB1U.js → slack-conversation-unfurl-DxVmhbGP.js} +7 -6
- package/dist/{spawn-CfvlFdfz.js → spawn-frczVPIr.js} +11 -8
- package/dist/{system-prompt-table-CDCYVwqN.js → system-prompt-table-CiXy0eNR.js} +91 -70
- package/dist/{task-runner-DcdQJd9e.js → task-runner-C9Yc2_ae.js} +35 -49
- package/dist/{thread-context-DF5uDcWN.js → thread-context-CqZDKErp.js} +6 -6
- package/dist/topics-SRN7IVX-.js +24 -0
- package/dist/turn-membership-CENFf3kI.js +856 -0
- package/dist/{turn-wake-um5Ubd4m.js → turn-wake-BhloiI2h.js} +4 -5
- package/dist/{media-Cr9pGkzr.js → types-C4iC-IMC.js} +819 -777
- package/dist/user-customization-CvfuY9Eo.js +93 -0
- package/dist/users-ByG5RCEJ.js +181 -0
- package/dist/{validation-CJyuOPD2.js → validation-8gjfR91V.js} +1 -1
- package/dist/{version-Bhe7RPIe.js → version-BeZhWWBE.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{worker-D8PRgUqr.js → worker-BqMQQNRk.js} +5 -4
- package/migrations/20261125171254_conversation_visibility/migration.sql +4 -0
- package/migrations/20261125171254_conversation_visibility/snapshot.json +67 -0
- package/migrations/20261125171257_conversation_visibility_backfill/migration.sql +25 -0
- package/migrations/20261125171257_conversation_visibility_backfill/snapshot.json +9 -0
- package/migrations/20261125213232_drop_versions_notify/migration.sql +19 -0
- package/migrations/20261125213232_drop_versions_notify/snapshot.json +9 -0
- package/migrations/20261125225138_conversation_kind_root_thread/migration.sql +23 -0
- package/migrations/20261125225138_conversation_kind_root_thread/snapshot.json +55 -0
- package/migrations/20261125225142_conversation_kind_root_thread_backfill/migration.sql +7 -0
- package/migrations/20261125225142_conversation_kind_root_thread_backfill/snapshot.json +9 -0
- package/migrations/20261126000151_conversation_event_message_role_seq_index/migration.sql +1 -0
- package/migrations/20261126000151_conversation_event_message_role_seq_index/snapshot.json +69 -0
- package/migrations/20261126012917_merge_leaves/migration.sql +2 -0
- package/migrations/20261126012917_merge_leaves/snapshot.json +12 -0
- package/migrations/20261126025226_drop_agent_invocations/migration.sql +6 -0
- package/migrations/20261126025226_drop_agent_invocations/snapshot.json +9 -0
- package/migrations/20261126033000_space_conversations_lead_children/migration.sql +155 -0
- package/migrations/20261126033000_space_conversations_lead_children/snapshot.json +9 -0
- package/migrations/20261126144620_drop_user_message_time_index/migration.sql +1 -0
- package/migrations/20261126144620_drop_user_message_time_index/snapshot.json +38 -0
- package/migrations/20261126153100_inbox_item_subjects/migration.sql +140 -0
- package/migrations/20261126153100_inbox_item_subjects/snapshot.json +9 -0
- package/migrations/20261126153103_inbox_item_subjects_not_null/migration.sql +12 -0
- package/migrations/20261126153103_inbox_item_subjects_not_null/snapshot.json +9 -0
- package/migrations/20261126153105_inbox_item_subject_indexes/migration.sql +1 -0
- package/migrations/20261126153105_inbox_item_subject_indexes/snapshot.json +9 -0
- package/migrations/20261126153108_automation_run_conversation_index/migration.sql +1 -0
- package/migrations/20261126153108_automation_run_conversation_index/snapshot.json +9 -0
- package/migrations/20261126153159_inbox_item_subjects_schema/migration.sql +4 -0
- package/migrations/20261126153159_inbox_item_subjects_schema/snapshot.json +437 -0
- package/migrations/20261126153259_inbox_questions/migration.sql +76 -0
- package/migrations/20261126153259_inbox_questions/snapshot.json +9 -0
- package/migrations/20261126153301_inbox_questions_valid/migration.sql +3 -0
- package/migrations/20261126153301_inbox_questions_valid/snapshot.json +9 -0
- package/migrations/20261126153343_inbox_questions_schema/migration.sql +5 -0
- package/migrations/20261126153343_inbox_questions_schema/snapshot.json +407 -0
- package/migrations/20261126154025_inbox_item_owners/migration.sql +74 -0
- package/migrations/20261126154025_inbox_item_owners/snapshot.json +9 -0
- package/migrations/20261126154048_inbox_item_open_subject_key_index/migration.sql +1 -0
- package/migrations/20261126154048_inbox_item_open_subject_key_index/snapshot.json +9 -0
- package/migrations/20261126154051_drop_inbox_item_owner_indexes/migration.sql +7 -0
- package/migrations/20261126154051_drop_inbox_item_owner_indexes/snapshot.json +9 -0
- package/migrations/20261126154121_inbox_item_owners_schema/migration.sql +8 -0
- package/migrations/20261126154121_inbox_item_owners_schema/snapshot.json +311 -0
- package/migrations/20261126175601_conversation_event_turn/migration.sql +5 -0
- package/migrations/20261126175601_conversation_event_turn/snapshot.json +103 -0
- package/migrations/20261126175614_conversation_event_turn_index/migration.sql +1 -0
- package/migrations/20261126175614_conversation_event_turn_index/snapshot.json +62 -0
- package/migrations/20261126230028_merge_leaves/migration.sql +2 -0
- package/migrations/20261126230028_merge_leaves/snapshot.json +12 -0
- package/migrations/20261126231932_space_lead_holds_name/migration.sql +46 -0
- package/migrations/20261126231932_space_lead_holds_name/snapshot.json +58 -0
- package/migrations/20261127001022_merge_leaves/migration.sql +2 -0
- package/migrations/20261127001022_merge_leaves/snapshot.json +12 -0
- package/package.json +5 -5
- package/skills/jr-rpc/SKILL.md +3 -5
- package/dist/direct-url-BYgYfuIy.js +0 -22
- package/dist/markers-CE0HMXWT.js +0 -67
- package/dist/people-Cegp1Iwq.js +0 -81
- package/dist/start-conversation-Uh8Sk1EF.js +0 -162
- package/dist/turn-session-routing-GtetHsdO.js +0 -1309
- package/dist/user-customization-B27StpVQ.js +0 -9
- package/dist/web-message-id-C6P83ans.js +0 -10
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
|
-
import {
|
|
3
|
-
import { E as withSpan, O as buildSentryEventUrl, a as extractGenAiUsageSummary, m as logInfo, p as logException } from "./logging
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { i as matchSlackAttachments, n as
|
|
2
|
+
import { Bi as renderPluginConversationEvent, D as createSqlStore, Ii as createPluginEmbedder, Ji as createPluginCache, Jo as codeChangeUrl, Kr as resolveConversationRouting, Ku as getStateAdapter, Li as createPluginModel, Nu as completeObject, Pi as createPluginState, Qd as juniorConversationEvents, Qn as createPluginEventPublisher, Qu as hasAgentTurnUsage, Ri as createPluginModelCostRecorder, St as getRegistrations, Uu as renderJuniorNativeConversationEvent, Zs as createPluginUsers, a as getDb, af as juniorCodeRepositories, ar as pluginTaskParamsSchema, dr as createPluginTurnEventReader, ec as readActorIdentity, f as eventFromRow, fr as createPluginConversationChanges, gd as parseSlackMessageTs, i as getConversationStore, if as juniorCodeChanges, ir as pluginTaskId, ju as storeConversationEmbedding, ku as createConversationEmbedder, lf as juniorConversations, lr as createPluginCodeChanges, ls as resolveRootVisibility, mr as createPluginInboxItems, nr as startedTaskDefinition, ns as createPluginAnnotations, o as getSqlExecutor, os as readConversationMetadata, rs as listConversationAnnotations, ss as writeConversationMetadata, ti as getDispatchRecord, tr as createPluginTaskStarter, tu as hasConversationMetadata, zi as createPluginConversationEvents } from "./db-BFmyYZtJ.js";
|
|
3
|
+
import { E as withSpan, O as buildSentryEventUrl, a as extractGenAiUsageSummary, m as logInfo, p as logException } from "./logging--smS7XRK.js";
|
|
4
|
+
import { C as instructionTextForProjection, D as isToolResultError, L as mapBounded, O as isToolResultMessage, b as getUserMessageInstructionText, h as createPluginLogger, j as stripRuntimeTurnContext, k as normalizeToolNameFromResult, v as getPiMessageRole } from "./prompt-Dv7gkpD6.js";
|
|
5
|
+
import { Dr as loadTurnStart, E as isInheritedForkHistory, Nn as hydrateConversationMessages, Sr as getTurnRecord, Zn as isEventAuthorId, _t as coerceThreadConversationState, m as isParentMessageAuthor, mt as getPersistedThreadState } from "./mailbox-turn-uSXhUFc9.js";
|
|
6
|
+
import { J as conversationReportMessageEventSchema, Tt as sameActorIdentity, Ut as readMessageCardRefs, Xt as readMessageAttachments, q as conversationReportEventSchema, zt as inboxItemChangeRecordSchema } from "./types-C4iC-IMC.js";
|
|
7
|
+
import { P as withLock, t as botConfig } from "./config-CHQ8X251.js";
|
|
8
|
+
import { i as matchSlackAttachments, n as savedTurnMessages } from "./turn-membership-CENFf3kI.js";
|
|
9
9
|
import { h as startSpan } from "./sentry-CPbZjomA.js";
|
|
10
10
|
import * as z from "zod";
|
|
11
11
|
import { objectTypeSchema, pluginRunContextSchema, renderTag, tagJson } from "@sentry/junior-plugin-api";
|
|
@@ -267,13 +267,12 @@ function reportMessageActorIdentity(data) {
|
|
|
267
267
|
}
|
|
268
268
|
/**
|
|
269
269
|
* Mark a child's input that its parent agent wrote, so the dashboard does not
|
|
270
|
-
* show the person who started the root as its author. Rows from
|
|
271
|
-
*
|
|
272
|
-
*
|
|
270
|
+
* show the person who started the root as its author. Rows from earlier
|
|
271
|
+
* releases store the id of the work that wrote them at the
|
|
272
|
+
* `agentInvocationId` meta key. A parent message names its author.
|
|
273
273
|
*/
|
|
274
274
|
function reportParentAgentInput(message) {
|
|
275
|
-
|
|
276
|
-
return isParentMessageAuthor({ userId: message.authorUserId }) ? { agentInvocationId: message.messageId } : void 0;
|
|
275
|
+
return typeof message.agentInvocationId === "string" || isParentMessageAuthor({ userId: message.authorUserId }) ? { fromParentAgent: true } : void 0;
|
|
277
276
|
}
|
|
278
277
|
/** Project native assistant tool calls through the existing reporting shape. */
|
|
279
278
|
function reportToolCalls(args) {
|
|
@@ -347,7 +346,6 @@ function reportToolResult(args) {
|
|
|
347
346
|
const output = modelVisibleToolOutput(message.data.content);
|
|
348
347
|
const name = message.data.toolName ?? message.data.name ?? args.start?.name;
|
|
349
348
|
if (!name) return void 0;
|
|
350
|
-
const started = args.canExposePayload && name === "startConversation" && outcome === "completed" ? startConversationToolDefinition.outputSchema.safeParse(message.data.details) : void 0;
|
|
351
349
|
return {
|
|
352
350
|
type: "tool_calls",
|
|
353
351
|
calls: [{
|
|
@@ -358,8 +356,7 @@ function reportToolResult(args) {
|
|
|
358
356
|
startedAt: new Date(args.start.createdAtMs).toISOString(),
|
|
359
357
|
startedSeq: args.start.seq
|
|
360
358
|
} : void 0,
|
|
361
|
-
...args.canExposePayload && output !== void 0 ? { output } : void 0
|
|
362
|
-
...started?.success ? { startedConversationId: started.data.conversation_id } : void 0
|
|
359
|
+
...args.canExposePayload && output !== void 0 ? { output } : void 0
|
|
363
360
|
}]
|
|
364
361
|
};
|
|
365
362
|
}
|
|
@@ -415,8 +412,7 @@ function reportEventData(args) {
|
|
|
415
412
|
...args.canExposePayload && data.role === "user" && data.authorIdentityId && data.authorIdentityId !== "system" ? { actorIdentityId: data.authorIdentityId } : void 0,
|
|
416
413
|
...reportParentAgentInput({
|
|
417
414
|
agentInvocationId: data.meta?.["agentInvocationId"],
|
|
418
|
-
authorUserId: reportingMessageAuthorSchema.safeParse(data.meta?.["author"]).data?.userId
|
|
419
|
-
messageId: data.messageId
|
|
415
|
+
authorUserId: reportingMessageAuthorSchema.safeParse(data.meta?.["author"]).data?.userId
|
|
420
416
|
}),
|
|
421
417
|
...args.canExposePayload ? reportInboxItemChanges(data.meta) : void 0,
|
|
422
418
|
eventObjectType: objectTypeSchema.safeParse(data.meta?.["eventObjectType"]).data,
|
|
@@ -647,7 +643,7 @@ async function readConversationEventRows(executor, args) {
|
|
|
647
643
|
)
|
|
648
644
|
else ${juniorConversationEvents.payload}
|
|
649
645
|
end`
|
|
650
|
-
}).from(juniorConversationEvents).where(and(eq(juniorConversationEvents.conversationId, args.conversationId), args.beforeSeq === void 0 ? void 0 : lt(juniorConversationEvents.seq, args.beforeSeq), args.afterSeq === void 0 ? void 0 : gt(juniorConversationEvents.seq, args.afterSeq), inArray(juniorConversationEvents.type, args.types ?? [...conversationReportSourceEventTypes]), args.
|
|
646
|
+
}).from(juniorConversationEvents).where(and(eq(juniorConversationEvents.conversationId, args.conversationId), args.beforeSeq === void 0 ? void 0 : lt(juniorConversationEvents.seq, args.beforeSeq), args.afterSeq === void 0 ? void 0 : gt(juniorConversationEvents.seq, args.afterSeq), inArray(juniorConversationEvents.type, args.types ?? [...conversationReportSourceEventTypes]), args.subagentMarkerIds === void 0 ? void 0 : inArray(sql`${juniorConversationEvents.payload}->>'subagentInvocationId'`, args.subagentMarkerIds), args.toolCallIds === void 0 ? void 0 : inArray(sql`${juniorConversationEvents.payload}->>'toolCallId'`, args.toolCallIds))).orderBy(args.direction === "forward" ? asc(juniorConversationEvents.seq) : desc(juniorConversationEvents.seq)).limit(args.limit);
|
|
651
647
|
}
|
|
652
648
|
/**
|
|
653
649
|
* Read the last Turn end before the `turns`-th latest Turn start. Its seq is
|
|
@@ -685,7 +681,7 @@ function projectEventPage(args) {
|
|
|
685
681
|
async function projectConversationEvents(executor, args) {
|
|
686
682
|
const events = args.events.sort((left, right) => left.seq - right.seq);
|
|
687
683
|
const firstSeq = events[0]?.seq;
|
|
688
|
-
const
|
|
684
|
+
const endedMarkerIds = [...new Set(events.flatMap((event) => event.data.type === "subagent_ended" ? [event.data.subagentInvocationId] : []))];
|
|
689
685
|
const toolResultIds = conversationReportToolResultIds(events);
|
|
690
686
|
const [turnBoundaryRows, modelCallRows, subagentStartRows, toolStartRows] = await Promise.all([
|
|
691
687
|
firstSeq === void 0 ? [] : readConversationEventRows(executor, {
|
|
@@ -706,11 +702,11 @@ async function projectConversationEvents(executor, args) {
|
|
|
706
702
|
limit: 1,
|
|
707
703
|
types: ["assistant_message"]
|
|
708
704
|
}),
|
|
709
|
-
|
|
705
|
+
endedMarkerIds.length === 0 ? [] : readConversationEventRows(executor, {
|
|
710
706
|
conversationId: args.conversationId,
|
|
711
707
|
direction: "forward",
|
|
712
|
-
limit:
|
|
713
|
-
|
|
708
|
+
limit: endedMarkerIds.length,
|
|
709
|
+
subagentMarkerIds: endedMarkerIds,
|
|
714
710
|
types: ["subagent_started"]
|
|
715
711
|
}),
|
|
716
712
|
toolResultIds.length === 0 ? [] : readConversationEventRows(executor, {
|
|
@@ -855,28 +851,6 @@ async function readConversationMessageEventSeq(executor, conversationId, message
|
|
|
855
851
|
const [row] = await executor.db().select({ seq: juniorConversationEvents.seq }).from(juniorConversationEvents).where(and(eq(juniorConversationEvents.conversationId, conversationId), eq(juniorConversationEvents.type, "message"), sql`${juniorConversationEvents.payload}->>'messageId' = ${messageId}`)).orderBy(asc(juniorConversationEvents.seq)).limit(1);
|
|
856
852
|
return row?.seq;
|
|
857
853
|
}
|
|
858
|
-
// src/chat/code/links.ts
|
|
859
|
-
function codeLinks(provider) {
|
|
860
|
-
return getPlugins().find((plugin) => plugin.manifest.name === provider)?.codeLinks;
|
|
861
|
-
}
|
|
862
|
-
/** Providers whose installed plugin builds code links. */
|
|
863
|
-
function linkedCodeProviders() {
|
|
864
|
-
return getPlugins().flatMap((plugin) => plugin.codeLinks ? [plugin.manifest.name] : []);
|
|
865
|
-
}
|
|
866
|
-
/**
|
|
867
|
-
* Build the web page of one code change from its repository and number.
|
|
868
|
-
* Undefined when no installed plugin builds links for the provider.
|
|
869
|
-
*/
|
|
870
|
-
function codeChangeUrl(change) {
|
|
871
|
-
return codeLinks(change.provider)?.change(change);
|
|
872
|
-
}
|
|
873
|
-
/**
|
|
874
|
-
* Build the web page of one repository from its name. Undefined when no
|
|
875
|
-
* installed plugin builds links for the provider.
|
|
876
|
-
*/
|
|
877
|
-
function codeRepositoryUrl(repository) {
|
|
878
|
-
return codeLinks(repository.provider)?.repository(repository.name);
|
|
879
|
-
}
|
|
880
854
|
// src/chat/conversations/transcript-entries.ts
|
|
881
855
|
const TOOL_TEXT_LIMIT = 1500;
|
|
882
856
|
function actorIdentityKey(actor) {
|
|
@@ -1208,12 +1182,23 @@ function startedTaskContext(plugin, name, payload, options) {
|
|
|
1208
1182
|
}),
|
|
1209
1183
|
db: getDb(),
|
|
1210
1184
|
events: createPluginEventPublisher(plugin, options.events),
|
|
1185
|
+
inboxItems: { forConversation: (conversationId) => createPluginInboxItems({
|
|
1186
|
+
conversationId,
|
|
1187
|
+
plugin: pluginName,
|
|
1188
|
+
show: options.showInboxItem ?? (async () => {})
|
|
1189
|
+
}) },
|
|
1211
1190
|
lastDelivery: (options.deliveryCount ?? 0) >= 5,
|
|
1212
1191
|
log: createPluginLogger(pluginName),
|
|
1213
1192
|
name,
|
|
1214
1193
|
payload,
|
|
1215
1194
|
plugin: { name: pluginName },
|
|
1216
|
-
state: createPluginState(pluginName)
|
|
1195
|
+
state: createPluginState(pluginName),
|
|
1196
|
+
tasks: createPluginTaskStarter({
|
|
1197
|
+
plugin: pluginName,
|
|
1198
|
+
send: options.sendPluginTask,
|
|
1199
|
+
tasks: plugin.tasks
|
|
1200
|
+
}),
|
|
1201
|
+
users: createPluginUsers(pluginName)
|
|
1217
1202
|
};
|
|
1218
1203
|
}
|
|
1219
1204
|
/** Run one delivery of a started task. */
|
|
@@ -1511,11 +1496,12 @@ async function scheduleSessionCompletedPluginTasks(params, send) {
|
|
|
1511
1496
|
*/
|
|
1512
1497
|
async function processPluginTask(message, options = {}) {
|
|
1513
1498
|
if ("payload" in message) {
|
|
1514
|
-
const { events } = options;
|
|
1515
|
-
if (!events) throw new Error("A started plugin task needs the app event publisher");
|
|
1499
|
+
const { events, sendPluginTask } = options;
|
|
1500
|
+
if (!events || !sendPluginTask) throw new Error("A started plugin task needs the app event publisher and task sender");
|
|
1516
1501
|
await processStartedPluginTask(message, {
|
|
1517
1502
|
...options,
|
|
1518
|
-
events
|
|
1503
|
+
events,
|
|
1504
|
+
sendPluginTask
|
|
1519
1505
|
});
|
|
1520
1506
|
return;
|
|
1521
1507
|
}
|
|
@@ -1537,4 +1523,4 @@ async function processPluginTask(message, options = {}) {
|
|
|
1537
1523
|
"app.plugin.task": message.name
|
|
1538
1524
|
});
|
|
1539
1525
|
}
|
|
1540
|
-
export { transcriptEntriesFromReportEvents as a,
|
|
1526
|
+
export { transcriptEntriesFromReportEvents as a, readConversationEventPageAround as c, reportParentAgentInput as d, CONVERSATION_METADATA_TASK as i, readConversationLastEventSeq as l, scheduleSessionCompletedPluginTasks as n, readConversationEventPage as o, task_runner_exports as r, readConversationEventPageAfter as s, processPluginTask as t, readConversationMessageEventSeq as u };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as getDb, n as getConversationEventStore,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { n as listChildMessages } from "./child-message
|
|
1
|
+
import { a as getDb, n as getConversationEventStore, rn as getConversationWorkState, rs as listConversationAnnotations } from "./db-BFmyYZtJ.js";
|
|
2
|
+
import { b as setSpanAttributes } from "./logging--smS7XRK.js";
|
|
3
|
+
import { L as mapBounded } from "./prompt-Dv7gkpD6.js";
|
|
4
|
+
import { Gt as resolveMessageCards, Ut as readMessageCardRefs, Wt as removedCardSchema } from "./types-C4iC-IMC.js";
|
|
5
|
+
import { Nn as hydrateConversationMessages, Rn as buildConversationContext, Un as markConversationMessage, Z as getTurnUserMessageId, _t as coerceThreadConversationState, ct as markTurnClosed, fr as clearPendingAuth, gt as persistThreadStateById, lt as markTurnCompleted, mt as getPersistedThreadState } from "./mailbox-turn-uSXhUFc9.js";
|
|
6
|
+
import { n as listChildMessages } from "./child-message-DHjQLEd1.js";
|
|
7
7
|
// src/chat/conversations/pending-cards.ts
|
|
8
8
|
/**
|
|
9
9
|
* Add the cards that tool results selected since the last visible assistant
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// src/chat/optional-string.ts
|
|
2
|
+
/**
|
|
3
|
+
* Normalize optional env-style strings so blank values do not masquerade as
|
|
4
|
+
* configured inputs.
|
|
5
|
+
*/
|
|
6
|
+
function toOptionalTrimmed(value) {
|
|
7
|
+
if (!value) return;
|
|
8
|
+
const trimmed = value.trim();
|
|
9
|
+
return trimmed.length > 0 ? trimmed : void 0;
|
|
10
|
+
}
|
|
11
|
+
// src/chat/queue/topics.ts
|
|
12
|
+
/**
|
|
13
|
+
* Queue topic names. Vercel queue wiring uses them at build, so keep them
|
|
14
|
+
* stable, and keep this module free of runtime configuration.
|
|
15
|
+
*/
|
|
16
|
+
const CACHE_WARMUP_QUEUE_TOPIC = "junior_cache_warmups";
|
|
17
|
+
const PLUGIN_TASK_QUEUE_TOPIC = "junior_plugin_tasks";
|
|
18
|
+
const WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC = "junior_workspace_snapshots";
|
|
19
|
+
const BACKGROUND_COMPACTION_QUEUE_TOPIC = "junior_context_compaction";
|
|
20
|
+
/** Resolve the Vercel Queue topic used for conversation wake-up nudges. */
|
|
21
|
+
function resolveConversationWorkQueueTopic(options = {}) {
|
|
22
|
+
return options.topic?.trim() || process.env["JUNIOR_CONVERSATION_WORK_QUEUE_TOPIC"]?.trim() || "junior_conversation_work";
|
|
23
|
+
}
|
|
24
|
+
export { resolveConversationWorkQueueTopic as a, WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC as i, CACHE_WARMUP_QUEUE_TOPIC as n, toOptionalTrimmed as o, PLUGIN_TASK_QUEUE_TOPIC as r, BACKGROUND_COMPACTION_QUEUE_TOPIC as t };
|