@sentry/junior 0.310.0 → 0.311.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-B1wujchl.js +259 -0
- package/dist/{adapter-context-BhKpjpGD.js → adapter-context-G2M0y6rP.js} +2 -2
- package/dist/{admin-tgZEZAk2.js → admin-DCiBhUT1.js} +1 -2
- package/dist/{agent-runner-D9cvNlQl.js → agent-runner-BVHPUIc8.js} +543 -1703
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +7 -6
- package/dist/api.d.ts +21 -3
- package/dist/api.js +1479 -372
- package/dist/{app-B_7Wn0en.d.ts → app-Cw5Vy6H6.d.ts} +14 -3
- package/dist/app.d.ts +2 -2
- package/dist/app.js +232 -506
- package/dist/{background-compaction-queue-BGHqkhkY.js → background-compaction-queue-CJDnWVOJ.js} +4 -4
- package/dist/{briefs-DKxkoruh.js → briefs-BDjnug6Y.js} +3 -3
- package/dist/{catalog-runtime-BxwzbLKY.js → catalog-runtime-DMY3VV-D.js} +1 -1
- package/dist/cli/chat.js +16 -16
- package/dist/cli/check.js +23 -29
- package/dist/cli/init.js +1 -6
- package/dist/cli/main.js +3 -3
- package/dist/cli/plugins.js +8 -7
- package/dist/cli/snapshot-create.js +5 -5
- package/dist/cli/upgrade.d.ts +1 -1
- package/dist/cli/upgrade.js +3 -3
- package/dist/{config-Dkt2Le2b.js → config-BrXDQefC.js} +239 -5
- package/dist/{continue-in-slack-BWVwePKD.js → continue-in-slack-DNXSC9So.js} +6 -5
- package/dist/{conversation-M9KZ5JxF.js → conversation-ca__NDQW.js} +47 -8
- package/dist/{conversation-feed-Ci6YD1N-.js → conversation-feed-DkinDu5o.js} +15 -6
- package/dist/{conversation-privacy-C39g8BY4.js → conversation-privacy-DxttrKb9.js} +1 -1
- package/dist/{conversation-turn-CBlZIH02.js → conversation-turn-DWw7Xhdr.js} +41 -38
- package/dist/{credential-sync-vGnrB0BY.js → credential-sync-Bk8wGb8Y.js} +15 -16
- package/dist/{db-B4Hjxr-u.d.ts → db-7ETESH44.d.ts} +3 -1
- package/dist/{db-CFZggNoy.js → db-DTxzH7u5.js} +1609 -1040
- package/dist/{executor-BPkZDx5-.js → executor-DqTiYj9S.js} +450 -99
- package/dist/{html-2r2KmLwi.js → html-B9Sl4Axb.js} +6 -6
- package/dist/{install-C-oE6C_u.js → install-Sg4ePfLl.js} +2 -2
- package/dist/instrumentation.js +3 -3
- package/dist/{lineage-CsvrEFQe.js → lineage-BHAMpNKr.js} +2 -2
- package/dist/{logging-D5gkyvnK.js → logging-FjclQsXu.js} +47 -9
- package/dist/{message-DwvJ-I3w.js → message-CJ7_RL50.js} +5 -8
- package/dist/{model-input-MAq2881y.js → model-input-CMLh4Cwq.js} +3 -3
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-callback-server-DIF6Li06.js → oauth-callback-server-RVcbiDjL.js} +2 -2
- package/dist/{oauth-relay-DPE-wrwO.js → oauth-relay-Bu9kkaQu.js} +1 -1
- package/dist/{projection-jZSlEAXG.js → projection-Cns7XwWa.js} +9445 -5574
- package/dist/{prompt-CaMyeCpA.js → prompt-CDqcsDYC.js} +4 -4
- package/dist/{registry-BBkWFCl8.js → registry-BPwuOP2O.js} +5 -8
- package/dist/{resolve-B38MkHXE.js → resolve-BK29bBry.js} +3 -3
- package/dist/rule-DAxQY-1h.js +20 -0
- package/dist/{runner-11h8PrHh.js → runner-BcAE-cJm.js} +10 -10
- package/dist/{sandbox-egress-signals-CTcACAtJ.js → sandbox-egress-signals-C-q0go5b.js} +1 -1
- package/dist/{schedule-DWxZ3kja.js → schedule-BLJ476XQ.js} +209 -43
- package/dist/{schema-obw5jvR4.js → schema-BLgSZXcL.js} +255 -49
- package/dist/{schema-DriSvB40.d.ts → schema-DYcJeV7d.d.ts} +701 -62
- package/dist/{service-account-Zc5bUcIJ.js → service-account-gN0zqf0S.js} +68 -68
- package/dist/{service-account-Bx93N1n1.js → service-account-iJoCtkHR.js} +3 -3
- package/dist/{skills-C8Npu5zO.js → skills-BoZ80epJ.js} +2 -2
- package/dist/{slack-conversation-unfurl-DlRVA02H.js → slack-conversation-unfurl-CogYrITA.js} +8 -10
- package/dist/{spawn-CXr58R0x.js → spawn-Dk92r7mX.js} +5 -6
- package/dist/{state-CGrGVeQC.js → state-DH3Cmgp3.js} +4 -4
- package/dist/{stop-DYzjRf2U.js → stop-CYsfc0Ed.js} +1063 -313
- package/dist/{store-D4FQ1Nml.js → store-DmmMIrQi.js} +5 -5
- package/dist/{task-queue-CaZffYaH.js → task-queue-C_zldF5J.js} +3 -3
- package/dist/{task-runner-Dm7BHbGp.js → task-runner-C7oCJQIx.js} +20 -13
- package/dist/{thread-context-Dyj1KWaY.js → thread-context-BW2BsQbH.js} +13 -11
- package/dist/{turn-session-routing-CD0BRCex.js → turn-session-routing-Xh_2nSQe.js} +52 -54
- package/dist/{validation-DxVNIxA0.js → validation-DrJd0nnq.js} +1 -1
- package/dist/{version-Cr7Z71yG.js → version-CNKZ8owc.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{warmup-C6LOZ2d2.js → warmup-BWdHew2H.js} +14287 -7195
- package/dist/{web-message-id-BT8Mg8LL.js → web-message-id-Ch5dPq-a.js} +32 -144
- package/dist/{worker-CUBtu1Li.js → worker-t9qpu_Zx.js} +7 -8
- package/migrations/0126_artifact_drop_public.sql +8 -0
- package/migrations/0127_artifact_path.sql +4 -0
- package/migrations/0128_artifact_path_index.sql +1 -0
- package/migrations/0129_review_item_answered_index.sql +1 -0
- package/migrations/0130_review_item_status_index.sql +1 -0
- package/migrations/0131_brief_outcome_status.sql +1 -0
- package/migrations/0132_brief_outcome_status_backfill.sql +7 -0
- package/migrations/0133_brief_created_at_index.sql +1 -0
- package/migrations/0134_slack_person_search_index.sql +1 -0
- package/migrations/0135_code_change_size.sql +3 -0
- package/migrations/0136_merge_conflict_notice_dismiss.sql +16 -0
- package/migrations/0137_inbox_snoozes.sql +27 -0
- package/migrations/0138_code_change_search_index.sql +2 -0
- package/migrations/0139_review_item_owner.sql +22 -0
- package/migrations/0140_review_item_owner_index.sql +1 -0
- package/migrations/0141_memory_core_adoption.sql +89 -0
- package/migrations/0142_memory_core_indexes.sql +17 -0
- package/migrations/meta/0126_snapshot.json +5488 -0
- package/migrations/meta/0127_snapshot.json +5519 -0
- package/migrations/meta/0128_snapshot.json +5519 -0
- package/migrations/meta/0129_snapshot.json +5547 -0
- package/migrations/meta/0130_snapshot.json +5563 -0
- package/migrations/meta/0131_snapshot.json +5569 -0
- package/migrations/meta/0132_snapshot.json +5569 -0
- package/migrations/meta/0133_snapshot.json +5590 -0
- package/migrations/meta/0134_snapshot.json +5606 -0
- package/migrations/meta/0135_snapshot.json +5624 -0
- package/migrations/meta/0136_snapshot.json +5624 -0
- package/migrations/meta/0137_snapshot.json +5864 -0
- package/migrations/meta/0138_snapshot.json +5894 -0
- package/migrations/meta/0139_snapshot.json +5898 -0
- package/migrations/meta/0140_snapshot.json +5919 -0
- package/migrations/meta/0141_snapshot.json +6429 -0
- package/migrations/meta/0142_snapshot.json +6457 -0
- package/migrations/meta/_journal.json +120 -1
- package/package.json +6 -7
- package/dist/result-BaqSZcJb.js +0 -548
- package/dist/session-stop-BfY4rhJs.js +0 -4255
- package/dist/turn-user-message-9IxeEv5v.js +0 -364
- package/dist/users-CaUAYMb3.js +0 -181
- package/dist/viewer-AHldghAD.js +0 -212
|
@@ -158,6 +158,16 @@ const conversationTitleSchema = z.string().trim().min(1).max(200);
|
|
|
158
158
|
const renameConversationBodySchema = z.object({ title: conversationTitleSchema }).strict();
|
|
159
159
|
/** The stored title after the rename. */
|
|
160
160
|
const renameConversationResponseSchema = z.object({ title: z.string().min(1) }).strict();
|
|
161
|
+
// src/api/schema/conversation-tree-state.ts
|
|
162
|
+
/**
|
|
163
|
+
* What a Conversation and its child Conversations need, for one viewer.
|
|
164
|
+
* See "Viewer state" in `TERMINOLOGY.md`.
|
|
165
|
+
*/
|
|
166
|
+
const conversationTreeStateSchema = z.enum([
|
|
167
|
+
"needs_you",
|
|
168
|
+
"working",
|
|
169
|
+
"done"
|
|
170
|
+
]);
|
|
161
171
|
// src/chat/briefs/schema.ts
|
|
162
172
|
/**
|
|
163
173
|
* Runtime schemas for the Brief record and the generator input. Both cross a
|
|
@@ -347,12 +357,30 @@ const objectPreviewImageSchema = z.object({
|
|
|
347
357
|
src: z.string().startsWith("/api/images/"),
|
|
348
358
|
srcSet: z.string().min(1)
|
|
349
359
|
}).strict();
|
|
360
|
+
const CUT_TOKEN_RE = /<(?:[@#!][^<>]*|[a-z]+:[^\s<>|]*(?:\|[^<>]*)?|[a-z]*)$/i;
|
|
361
|
+
/**
|
|
362
|
+
* Cut preview text to the schema limit. The cut ends with "…" at a word
|
|
363
|
+
* break, and never leaves half a surrogate pair or an unclosed Slack token
|
|
364
|
+
* such as `<@U1` or `<https://…`, so mentions and links still parse.
|
|
365
|
+
*/
|
|
366
|
+
function activityPreviewText(text) {
|
|
367
|
+
if (text.length <= 400) return text;
|
|
368
|
+
let cut = text.slice(0, 399);
|
|
369
|
+
const space = cut.search(/\s\S*$/);
|
|
370
|
+
if (space > 0 && /\S/.test(text[cut.length])) cut = cut.slice(0, space);
|
|
371
|
+
const last = cut.charCodeAt(cut.length - 1);
|
|
372
|
+
if (last >= 55296 && last <= 56319) cut = cut.slice(0, -1);
|
|
373
|
+
return `${cut.replace(CUT_TOKEN_RE, "").trimEnd()}…`;
|
|
374
|
+
}
|
|
350
375
|
// src/api/schema/conversation.ts
|
|
376
|
+
/**
|
|
377
|
+
* The status of one Conversation's own work. See `TERMINOLOGY.md` and
|
|
378
|
+
* `conversationStatusSql`, the only place that derives it.
|
|
379
|
+
*/
|
|
351
380
|
const conversationReportStatusSchema = z.enum([
|
|
352
|
-
"
|
|
353
|
-
"
|
|
354
|
-
"
|
|
355
|
-
"stopped"
|
|
381
|
+
"needs_input",
|
|
382
|
+
"working",
|
|
383
|
+
"done"
|
|
356
384
|
]);
|
|
357
385
|
/** Where a Conversation sits in its tree. See `TERMINOLOGY.md`. */
|
|
358
386
|
const conversationKindSchema = z.enum([
|
|
@@ -498,7 +526,7 @@ const conversationActivityPreviewSchema = z.object({
|
|
|
498
526
|
createdAt: z.string().datetime(),
|
|
499
527
|
mentions: z.array(actorIdentitySchema).optional(),
|
|
500
528
|
role: z.enum(["assistant", "user"]),
|
|
501
|
-
text: z.string().min(1)
|
|
529
|
+
text: z.string().min(1).max(400)
|
|
502
530
|
}).strict();
|
|
503
531
|
const conversationSummaryReportSchema = z.object({
|
|
504
532
|
displayTitle: z.string(),
|
|
@@ -514,6 +542,18 @@ const conversationSummaryReportSchema = z.object({
|
|
|
514
542
|
isParticipant: z.boolean(),
|
|
515
543
|
visibility: z.enum(["private", "public"]).optional(),
|
|
516
544
|
status: conversationReportStatusSchema,
|
|
545
|
+
/** Feed rows and the detail only. */
|
|
546
|
+
treeState: conversationTreeStateSchema.optional(),
|
|
547
|
+
/**
|
|
548
|
+
* A Conversation in the tree has an active Watch or a pending Timer.
|
|
549
|
+
* Feed rows and the detail only.
|
|
550
|
+
*/
|
|
551
|
+
watching: z.boolean().optional(),
|
|
552
|
+
/**
|
|
553
|
+
* A Turn is queued or running. Live views poll and show thinking on it,
|
|
554
|
+
* since `status` can read `needs_input` while a Turn runs.
|
|
555
|
+
*/
|
|
556
|
+
turnActive: z.boolean(),
|
|
517
557
|
startedAt: z.string(),
|
|
518
558
|
lastSeenAt: z.string(),
|
|
519
559
|
lastProgressAt: z.string(),
|
|
@@ -941,8 +981,7 @@ const conversationEventPageSchema = z.object({
|
|
|
941
981
|
}).strict().superRefine(validateConversationEvents);
|
|
942
982
|
/**
|
|
943
983
|
* Carries the detail version token in both directions. A custom header, not
|
|
944
|
-
* `ETag
|
|
945
|
-
* validators itself, after the function had already built the full report.
|
|
984
|
+
* `ETag`, for the reason on `CONTENT_VERSION_HEADER`.
|
|
946
985
|
*/
|
|
947
986
|
const CONVERSATION_DETAIL_VERSION_HEADER = "x-junior-detail-version";
|
|
948
987
|
/**
|
|
@@ -1021,4 +1060,4 @@ const conversationDetailReportSchema = conversationSummaryReportSchema.extend({
|
|
|
1021
1060
|
sentryConversationUrl: z.string().optional(),
|
|
1022
1061
|
sourceTask: conversationSourceTaskSchema.optional()
|
|
1023
1062
|
}).strict().superRefine(validateConversationEvents);
|
|
1024
|
-
export {
|
|
1063
|
+
export { MAX_ATTACHMENT_BYTES as $, agentTypeInstructions as A, conversationTreeStateSchema as B, createConversationMessageBodySchema as C, activityPreviewText as D, idempotencyKeySchema as E, briefOutcomeStatusSchema as F, conversationReadPositionSchema as G, conversationTitleSchema as H, briefResourceLabel as I, messageCardRef as J, reviewItemChangeRecordSchema as K, conversationBriefSchema as L, formatAgentTypes as M, briefCodeChangeSchema as N, conversationChildAgentTotalsSchema as O, briefLinkSchema as P, resolveMessageCards as Q, parseBriefInput as R, createConversationBodySchema as S, forkConversationResponseSchema as T, renameConversationBodySchema as U, CONVERSATION_TITLE_MAX_LENGTH as V, renameConversationResponseSchema as W, readMessageCardRefs as X, messageCardText as Y, removedCardSchema as Z, conversationReportMessageEventSchema as _, conversationActivityPreviewSchema as a, conversationSurfaceSchema as b, conversationAuxiliaryCostsSchema as c, conversationEventHistorySchema as d, MAX_INPUT_ATTACHMENTS as et, conversationEventPageSchema as f, conversationReportEventSchema as g, conversationReportEventDataSchema as h, actorIdentitySchema as i, agentTypeSchema as j, AGENT_TYPES as k, conversationDetailQuerySchema as l, conversationParamsSchema as m, CONVERSATION_VERSION_HEADER as n, messageAttachmentSchema as nt, conversationAttachmentParamsSchema as o, conversationEventsQuerySchema as p, annotationCard as q, acceptedConversationMessageSchema as r, readMessageAttachments as rt, conversationAttachmentQuerySchema as s, CONVERSATION_DETAIL_VERSION_HEADER as t, inputFileSchema as tt, conversationDetailReportSchema as u, conversationReportStatusSchema as v, forkConversationBodySchema as w, conversationUsageSchema as x, conversationSummaryReportSchema as y, parseStoredBrief as z };
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { F as briefOutcomeStatusSchema, K as reviewItemChangeRecordSchema, i as actorIdentitySchema, nt as messageAttachmentSchema, u as conversationDetailReportSchema, y as conversationSummaryReportSchema } from "./conversation-ca__NDQW.js";
|
|
2
2
|
import * as z from "zod";
|
|
3
3
|
// src/api/objects/cards.ts
|
|
4
4
|
const MAX_LABEL_CHARS = 256;
|
|
5
5
|
const MAX_FACT_CHARS = 160;
|
|
6
6
|
const conversationStates = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
stopped: "stopped"
|
|
7
|
+
done: "done",
|
|
8
|
+
needs_input: "needs input",
|
|
9
|
+
working: "working"
|
|
11
10
|
};
|
|
12
11
|
function personName(person) {
|
|
13
12
|
return person.fullName ?? person.slackUserName ?? person.email;
|
|
@@ -321,6 +320,14 @@ const conversationFeedMediaSchema = z.object({
|
|
|
321
320
|
id: z.string().min(1)
|
|
322
321
|
}).strict();
|
|
323
322
|
/**
|
|
323
|
+
* The viewer's newest answer to a Review item that the Conversation added:
|
|
324
|
+
* when it closed and the options they picked. A text answer has no choices.
|
|
325
|
+
*/
|
|
326
|
+
const conversationFeedViewerAnswerSchema = z.object({
|
|
327
|
+
choices: z.array(z.string()),
|
|
328
|
+
closedAt: z.string().datetime()
|
|
329
|
+
}).strict();
|
|
330
|
+
/**
|
|
324
331
|
* A root in the feed, or one of its visible Threads. A Thread nests under
|
|
325
332
|
* its nearest visible Thread ancestor, or under the root. Tasks never show.
|
|
326
333
|
*/
|
|
@@ -334,7 +341,9 @@ const conversationFeedItemSchema = conversationSummaryReportSchema.extend({
|
|
|
334
341
|
links: z.array(z.url()).max(3).optional(),
|
|
335
342
|
/** Only with `include=media`. */
|
|
336
343
|
media: z.array(conversationFeedMediaSchema).max(3).optional(),
|
|
337
|
-
threads: z.lazy(() => z.array(conversationFeedItemSchema)).optional()
|
|
344
|
+
threads: z.lazy(() => z.array(conversationFeedItemSchema)).optional(),
|
|
345
|
+
/** Only on the viewer's own feed. */
|
|
346
|
+
viewerAnswer: conversationFeedViewerAnswerSchema.optional()
|
|
338
347
|
});
|
|
339
348
|
const conversationFeedSchema = z.object({
|
|
340
349
|
conversations: z.array(conversationFeedItemSchema),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as logWarn } from "./logging-
|
|
1
|
+
import { h as logWarn } from "./logging-FjclQsXu.js";
|
|
2
2
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
3
3
|
import { renderSystemMessageUpdate } from "@earendil-works/pi-ai";
|
|
4
4
|
// src/chat/conversation-privacy.ts
|
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
|
-
import { A as latestConversationMessageSeq,
|
|
3
|
-
import {
|
|
4
|
-
import { E as withSpan, S as setTags, h as logWarn, p as logException } from "./logging-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { a as buildDeliveredTurnStatePatch, o as loadPendingMessageCards, r as completeAuthPauseTurn, t as buildTurnThreadContext } from "./thread-context-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { p as credentialContextForActor } from "./registry-BBkWFCl8.js";
|
|
2
|
+
import { A as latestConversationMessageSeq, Bs as blockEventAutomation, I as upsertConversationMessage, M as normalizeConversationText, N as recordDeliveredAssistantMessage, No as notifyAutomationBlocked, S as persistConversationMessages, at as failTurnRecord, b as hydrateConversationMessages, dn as getAssistantReplyText, ho as readConversationAutomationRun, j as markConversationMessage, nt as saveTurnCheckpoint, o as loadProjection, pi as verifyTimerWatchCredentialSubject, st as getTurnRecord, t as commitAcceptedReply, xn as persistWithRetry, xo as getDispatchIdForConversation, ys as blockScheduledAutomation } from "./projection-Cns7XwWa.js";
|
|
3
|
+
import { D as isPersonInput, P as turnBehavior, a as getConversationStore, k as isTopLevelKind, o as getDb, r as getConversationEventStore } from "./db-DTxzH7u5.js";
|
|
4
|
+
import { E as withSpan, S as setTags, h as logWarn, p as logException } from "./logging-FjclQsXu.js";
|
|
5
|
+
import { rt as readMessageAttachments } from "./conversation-ca__NDQW.js";
|
|
6
|
+
import { E as isConversationDeliveryPaused, F as finalizeFailedTurnReplyWithEvent } from "./agent-runner-BVHPUIc8.js";
|
|
7
|
+
import { a as buildDeliveredTurnStatePatch, o as loadPendingMessageCards, r as completeAuthPauseTurn, t as buildTurnThreadContext } from "./thread-context-BW2BsQbH.js";
|
|
8
|
+
import { $r as instructionActorFor, $t as sourceFromTurnInput, Er as getConversationTurnBoundaryError, Fr as executeTurn, Hn as getTurnUserMessage, Ir as ConversationTurnLifecycleService, Jr as loadReviewItemInput, Mn as childAgentTurnOptions, Mr as markTurnFailed, Nn as isParentMessageMeta, Nr as startActiveTurn, Or as isTurnInputCommitLostError, Pn as readParentMessage, Pr as AgentRunError, Qr as buildSteeringPiMessage, Vn as completeCancelledConversationTurn, Zt as getEventBatchDelayMs, _n as maybePostAutomatedTurnLimitNotice, an as renderEventBatchInputs, ei as instructionForInputs, en as turnInputFactsFromConversationMessage, h as measureTurnCompactionWait, hi as buildDeterministicTurnId, in as isEventMailboxMetadata, ni as turnRequestText, on as timerWatchCredentialSubject, pi as recordFinishedTurnForAutomatedLimit, qr as eventReviewItemInputs, ri as withoutSavedSteeringMessages, rn as eventBatchMessageMeta, sr as supersedeOpenMailboxTurns, tn as legacyWebMailboxMetadataSchema, wr as TurnInputCommitLostError, yr as createWebAuthorization, zt as resolveConversationDestination } from "./warmup-BWdHew2H.js";
|
|
9
|
+
import { p as credentialContextForActor } from "./registry-BPwuOP2O.js";
|
|
11
10
|
import { i as getActiveSpan, r as continueTrace } from "./sentry-CPbZjomA.js";
|
|
12
|
-
import { a as getPersistedThreadState, c as coerceThreadConversationState, i as getPersistedSandboxState, s as persistThreadStateById } from "./turn-session-routing-
|
|
13
|
-
import { n as botConfig } from "./config-
|
|
14
|
-
import {
|
|
15
|
-
import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-Dm7BHbGp.js";
|
|
11
|
+
import { a as getPersistedThreadState, c as coerceThreadConversationState, i as getPersistedSandboxState, s as persistThreadStateById } from "./turn-session-routing-Xh_2nSQe.js";
|
|
12
|
+
import { n as botConfig } from "./config-BrXDQefC.js";
|
|
13
|
+
import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-C7oCJQIx.js";
|
|
16
14
|
import { t as mapBounded } from "./fan-out-Cod-yEHG.js";
|
|
17
15
|
import { p as instructionProvenanceFor } from "./history-CYstOMKX.js";
|
|
18
|
-
import { s as isEventConversationMessage } from "./prompt-
|
|
19
|
-
import { t as readConversationLineage } from "./lineage-
|
|
16
|
+
import { s as isEventConversationMessage } from "./prompt-CDqcsDYC.js";
|
|
17
|
+
import { t as readConversationLineage } from "./lineage-BHAMpNKr.js";
|
|
20
18
|
import { isDeepStrictEqual } from "node:util";
|
|
21
19
|
import { createHash } from "node:crypto";
|
|
22
20
|
// src/chat/task-execution/turn-telemetry.ts
|
|
@@ -131,10 +129,7 @@ async function commitAssistantMessage(args) {
|
|
|
131
129
|
async function webTurnInputs(messages) {
|
|
132
130
|
const flat = (await mapBounded(messages, async (message) => {
|
|
133
131
|
const reviewItem = await loadReviewItemInput(message.reviewItemChange);
|
|
134
|
-
if (reviewItem) return [
|
|
135
|
-
kind: "runtime",
|
|
136
|
-
text: reviewItem
|
|
137
|
-
}];
|
|
132
|
+
if (reviewItem) return [reviewItem];
|
|
138
133
|
const text = message.text.trim();
|
|
139
134
|
return text ? [{
|
|
140
135
|
kind: "person",
|
|
@@ -186,7 +181,7 @@ async function steeringMessageFromWeb(message, actor) {
|
|
|
186
181
|
actor: instructionActorFor(actor),
|
|
187
182
|
...reviewItemInput ? { kind: "runtime" } : void 0,
|
|
188
183
|
provenance: instructionProvenanceFor(actor),
|
|
189
|
-
text: reviewItemInput ?? message.input.text.trim(),
|
|
184
|
+
text: reviewItemInput?.text ?? message.input.text.trim(),
|
|
190
185
|
timestampMs: message.createdAtMs,
|
|
191
186
|
...storedAttachments.length ? { storedAttachments } : void 0
|
|
192
187
|
};
|
|
@@ -309,10 +304,13 @@ function createConversationTurnWorker(agentRunner, deliverMessage, deliverToPare
|
|
|
309
304
|
const messages = resolved.batch.map((entry) => entry.message);
|
|
310
305
|
const firstMetadata = first.message.input.metadata;
|
|
311
306
|
if (isEventMailboxMetadata(firstMetadata)) {
|
|
312
|
-
|
|
307
|
+
const rendered = await eventReviewItemInputs(messages);
|
|
308
|
+
for (const { message, requestText } of resolved.batch) if (requestText) rendered.set(message.inboundMessageId, {
|
|
313
309
|
kind: "runtime",
|
|
314
|
-
text
|
|
315
|
-
|
|
310
|
+
text: message.input.text.trim(),
|
|
311
|
+
requestText
|
|
312
|
+
});
|
|
313
|
+
inputs = renderEventBatchInputs(messages, rendered);
|
|
316
314
|
eventMeta = eventBatchMessageMeta(messages);
|
|
317
315
|
} else {
|
|
318
316
|
inputs = await webTurnInputs(messages.map((message) => message.input));
|
|
@@ -351,7 +349,8 @@ function createConversationTurnWorker(agentRunner, deliverMessage, deliverToPare
|
|
|
351
349
|
userMessageId = userMessage.id;
|
|
352
350
|
inputs = savedMessageIsEvent ? [{
|
|
353
351
|
kind: "runtime",
|
|
354
|
-
text: userMessage.text
|
|
352
|
+
text: userMessage.text,
|
|
353
|
+
...userMessage.meta?.requestText ? { requestText: userMessage.meta.requestText } : void 0
|
|
355
354
|
}] : await webTurnInputs(turnInputs.map((message) => ({
|
|
356
355
|
reviewItemChange: message.meta?.reviewItemChanges?.[0],
|
|
357
356
|
text: message.text
|
|
@@ -443,20 +442,24 @@ function createConversationTurnWorker(agentRunner, deliverMessage, deliverToPare
|
|
|
443
442
|
replied: false
|
|
444
443
|
}
|
|
445
444
|
} : message);
|
|
446
|
-
if (webInputMessages.length === 0)
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
...
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
445
|
+
if (webInputMessages.length === 0) {
|
|
446
|
+
const requestText = turnRequestText({ instruction: instructionInputs });
|
|
447
|
+
upsertConversationMessage(conversation, {
|
|
448
|
+
id: userMessageId,
|
|
449
|
+
role: "user",
|
|
450
|
+
text: normalizeConversationText(text),
|
|
451
|
+
createdAtMs: startedAtMs,
|
|
452
|
+
author,
|
|
453
|
+
...authorIdentityId ? { authorIdentityId } : void 0,
|
|
454
|
+
meta: {
|
|
455
|
+
...attachments.length ? { attachments } : void 0,
|
|
456
|
+
explicitMention: true,
|
|
457
|
+
replied: false,
|
|
458
|
+
...requestText ? { requestText } : void 0,
|
|
459
|
+
...eventMeta
|
|
460
|
+
}
|
|
461
|
+
});
|
|
462
|
+
}
|
|
460
463
|
await persistConversationMessages({
|
|
461
464
|
conversation,
|
|
462
465
|
conversationId: context.conversationId
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as getRuntimeMetadata, n as botConfig } from "./config-
|
|
1
|
+
import { Bi as resolveBaseUrl, Bo as postSlackMessage, Cn as createUserTokenStore, Qo as getSlackClient, Ri as formatProviderLabel, Tn as resolvePluginOAuthAccount, W as authorizationId, Z as getConversationPendingAuth, d as recordAuthenticationLinked, f as recordAuthorizationCompleted, st as getTurnRecord, zi as parseOAuthStatePayload } from "./projection-Cns7XwWa.js";
|
|
2
|
+
import { R as acquireActiveLock, a as getRuntimeMetadata, n as botConfig } from "./config-BrXDQefC.js";
|
|
3
3
|
import { t as mapBounded } from "./fan-out-Cod-yEHG.js";
|
|
4
|
-
import {
|
|
4
|
+
import { _ as runBestEffort, h as logWarn, p as logException, q as isNativeIdentityProvider } from "./logging-FjclQsXu.js";
|
|
5
5
|
import { p as parseSlackUserId } from "./actor-BsBdxDXQ.js";
|
|
6
|
-
import {
|
|
6
|
+
import { It as readIdentityById, Xt as resolveActorIdentityId, nn as findUserByVerifiedEmails, s as getSqlExecutor, sn as upsertLinkedIdentity } from "./db-DTxzH7u5.js";
|
|
7
|
+
import { i as getStateAdapter } from "./adapter-B1wujchl.js";
|
|
7
8
|
import { i as homeDir } from "./package-discovery-DD9vencX.js";
|
|
8
|
-
import { t as discoverSkills } from "./skills-
|
|
9
|
-
import { d as hasRequiredOAuthScope, n as buildOAuthTokenRequest, r as parseOAuthTokenResponse } from "./registry-
|
|
10
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
11
|
-
import {
|
|
12
|
-
import { O as getMcpProviderErrorAttributes, S as putMcpStoredOAuthCredentials, f as deleteMcpAuthSession, g as getMcpAuthSession, v as getMcpStoredOAuthCredentials } from "./service-account-
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { s as readConnectedOAuthTokens, t as escapeHtml, u as htmlCallbackResponse } from "./html-2r2KmLwi.js";
|
|
19
|
-
import { n as relayLocalOAuthCallback } from "./oauth-relay-DPE-wrwO.js";
|
|
9
|
+
import { t as discoverSkills } from "./skills-BoZ80epJ.js";
|
|
10
|
+
import { d as hasRequiredOAuthScope, n as buildOAuthTokenRequest, r as parseOAuthTokenResponse } from "./registry-BPwuOP2O.js";
|
|
11
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-DMY3VV-D.js";
|
|
12
|
+
import { i as finalizeMcpAuthorization } from "./agent-runner-BVHPUIc8.js";
|
|
13
|
+
import { O as getMcpProviderErrorAttributes, S as putMcpStoredOAuthCredentials, f as deleteMcpAuthSession, g as getMcpAuthSession, v as getMcpStoredOAuthCredentials } from "./service-account-gN0zqf0S.js";
|
|
14
|
+
import { d as readJuniorSecret } from "./task-queue-C_zldF5J.js";
|
|
15
|
+
import { br as deleteWebAuthorization, fr as wakeAuthorizedTurn, hn as lookupSlackUserProfile, pr as wakePausedTurn } from "./warmup-BWdHew2H.js";
|
|
16
|
+
import { a as getPersistedThreadState, c as coerceThreadConversationState } from "./turn-session-routing-Xh_2nSQe.js";
|
|
17
|
+
import { s as readConnectedOAuthTokens, t as escapeHtml, u as htmlCallbackResponse } from "./html-B9Sl4Axb.js";
|
|
18
|
+
import { n as relayLocalOAuthCallback } from "./oauth-relay-Bu9kkaQu.js";
|
|
20
19
|
import * as z from "zod";
|
|
21
20
|
import path from "node:path";
|
|
22
21
|
import { createHmac, createSecretKey, timingSafeEqual } from "node:crypto";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./schema-
|
|
1
|
+
import "./schema-DYcJeV7d.js";
|
|
2
2
|
import * as z from "zod";
|
|
3
3
|
import "@earendil-works/pi-ai";
|
|
4
4
|
import { Destination, Source, locationSchema } from "@sentry/junior-plugin-api";
|
|
@@ -100,6 +100,8 @@ interface Conversation {
|
|
|
100
100
|
lastActivityAtMs: number;
|
|
101
101
|
/** Immutable parent Conversation. */
|
|
102
102
|
parentConversationId?: string;
|
|
103
|
+
/** Immutable root of the Conversation tree, read from storage. */
|
|
104
|
+
rootConversationId?: string;
|
|
103
105
|
/**
|
|
104
106
|
* When the Conversation was archived for everyone. Only archive, auto-archive,
|
|
105
107
|
* pin, and a person's message write it; `upsertConversation` does not.
|