@sentry/junior 0.320.0 → 0.322.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-DlLLoJKj.js → adapter-CKtEUuWD.js} +23 -2
- package/dist/{admin-BzRXDVfh.js → admin-BGOiUGwR.js} +1 -1
- package/dist/{agent-DxZ7nHfD.js → agent-OUkEw6Bv.js} +276 -1648
- package/dist/{agent-status-Bq_AIpyp.js → agent-status-C_HHxO_d.js} +1 -10
- package/dist/{agent-update-delivery-CO4FU5Gg.js → agent-update-delivery-H6mnPI4q.js} +4 -4
- package/dist/api/schema.d.ts +98 -16
- package/dist/api/schema.js +6 -6
- package/dist/api.js +81 -36
- package/dist/{app-CHCFIIDu.d.ts → app-BK_vhZIq.d.ts} +1 -1
- package/dist/app.d.ts +1 -1
- package/dist/app.js +85 -48
- package/dist/{change-record-K-KsqNhT.d.ts → change-record-DdrJxahk.d.ts} +26 -15
- package/dist/{channel-access-BghWqlXx.js → channel-access-DRhVJIuQ.js} +1 -1
- package/dist/{chat-core-engine-BgfSLrDu.js → chat-core-engine-El308gYr.js} +5 -10
- package/dist/cli/chat.js +16 -16
- package/dist/cli/check.js +4 -4
- package/dist/cli/main.js +2 -2
- package/dist/cli/plugins.js +3 -3
- package/dist/cli/snapshot-create.js +4 -4
- package/dist/cli/upgrade.js +2 -2
- package/dist/{continue-in-slack-DBlQP4PC.js → continue-in-slack-DYl631oM.js} +3 -3
- package/dist/{conversation-feed-DEUdD7mb.js → conversation-feed-BUaMmSLi.js} +2 -12
- package/dist/{conversation-privacy-qoh95v90.js → conversation-privacy-DR_j5Tqf.js} +1 -1
- package/dist/{create-jZSaDrCR.js → create-ZkI-_JAs.js} +2 -2
- package/dist/{credential-sync-Bj9-UlNE.js → credential-sync-Bo6_FtCI.js} +12 -12
- package/dist/{db-BacvswT0.js → db-RDpWIeRK.js} +1744 -216
- package/dist/{deployment-BoJkRPDt.js → deployment-CeKaP0ZJ.js} +1 -1
- package/dist/{html-DW0pw5Pr.js → html-BMv4fAPu.js} +5 -5
- package/dist/instrumentation.js +2 -2
- package/dist/{list-Dz3CdP3g.js → list-CuLf7Ob2.js} +39 -70
- package/dist/{logging-DsTnMqyi.js → logging-BQsfrLHl.js} +1 -1
- package/dist/{markers-C33gNYNE.js → markers-Bh0vqJ5k.js} +3186 -1754
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -4
- package/dist/{oauth-callback-server-C-pEhAQK.js → oauth-callback-server-BxuN0Jqz.js} +2 -2
- package/dist/{oauth-relay-DIXdH-io.js → oauth-relay-vyG2gOwY.js} +1 -1
- package/dist/{profile-v9vA3RvH.js → profile-DiAB4QfT.js} +39 -8
- package/dist/{prompt-C5CW2wKO.js → prompt-5PDkRQ1K.js} +2 -1
- package/dist/{reports-eBgrhPXS.js → reports-CbqB7unq.js} +2 -2
- package/dist/{resolve-HVXmbeCr.js → resolve-C7e0pwuP.js} +5 -5
- package/dist/{result-BPNzgeTl.js → result-D_D-2Adp.js} +7 -7
- package/dist/{runner-aNSDTST6.js → runner-CCVTdp0x.js} +7 -7
- package/dist/{sandbox-egress-signals-nzp9Ykf7.js → sandbox-egress-signals-D4OKOFgy.js} +1 -1
- package/dist/{schema-BlTO5M1d.js → schema-CmPO8BfI.js} +50 -12
- package/dist/{service-account-DWIf1t6p.js → service-account-CeWsFrBi.js} +2 -2
- package/dist/{skills-50izzzdK.js → skills-DfbOjWxl.js} +5 -5
- package/dist/{slack-conversation-unfurl-C6jXhVYg.js → slack-conversation-unfurl-BxF0Yb3-.js} +10 -9
- package/dist/{system-prompt-table-CIR1B44Z.js → system-prompt-table-DySHMtu0.js} +17 -17
- package/dist/{topics-DxuKurCX.js → topic-ChZe9WPj.js} +6 -1
- package/dist/{engine-context-Bi3Ync5t.js → turn-ended-DQ10G3in.js} +11 -845
- package/dist/{types-BNHkJrOP.js → types-BWAgOJtR.js} +95 -78
- package/dist/{user-customization-CvfuY9Eo.js → user-customization-DNzu_r1x.js} +10 -1
- package/dist/{users-DOVo9sdU.js → users-BmZlg_ci.js} +13 -7
- package/dist/{validation-CK0vuEHB.js → validation-BU4tXvH3.js} +1 -1
- package/dist/{version-BuLVNlxB.js → version-D9yLYOBu.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{worker-C82kHU1R.js → worker-C7EDSL3d.js} +4 -4
- package/migrations/20261127184420_question_answerer/migration.sql +36 -0
- package/migrations/20261127184420_question_answerer/snapshot.json +108 -0
- package/migrations/20261127224730_inbox_item_close_action/migration.sql +1 -0
- package/migrations/20261127224730_inbox_item_close_action/snapshot.json +42 -0
- package/package.json +6 -6
- package/skills/design-automation-skill/SKILL.md +1 -1
- package/dist/storage-BtCxXiNt.js +0 -273
- package/dist/topic-B2EWKKBT.js +0 -6
|
@@ -468,6 +468,7 @@ function automationTaskColumns(task) {
|
|
|
468
468
|
const USER_INPUT_LIMITS = {
|
|
469
469
|
maxButtonOptions: 5,
|
|
470
470
|
maxDescriptionChars: 200,
|
|
471
|
+
maxFieldDescriptionChars: 1e3,
|
|
471
472
|
maxFields: 4,
|
|
472
473
|
maxLabelChars: 75,
|
|
473
474
|
maxOptions: 10,
|
|
@@ -476,85 +477,81 @@ const USER_INPUT_LIMITS = {
|
|
|
476
477
|
minOptions: 2
|
|
477
478
|
};
|
|
478
479
|
const labelSchema = z.string().trim().min(1).max(USER_INPUT_LIMITS.maxLabelChars);
|
|
479
|
-
|
|
480
|
+
function descriptionSchema(maxChars) {
|
|
481
|
+
return z.string().trim().min(1).max(maxChars).optional();
|
|
482
|
+
}
|
|
480
483
|
const optionSchema = z.object({
|
|
481
|
-
label: labelSchema
|
|
482
|
-
description: descriptionSchema
|
|
483
|
-
recommended: z.boolean().optional()
|
|
484
|
+
label: labelSchema,
|
|
485
|
+
description: descriptionSchema(USER_INPUT_LIMITS.maxDescriptionChars),
|
|
486
|
+
recommended: z.boolean().optional()
|
|
484
487
|
});
|
|
485
488
|
const fieldBase = {
|
|
486
|
-
id: z.string().regex(/^[a-z][a-z0-9_]{0,31}$/)
|
|
487
|
-
label: labelSchema
|
|
488
|
-
description: descriptionSchema
|
|
489
|
+
id: z.string().regex(/^[a-z][a-z0-9_]{0,31}$/),
|
|
490
|
+
label: labelSchema,
|
|
491
|
+
description: descriptionSchema(USER_INPUT_LIMITS.maxFieldDescriptionChars)
|
|
489
492
|
};
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
kind: z.literal("text").describe("The person types a short answer.")
|
|
508
|
-
})
|
|
509
|
-
]);
|
|
510
|
-
return z.array(userInputFieldSchema).min(1).max(USER_INPUT_LIMITS.maxFields).describe("What to ask, in display order. Use one `choice` field for a simple decision.");
|
|
511
|
-
}
|
|
512
|
-
/** The question of a request, in markdown. */
|
|
513
|
-
const userInputQuestionSchema = z.string().trim().min(1).max(USER_INPUT_LIMITS.maxQuestionChars).describe("The question, in markdown. Include the facts the person needs to decide.");
|
|
514
|
-
/** The fields of a request that an agent writes. */
|
|
515
|
-
const userInputFieldsSchema = fieldsSchema(USER_INPUT_LIMITS.minOptions);
|
|
516
|
-
function requestSchema(minOptions) {
|
|
517
|
-
return z.object({
|
|
518
|
-
question: userInputQuestionSchema,
|
|
519
|
-
fields: fieldsSchema(minOptions)
|
|
520
|
-
}).superRefine((request, context) => {
|
|
521
|
-
const ids = /* @__PURE__ */ new Set();
|
|
522
|
-
for (const field of request.fields) {
|
|
523
|
-
if (ids.has(field.id)) context.addIssue({
|
|
524
|
-
code: "custom",
|
|
525
|
-
message: "Each field needs a different id."
|
|
526
|
-
});
|
|
527
|
-
ids.add(field.id);
|
|
528
|
-
if (field.kind === "text") continue;
|
|
529
|
-
const labels = field.options.map((option) => option.label.toLowerCase());
|
|
530
|
-
if (new Set(labels).size !== labels.length) context.addIssue({
|
|
531
|
-
code: "custom",
|
|
532
|
-
message: "Each choice of a field needs a different label."
|
|
533
|
-
});
|
|
534
|
-
if (field.kind === "choice" && field.options.filter((option) => option.recommended).length > 1) context.addIssue({
|
|
535
|
-
code: "custom",
|
|
536
|
-
message: "A `choice` field can recommend only one option."
|
|
537
|
-
});
|
|
538
|
-
}
|
|
539
|
-
});
|
|
540
|
-
}
|
|
541
|
-
/** A request that an agent writes. Each choice field has two options or more. */
|
|
542
|
-
const userInputRequestSchema = requestSchema(USER_INPUT_LIMITS.minOptions);
|
|
493
|
+
const optionsSchema = z.array(optionSchema).min(1).max(USER_INPUT_LIMITS.maxOptions);
|
|
494
|
+
const userInputFieldSchema = z.discriminatedUnion("kind", [
|
|
495
|
+
z.object({
|
|
496
|
+
...fieldBase,
|
|
497
|
+
kind: z.literal("choice"),
|
|
498
|
+
options: optionsSchema
|
|
499
|
+
}),
|
|
500
|
+
z.object({
|
|
501
|
+
...fieldBase,
|
|
502
|
+
kind: z.literal("multi_choice"),
|
|
503
|
+
options: optionsSchema
|
|
504
|
+
}),
|
|
505
|
+
z.object({
|
|
506
|
+
...fieldBase,
|
|
507
|
+
kind: z.literal("text")
|
|
508
|
+
})
|
|
509
|
+
]);
|
|
543
510
|
/**
|
|
544
|
-
* A saved request
|
|
545
|
-
*
|
|
511
|
+
* A saved request: an optional question that its fields share, and the
|
|
512
|
+
* fields. A question that an agent asks has no shared question: each field
|
|
513
|
+
* holds its own question.
|
|
546
514
|
*/
|
|
547
|
-
const savedUserInputRequestSchema =
|
|
515
|
+
const savedUserInputRequestSchema = z.object({
|
|
516
|
+
question: z.string().trim().min(1).max(USER_INPUT_LIMITS.maxQuestionChars).optional(),
|
|
517
|
+
fields: z.array(userInputFieldSchema).min(1).max(USER_INPUT_LIMITS.maxFields)
|
|
518
|
+
}).superRefine((request, context) => {
|
|
519
|
+
const ids = /* @__PURE__ */ new Set();
|
|
520
|
+
for (const field of request.fields) {
|
|
521
|
+
if (ids.has(field.id)) context.addIssue({
|
|
522
|
+
code: "custom",
|
|
523
|
+
message: "Each field needs a different id."
|
|
524
|
+
});
|
|
525
|
+
ids.add(field.id);
|
|
526
|
+
if (field.kind === "text") continue;
|
|
527
|
+
const labels = field.options.map((option) => option.label.toLowerCase());
|
|
528
|
+
if (new Set(labels).size !== labels.length) context.addIssue({
|
|
529
|
+
code: "custom",
|
|
530
|
+
message: "Each choice of a field needs a different label."
|
|
531
|
+
});
|
|
532
|
+
if (field.kind === "choice" && field.options.filter((option) => option.recommended).length > 1) context.addIssue({
|
|
533
|
+
code: "custom",
|
|
534
|
+
message: "A `choice` field can recommend only one option."
|
|
535
|
+
});
|
|
536
|
+
}
|
|
537
|
+
});
|
|
548
538
|
/**
|
|
549
539
|
* Label and help text of the free-text input that every form adds after the
|
|
550
540
|
* fields. The text goes with the picked answers and does not replace them, so
|
|
551
541
|
* every surface says that in the same words.
|
|
552
542
|
*/
|
|
553
543
|
const USER_INPUT_NOTE = {
|
|
554
|
-
label: "
|
|
555
|
-
description: "Optional.
|
|
544
|
+
label: "Additional notes",
|
|
545
|
+
description: "Optional. Sent with your answers."
|
|
556
546
|
};
|
|
557
547
|
/**
|
|
548
|
+
* Return the text that a request asks: its shared question, else the
|
|
549
|
+
* question of each field, one paragraph each.
|
|
550
|
+
*/
|
|
551
|
+
function userInputQuestionText(request) {
|
|
552
|
+
return request.question ?? request.fields.map((field) => field.description ?? field.label).join("\n\n");
|
|
553
|
+
}
|
|
554
|
+
/**
|
|
558
555
|
* Return the single choice field of a request that a surface can show as
|
|
559
556
|
* one row of buttons, where one click is the whole answer.
|
|
560
557
|
*/
|
|
@@ -587,14 +584,6 @@ function normalizeUserInputAnswer(request, answer) {
|
|
|
587
584
|
...other ? { other } : void 0
|
|
588
585
|
};
|
|
589
586
|
}
|
|
590
|
-
/**
|
|
591
|
-
* Return the option labels that an answer picked, in field order. Text
|
|
592
|
-
* fields and the note pick no option.
|
|
593
|
-
*/
|
|
594
|
-
function answeredChoices(request, answer) {
|
|
595
|
-
const { values } = normalizeUserInputAnswer(request, answer);
|
|
596
|
-
return request.fields.flatMap((field) => field.kind === "text" ? [] : values[field.id] ?? []);
|
|
597
|
-
}
|
|
598
587
|
/** Return true when an answer has no value and no free text. */
|
|
599
588
|
function isEmptyUserInputAnswer(answer) {
|
|
600
589
|
return !answer.other && Object.keys(answer.values).length === 0;
|
|
@@ -611,11 +600,11 @@ function formatUserInputAnswer(request, answer) {
|
|
|
611
600
|
const normalized = normalizeUserInputAnswer(request, answer);
|
|
612
601
|
const lines = [];
|
|
613
602
|
for (const field of request.fields) {
|
|
614
|
-
const values = normalized.values[field.id];
|
|
615
|
-
const value = values
|
|
603
|
+
const values = normalized.values[field.id] ?? [];
|
|
604
|
+
const value = values.length ? values.join(", ") : "(no answer)";
|
|
616
605
|
lines.push(answerLine(`${field.label} (${field.id}): ${value}`));
|
|
617
606
|
}
|
|
618
|
-
if (normalized.other) lines.push(answerLine(
|
|
607
|
+
if (normalized.other) lines.push(answerLine(`${USER_INPUT_NOTE.label}: ${normalized.other}`));
|
|
619
608
|
return lines.join("\n");
|
|
620
609
|
}
|
|
621
610
|
// src/chat/inbox-items/request.ts
|
|
@@ -648,7 +637,35 @@ const inboxItemNoticeRequestSchema = z.object({ related: z.array(inboxItemRelate
|
|
|
648
637
|
* related links, so it has none.
|
|
649
638
|
*/
|
|
650
639
|
function inboxItemQuestion(request) {
|
|
651
|
-
return request && "
|
|
640
|
+
return request && "fields" in request ? request : void 0;
|
|
641
|
+
}
|
|
642
|
+
/**
|
|
643
|
+
* Tool names that ask a person a question. Turns from before
|
|
644
|
+
* `askUserQuestion` have an old name in their history, so readers of a
|
|
645
|
+
* transcript match every name.
|
|
646
|
+
*/
|
|
647
|
+
const ASK_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
648
|
+
"askUserQuestion",
|
|
649
|
+
"addInboxItem",
|
|
650
|
+
"addReviewItem"
|
|
651
|
+
]);
|
|
652
|
+
const ASK_SUBJECT_PREFIX = "askUserQuestion:";
|
|
653
|
+
/**
|
|
654
|
+
* Return the question id of an `askUserQuestion` call. Model providers do
|
|
655
|
+
* not promise unique call ids, so the id also names the Conversation that
|
|
656
|
+
* asked. A retry of the call in that Conversation finds the same question.
|
|
657
|
+
*/
|
|
658
|
+
function askQuestionId(conversationId, toolCallId) {
|
|
659
|
+
return `${ASK_SUBJECT_PREFIX}${conversationId}:${toolCallId}`;
|
|
660
|
+
}
|
|
661
|
+
/**
|
|
662
|
+
* Return the `askUserQuestion` call id of a question that the Conversation
|
|
663
|
+
* asked, or undefined. An older `ask:` question came from another tool, or
|
|
664
|
+
* from a migration, so its id names no `askUserQuestion` call.
|
|
665
|
+
*/
|
|
666
|
+
function askToolCallId(questionId, conversationId) {
|
|
667
|
+
const prefix = askQuestionId(conversationId, "");
|
|
668
|
+
return questionId.startsWith(prefix) && questionId.length > prefix.length ? questionId.slice(prefix.length) : void 0;
|
|
652
669
|
}
|
|
653
670
|
/** Validate the persisted Slack creator identity for an event automation. */
|
|
654
671
|
const eventAutomationPrincipalSchema = z.object({
|
|
@@ -3078,4 +3095,4 @@ const TODOS_REGISTRATION_NAME = "todos";
|
|
|
3078
3095
|
const UPDATE_TODOS_TOOL_NAME = `${TODOS_REGISTRATION_NAME}_updateTodos`;
|
|
3079
3096
|
/** Assignee text for the list's own agent, in tool results and blocks. */
|
|
3080
3097
|
const SELF_TODO_ASSIGNEE = "self";
|
|
3081
|
-
export { activityPreviewText as $,
|
|
3098
|
+
export { activityPreviewText as $, automationContextToolSchema as $t, automationVersionSchema as A, automationTaskText as An, spaceListQuerySchema as At, conversationDetailQuerySchema as B, AGENT_MESSAGE_EVENT_TYPE as Bn, inboxItemChangeRecordSchema as Bt, automationScheduleIntentSchema as C, isEmptyUserInputAnswer as Cn, instructionActors as Ct, automationVersionActivateSchema as D, automationTaskColumns as Dn, SPACE_NAME_MAX_CHARS as Dt, automationUpdateSchema as E, automationSkillNameSchema as En, SPACE_DESCRIPTION_MAX_CHARS as Et, actorIdentitySchema as F, getNextRunAtMs as Fn, spaceVisibilitySchema as Ft, conversationParamsSchema as G, isLegacyResultEventType as Gn, removedCardSchema as Gt, conversationEventHistorySchema as H, TOP_LEVEL_AGENT_MESSAGE_EVENT_TYPE as Hn, messageCardRef as Ht, conversationActivityPreviewSchema as I, getZonedDateTimeParts as In, updateSpaceBodySchema as It, conversationReportMessageEventSchema as J, usageTokensSchema as Jn, MAX_ATTACHMENT_BYTES as Jt, conversationReportEventDataSchema as K, gatewayOnlyProviders as Kn, resolveMessageCards as Kt, conversationAttachmentParamsSchema as L, isValidTimeZone as Ln, conversationTreeStateSchema as Lt, scheduledAutomationSummarySchema as M, isWithinNotificationSchedule as Mn, spaceParamsSchema as Mt, CONVERSATION_DETAIL_VERSION_HEADER as N, notificationScheduleSchema as Nn, spaceRefSchema as Nt, automationVersionListSchema as O, automationTaskDescription as On, archiveSpaceBodySchema as Ot, CONVERSATION_VERSION_HEADER as P, getFirstRunAtMs as Pn, spaceSchema as Pt, conversationUsageSchema as Q, readMessageAttachments as Qt, conversationAttachmentQuerySchema as R, CONTENT_VERSION_HEADER as Rn, conversationKindSchema as Rt, automationRunWindowsSchema as S, formatUserInputAnswer as Sn, contextProvenance as St, automationSummarySchema as T, userInputQuestionText as Tn, sameActorIdentity as Tt, conversationEventPageSchema as U, isAgentMessageEventType as Un, messageCardText as Ut, conversationDetailReportSchema as V, AGENT_UPDATE_EVENT_TYPE as Vn, annotationCard as Vt, conversationEventsQuerySchema as W, isAgentUpdateEventType as Wn, readMessageCardRefs as Wt, conversationSummaryReportSchema as X, inputFileSchema as Xt, conversationReportStatusSchema as Y, MAX_INPUT_ATTACHMENTS as Yt, conversationSurfaceSchema as Z, messageAttachmentSchema as Zt, automationListQuerySchema as _, inboxItemQuestion as _n, historyReplacementSchema as _t, UPDATE_TODOS_TOOL_NAME as a, scheduledRunSchema as an, KNOWN_CONVERSATION_EVENT_TYPES as at, automationRunListSchema as b, USER_INPUT_NOTE as bn, piMessageSchema as bt, automationEditSchema as c, scheduleIntentFromTool as cn, conversationTurnFailureReasonSchema as ct, automationExecutionSchema as d, eventAutomationSchema as dn, agentHistoryFromRow as dt, automationInstructionToolSchema as en, conversationChildAgentTotalsSchema as et, automationExecutionStatusDaySchema as f, eventAutomationTriggerSchema as fn, encodeAgentHistoryPayload as ft, automationListPageSchema as g, inboxItemNoticeRequestSchema as gn, historyItemFromPiMessage as gt, automationListItemSchema as h, askToolCallId as hn, HISTORY_REPLACEMENT_TYPES as ht, TODO_STATUSES as i, scheduledAutomationSchema as in, formatAgentTypes as it, eventAutomationSummarySchema as j, DEFAULT_NOTIFICATION_SCHEDULE as jn, spaceListSchema as jt, automationVersionParamsSchema as k, automationTaskSchema as kn, createSpaceBodySchema as kt, automationEventCatalogSchema as l, toolScheduleIntentSchema as ln, decodeStoredConversationEvent as lt, automationLifecycleSchema as m, askQuestionId as mn, AGENT_HISTORY_ITEM_TYPES as mt, SELF_TODO_ASSIGNEE as n, taskOutcomeInputSchema as nn, agentTypeInstructions as nt, isOpenTodoStatus as o, ScheduleIntentError as on, conversationEventDataSchema as ot, automationExecutionStatusSchema as p, ASK_TOOL_NAMES as pn, isAgentHistoryData as pt, conversationReportEventSchema as q, usageSchema as qn, automationCardStatus as qt, TODOS_REGISTRATION_NAME as r, SCHEDULED_AUTOMATION_SYSTEM_ACTOR as rn, agentTypeSchema as rt, automationEditErrorSchema as s, compileScheduleIntent as sn, conversationTurnFailureCodeSchema as st, OPEN_TODO_STATUSES as t, automationTitleSchema as tn, AGENT_TYPES as tt, automationExecutionListSchema as u, weekdaySchema as un, newConversationEventSchema as ut, automationListSchema as v, inboxItemRequestSchema as vn, isHistoryReplacement as vt, automationSchedulePreviewSchema as w, normalizeUserInputAnswer as wn, instructionProvenanceFor as wt, automationRunSchema as x, buttonUserInputField as xn, agentInstructionProvenance as xt, automationParamsSchema as y, USER_INPUT_LIMITS as yn, piMessageFromHistoryItem as yt, conversationAuxiliaryCostsSchema as z, apiErrorSchema as zn, conversationReadPositionSchema as zt };
|
|
@@ -83,6 +83,15 @@ function isVisionImageMediaType(mediaType) {
|
|
|
83
83
|
const normalized = mediaType.split(";", 1)[0]?.trim().toLowerCase();
|
|
84
84
|
return normalized ? INPUT_IMAGE_TYPES.some((type) => type === normalized) : false;
|
|
85
85
|
}
|
|
86
|
+
// src/chat/conversations/web-message-id.ts
|
|
87
|
+
/**
|
|
88
|
+
* Build the retry-stable Message id shared by web ingress and browser sends.
|
|
89
|
+
* Keep the existing hash and prefix so retries still address stored Messages.
|
|
90
|
+
*/
|
|
91
|
+
async function webMessageId(args) {
|
|
92
|
+
const digest = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(`${args.conversationId}\u0000${args.idempotencyKey}`));
|
|
93
|
+
return `api-msg:${Array.from(new Uint8Array(digest), (byte) => byte.toString(16).padStart(2, "0")).join("").slice(0, 24)}`;
|
|
94
|
+
}
|
|
86
95
|
// src/api/schema/user-customization.ts
|
|
87
96
|
/** Longest customization text one user can save. */
|
|
88
97
|
const USER_CUSTOMIZATION_MAX_CHARS = 1e3;
|
|
@@ -90,4 +99,4 @@ const USER_CUSTOMIZATION_MAX_CHARS = 1e3;
|
|
|
90
99
|
const userCustomizationTextSchema = z.string().trim().max(USER_CUSTOMIZATION_MAX_CHARS);
|
|
91
100
|
/** Request and response body for the viewer's customization. */
|
|
92
101
|
const userCustomizationSchema = z.object({ customization: userCustomizationTextSchema }).strict();
|
|
93
|
-
export {
|
|
102
|
+
export { INLINE_VIDEO_TYPES as a, isVisionImageMediaType as c, webMessageId as i, userCustomizationSchema as n, INPUT_IMAGE_TYPES as o, userCustomizationTextSchema as r, detectImageMediaType as s, USER_CUSTOMIZATION_MAX_CHARS as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Uc as getSlackClient, Zc as withSlackRetries, zc as SlackActionError } from "./db-RDpWIeRK.js";
|
|
2
2
|
import * as z from "zod";
|
|
3
3
|
// src/chat/slack/users.ts
|
|
4
4
|
const profileFieldsSchema = z.object({ fields: z.record(z.string(), z.object({
|
|
@@ -46,9 +46,12 @@ function nameFields(user) {
|
|
|
46
46
|
].map((value) => value.toLowerCase().trim()).filter(Boolean);
|
|
47
47
|
}
|
|
48
48
|
/** Look up a Slack user by ID, returning the full profile including custom fields. */
|
|
49
|
-
async function lookupSlackUserProfile(userId) {
|
|
49
|
+
async function lookupSlackUserProfile(userId, signal) {
|
|
50
50
|
const client = getSlackClient();
|
|
51
|
-
const user = (await withSlackRetries(() => client.users.info({ user: userId }), 3, {
|
|
51
|
+
const user = (await withSlackRetries(() => client.users.info({ user: userId }), 3, {
|
|
52
|
+
action: "users.info",
|
|
53
|
+
signal
|
|
54
|
+
})).user;
|
|
52
55
|
if (!user) throw new Error(`Slack users.info returned no user for ${userId}`);
|
|
53
56
|
return normalizeUser(user);
|
|
54
57
|
}
|
|
@@ -58,10 +61,10 @@ async function lookupSlackUserProfile(userId) {
|
|
|
58
61
|
* Returns undefined for a user that Slack cannot find, a deleted user, a bot,
|
|
59
62
|
* or a user of another workspace. Other lookup errors propagate.
|
|
60
63
|
*/
|
|
61
|
-
async function lookupActiveSlackWorkspaceMember(userId, teamId) {
|
|
64
|
+
async function lookupActiveSlackWorkspaceMember(userId, teamId, signal) {
|
|
62
65
|
let user;
|
|
63
66
|
try {
|
|
64
|
-
user = await lookupSlackUserProfile(userId);
|
|
67
|
+
user = await lookupSlackUserProfile(userId, signal);
|
|
65
68
|
} catch (error) {
|
|
66
69
|
if (error instanceof SlackActionError && error.apiError === "user_not_found") return;
|
|
67
70
|
throw error;
|
|
@@ -69,9 +72,12 @@ async function lookupActiveSlackWorkspaceMember(userId, teamId) {
|
|
|
69
72
|
return user.id === userId && user.team_id === teamId && !user.is_deleted && !user.is_bot ? user : void 0;
|
|
70
73
|
}
|
|
71
74
|
/** Look up a Slack bot by ID. Returns undefined when Slack has no such bot. */
|
|
72
|
-
async function lookupSlackBot(botId) {
|
|
75
|
+
async function lookupSlackBot(botId, signal) {
|
|
73
76
|
try {
|
|
74
|
-
return (await withSlackRetries(() => getSlackClient().bots.info({ bot: botId }), 3, {
|
|
77
|
+
return (await withSlackRetries(() => getSlackClient().bots.info({ bot: botId }), 3, {
|
|
78
|
+
action: "bots.info",
|
|
79
|
+
signal
|
|
80
|
+
})).bot;
|
|
75
81
|
} catch (error) {
|
|
76
82
|
if (error instanceof SlackActionError && error.apiError === "bot_not_found") return;
|
|
77
83
|
throw error;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
|
-
import {
|
|
2
|
+
import { jf as getAppContext } from "./db-RDpWIeRK.js";
|
|
3
3
|
import { isDeepStrictEqual } from "node:util";
|
|
4
4
|
// src/chat/plugins/validation.ts
|
|
5
5
|
var validation_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// package.json
|
|
2
|
-
var version = "0.
|
|
2
|
+
var version = "0.322.0";
|
|
3
3
|
// src/version.ts
|
|
4
4
|
/** Installed Junior package version, or `unknown` when package metadata is unavailable. */
|
|
5
5
|
const JUNIOR_VERSION = typeof version === "string" && version.trim() ? version : "unknown";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as JUNIOR_VERSION } from "./version-
|
|
1
|
+
export { t as JUNIOR_VERSION } from "./version-D9yLYOBu.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
|
-
import {
|
|
3
|
-
import { R as getChatConfig } from "./adapter-
|
|
4
|
-
import { f as logException, m as logWarn, p as logInfo, w as withLogContext, y as setSpanAttributes } from "./logging-
|
|
5
|
-
import {
|
|
2
|
+
import { Bt as beginConversationResume, Dn as isAttemptInterrupt, Fi as ConversationQueueMessageRejectedError, Gt as clearConsumedConversationWake, Ht as checkInConversationWork, It as ackMessages, Jt as completeConversationWork, On as selectAttemptMessages, Qt as ensureConversationWake, Qu as isTopLevel, Ri as nudgeIdempotencyKey, Sf as isProviderRetryError, Ut as claimConversationAttempt, Xt as drainConversationMailbox, Yt as deadLetterAttempt, an as releaseConversationWork, cn as startConversationWork, en as getConversationWorkState, gn as hasConversationStop, ii as getTurnRequestDeadline, in as recordConversationRetry, mn as countPendingConversationMessages, mr as getConversationStoppedAtMs, on as requestAnotherSlice, qt as completeConversationStop, rn as recordAttemptFailure, vn as isFinalAttempt, yn as isInvalidConversationRecordError } from "./db-RDpWIeRK.js";
|
|
3
|
+
import { R as getChatConfig } from "./adapter-CKtEUuWD.js";
|
|
4
|
+
import { f as logException, m as logWarn, p as logInfo, w as withLogContext, y as setSpanAttributes } from "./logging-BQsfrLHl.js";
|
|
5
|
+
import { E as saveHeldInput } from "./markers-Bh0vqJ5k.js";
|
|
6
6
|
// src/chat/task-execution/lost-lease.ts
|
|
7
7
|
/**
|
|
8
8
|
* Count a slice that lost its Conversation Lease as a failed attempt, then
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
ALTER TABLE "junior_questions" ADD COLUMN "answered_by_user_id" text;--> statement-breakpoint
|
|
2
|
+
ALTER TABLE "junior_questions" ADD COLUMN "answered_at" timestamp with time zone;--> statement-breakpoint
|
|
3
|
+
-- The column is new, so every row is null and passes the constraint. NOT
|
|
4
|
+
-- VALID skips the scan under lock and still checks every new write.
|
|
5
|
+
ALTER TABLE "junior_questions" ADD CONSTRAINT "junior_questions_answered_by_user_id_junior_users_id_fkey" FOREIGN KEY ("answered_by_user_id") REFERENCES "junior_users"("id") ON DELETE SET NULL NOT VALID;--> statement-breakpoint
|
|
6
|
+
-- A question now holds who answered it and when. The release before this
|
|
7
|
+
-- one still writes them only on the question's Inbox item while this
|
|
8
|
+
-- release rolls out: it closes the item with `closed_by_user_id`,
|
|
9
|
+
-- `closed_at`, and a copy of the answer. This trigger copies them to the
|
|
10
|
+
-- question when such a close lands. New code writes them on the question
|
|
11
|
+
-- and leaves the item's answer null, so the trigger never fires for it. A
|
|
12
|
+
-- later release drops it.
|
|
13
|
+
CREATE OR REPLACE FUNCTION "junior_inbox_items_legacy_question_answerer"()
|
|
14
|
+
RETURNS trigger
|
|
15
|
+
LANGUAGE plpgsql
|
|
16
|
+
AS $function$
|
|
17
|
+
BEGIN
|
|
18
|
+
UPDATE "junior_questions"
|
|
19
|
+
SET "answer" = coalesce("answer", NEW."answer"),
|
|
20
|
+
"answered_by_user_id" = coalesce("answered_by_user_id", NEW."closed_by_user_id"),
|
|
21
|
+
"answered_at" = coalesce("answered_at", NEW."closed_at")
|
|
22
|
+
WHERE "id" = NEW."subject_id";
|
|
23
|
+
RETURN NEW;
|
|
24
|
+
END;
|
|
25
|
+
$function$;--> statement-breakpoint
|
|
26
|
+
CREATE TRIGGER "junior_inbox_items_legacy_question_answerer" AFTER UPDATE ON "junior_inbox_items" FOR EACH ROW WHEN (NEW."subject_kind" = 'question' AND NEW."status" = 'done' AND NEW."answer" IS NOT NULL AND OLD."answer" IS NULL) EXECUTE FUNCTION "junior_inbox_items_legacy_question_answerer"();--> statement-breakpoint
|
|
27
|
+
-- junior:bounded-backfill: it writes each answered question once, from its one Inbox item. People answer these by hand, so there are few of them.
|
|
28
|
+
UPDATE "junior_questions"
|
|
29
|
+
SET "answer" = coalesce("junior_questions"."answer", "junior_inbox_items"."answer"),
|
|
30
|
+
"answered_by_user_id" = "junior_inbox_items"."closed_by_user_id",
|
|
31
|
+
"answered_at" = "junior_inbox_items"."closed_at"
|
|
32
|
+
FROM "junior_inbox_items"
|
|
33
|
+
WHERE "junior_inbox_items"."subject_kind" = 'question'
|
|
34
|
+
AND "junior_inbox_items"."subject_id" = "junior_questions"."id"
|
|
35
|
+
AND "junior_inbox_items"."status" = 'done'
|
|
36
|
+
AND coalesce("junior_questions"."answer", "junior_inbox_items"."answer") IS NOT NULL;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "diff",
|
|
3
|
+
"version": "10",
|
|
4
|
+
"dialect": "postgres",
|
|
5
|
+
"id": "6a6d04ff-4c5a-470c-9462-de5ab61259bd",
|
|
6
|
+
"prevIds": ["5dddf30d-1fa5-4f06-a90e-acd6a2f366d3"],
|
|
7
|
+
"footprints": [
|
|
8
|
+
{
|
|
9
|
+
"statementType": "add_column",
|
|
10
|
+
"statementTarget": [
|
|
11
|
+
"column",
|
|
12
|
+
"public",
|
|
13
|
+
"junior_questions",
|
|
14
|
+
"answered_by_user_id"
|
|
15
|
+
],
|
|
16
|
+
"writes": [
|
|
17
|
+
"s|col|public.junior_questions.answered_by_user_id",
|
|
18
|
+
"n|col|public.junior_questions.answered_by_user_id",
|
|
19
|
+
"e|col|public.junior_questions.answered_by_user_id"
|
|
20
|
+
],
|
|
21
|
+
"reads": ["n|tbl|public.junior_questions", "n|sch|public"]
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"statementType": "add_column",
|
|
25
|
+
"statementTarget": [
|
|
26
|
+
"column",
|
|
27
|
+
"public",
|
|
28
|
+
"junior_questions",
|
|
29
|
+
"answered_at"
|
|
30
|
+
],
|
|
31
|
+
"writes": [
|
|
32
|
+
"s|col|public.junior_questions.answered_at",
|
|
33
|
+
"n|col|public.junior_questions.answered_at",
|
|
34
|
+
"e|col|public.junior_questions.answered_at"
|
|
35
|
+
],
|
|
36
|
+
"reads": ["n|tbl|public.junior_questions", "n|sch|public"]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"statementType": "create_fk",
|
|
40
|
+
"statementTarget": ["table", "public", "junior_questions"],
|
|
41
|
+
"writes": [
|
|
42
|
+
"s|fk|public.junior_questions.junior_questions_answered_by_user_id_junior_users_id_fkey",
|
|
43
|
+
"n|fk|public.junior_questions.junior_questions_answered_by_user_id_junior_users_id_fkey",
|
|
44
|
+
"e|fk|public.junior_questions.junior_questions_answered_by_user_id_junior_users_id_fkey",
|
|
45
|
+
"n|con|public.junior_questions.junior_questions_answered_by_user_id_junior_users_id_fkey"
|
|
46
|
+
],
|
|
47
|
+
"reads": [
|
|
48
|
+
"n|tbl|public.junior_questions",
|
|
49
|
+
"n|sch|public",
|
|
50
|
+
"n|tbl|public.junior_users",
|
|
51
|
+
"n|sch|public",
|
|
52
|
+
"n|col|public.junior_questions.answered_by_user_id",
|
|
53
|
+
"n|col|public.junior_users.id",
|
|
54
|
+
"e|uniqueness|public.junior_users.id"
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
"deltas": [
|
|
59
|
+
{
|
|
60
|
+
"op": "create",
|
|
61
|
+
"row": {
|
|
62
|
+
"schema": "public",
|
|
63
|
+
"table": "junior_questions",
|
|
64
|
+
"name": "answered_by_user_id",
|
|
65
|
+
"type": "text",
|
|
66
|
+
"typeSchema": null,
|
|
67
|
+
"notNull": false,
|
|
68
|
+
"dimensions": 0,
|
|
69
|
+
"default": null,
|
|
70
|
+
"generated": null,
|
|
71
|
+
"identity": null,
|
|
72
|
+
"entityType": "columns"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"op": "create",
|
|
77
|
+
"row": {
|
|
78
|
+
"schema": "public",
|
|
79
|
+
"table": "junior_questions",
|
|
80
|
+
"name": "answered_at",
|
|
81
|
+
"type": "timestamp with time zone",
|
|
82
|
+
"typeSchema": null,
|
|
83
|
+
"notNull": false,
|
|
84
|
+
"dimensions": 0,
|
|
85
|
+
"default": null,
|
|
86
|
+
"generated": null,
|
|
87
|
+
"identity": null,
|
|
88
|
+
"entityType": "columns"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"op": "create",
|
|
93
|
+
"row": {
|
|
94
|
+
"schema": "public",
|
|
95
|
+
"table": "junior_questions",
|
|
96
|
+
"name": "junior_questions_answered_by_user_id_junior_users_id_fkey",
|
|
97
|
+
"nameExplicit": false,
|
|
98
|
+
"columns": ["answered_by_user_id"],
|
|
99
|
+
"schemaTo": "public",
|
|
100
|
+
"tableTo": "junior_users",
|
|
101
|
+
"columnsTo": ["id"],
|
|
102
|
+
"onUpdate": "NO ACTION",
|
|
103
|
+
"onDelete": "SET NULL",
|
|
104
|
+
"entityType": "fks"
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
]
|
|
108
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ALTER TABLE "junior_inbox_items" ADD COLUMN "close_action" text;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "diff",
|
|
3
|
+
"version": "10",
|
|
4
|
+
"dialect": "postgres",
|
|
5
|
+
"id": "bc65ab56-c83c-4ce7-b610-ce709ad7c3e8",
|
|
6
|
+
"prevIds": ["6a6d04ff-4c5a-470c-9462-de5ab61259bd"],
|
|
7
|
+
"footprints": [
|
|
8
|
+
{
|
|
9
|
+
"statementType": "add_column",
|
|
10
|
+
"statementTarget": [
|
|
11
|
+
"column",
|
|
12
|
+
"public",
|
|
13
|
+
"junior_inbox_items",
|
|
14
|
+
"close_action"
|
|
15
|
+
],
|
|
16
|
+
"writes": [
|
|
17
|
+
"s|col|public.junior_inbox_items.close_action",
|
|
18
|
+
"n|col|public.junior_inbox_items.close_action",
|
|
19
|
+
"e|col|public.junior_inbox_items.close_action"
|
|
20
|
+
],
|
|
21
|
+
"reads": ["n|tbl|public.junior_inbox_items", "n|sch|public"]
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"deltas": [
|
|
25
|
+
{
|
|
26
|
+
"op": "create",
|
|
27
|
+
"row": {
|
|
28
|
+
"schema": "public",
|
|
29
|
+
"table": "junior_inbox_items",
|
|
30
|
+
"name": "close_action",
|
|
31
|
+
"type": "text",
|
|
32
|
+
"typeSchema": null,
|
|
33
|
+
"notNull": false,
|
|
34
|
+
"dimensions": 0,
|
|
35
|
+
"default": null,
|
|
36
|
+
"generated": null,
|
|
37
|
+
"identity": null,
|
|
38
|
+
"entityType": "columns"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/junior",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.322.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"@neondatabase/serverless": "^1.1.0",
|
|
67
67
|
"@sentry/api": "3.2.0",
|
|
68
68
|
"@sentry/http": "1.0.0",
|
|
69
|
-
"@sentry/junior-plugin-api": "0.
|
|
69
|
+
"@sentry/junior-plugin-api": "0.322.0",
|
|
70
70
|
"@sentry/nitro": "11.16.0",
|
|
71
71
|
"@sentry/node": "11.16.0",
|
|
72
72
|
"@sentry/server-utils": "11.16.0",
|
|
@@ -110,10 +110,10 @@
|
|
|
110
110
|
"@emnapi/core": "^1.10.0",
|
|
111
111
|
"@emnapi/runtime": "^1.10.0",
|
|
112
112
|
"@hono/node-server": "2.1.3",
|
|
113
|
-
"@sentry/junior-github": "0.
|
|
114
|
-
"@sentry/junior-linear": "0.
|
|
115
|
-
"@sentry/junior-notion": "0.
|
|
116
|
-
"@sentry/junior-sentry": "0.
|
|
113
|
+
"@sentry/junior-github": "0.322.0",
|
|
114
|
+
"@sentry/junior-linear": "0.322.0",
|
|
115
|
+
"@sentry/junior-notion": "0.322.0",
|
|
116
|
+
"@sentry/junior-sentry": "0.322.0",
|
|
117
117
|
"@sentry/junior-testing": "0.0.0",
|
|
118
118
|
"@types/node": "^24.19.2",
|
|
119
119
|
"@types/pg": "^8.15.6",
|
|
@@ -77,7 +77,7 @@ Do not put these in `SKILL.md` or `references/`:
|
|
|
77
77
|
| --- | --- |
|
|
78
78
|
| `reply`, `noReply`, `reportBlocked`, "Ending a run" | the report, or no report |
|
|
79
79
|
| `startAgent`, `messageAgent`, Task, Thread | parallel workers |
|
|
80
|
-
| `
|
|
80
|
+
| `askUserQuestion`, Inbox item, review item | ask a person |
|
|
81
81
|
| Automation creator, Automation run, Turn, Destination, outcome | the requester, a run |
|
|
82
82
|
| `createAutomation`, `watchEvents`, `loadSkill`, how the skill is invoked | nothing |
|
|
83
83
|
| "when a scheduled task names this skill" | the work that starts it |
|