@sentry/junior 0.270.0 → 0.272.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/{actor-CP9K2Idu.js → actor-B4DYygOB.js} +1 -1
- package/dist/{adapter-BQNTKVTF.js → adapter-BDYDi1F9.js} +1 -1
- package/dist/{admin-CKVEoXa4.js → admin-Dj7EFycG.js} +1 -1
- package/dist/{agent-runner-MSQSMFkq.js → agent-runner-Cl6Usx2Y.js} +336 -280
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +5 -5
- package/dist/api.d.ts +1 -1
- package/dist/api.js +81 -37
- package/dist/{app-Bz8t4P8p.d.ts → app-DjZblE2J.d.ts} +8 -2
- package/dist/app.d.ts +1 -1
- package/dist/app.js +74 -40
- package/dist/{interruption-marker-CdblrIQK.js → assistant-reply-DN2w6JL_.js} +2 -8
- package/dist/{automation-Dwh_xcqM.js → automation-CV7g5h3A.js} +1 -1
- package/dist/{briefs-DNFzFFVx.js → briefs-PysAqnjV.js} +4 -4
- package/dist/{catalog-runtime-Bdym_wKy.js → catalog-runtime-BNeCWIaF.js} +1 -1
- package/dist/cli/chat.js +14 -14
- 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 +3 -3
- package/dist/{client-B2MjENki.js → client-FRphcDWW.js} +2 -2
- package/dist/{config-Dm3pWRqY.js → config-BUP9wjiR.js} +3 -3
- package/dist/{connections-0BBhiD-p.js → connections-CesHau9u.js} +10 -10
- package/dist/{conversation-AhOVzN_k.js → conversation-BtQzLoK8.js} +12 -1
- package/dist/{conversation-privacy-C1pJ89rs.js → conversation-privacy-DiGvA9a3.js} +1 -1
- package/dist/{credential-sync-BRiWYs6_.js → credential-sync-D2odJC30.js} +15 -15
- package/dist/{credentialed-BeBaJMZ_.js → credentialed-CgTulRDH.js} +33 -26
- package/dist/{db-BYOuu6v2.d.ts → db-BPLmOwXf.d.ts} +11 -1
- package/dist/{executor-BB6eJkD4.js → executor-DGDpyegI.js} +30 -7
- package/dist/instrumentation.js +2 -2
- package/dist/{job-queue-DiaXoSDg.js → job-queue-CjB97sii.js} +2 -2
- package/dist/{list-BTDRxkOg.js → list-JZUP1yog.js} +37 -53
- package/dist/{logging-C6EdT6PP.js → logging-CjkDr-jP.js} +1 -1
- package/dist/message-D9y8PKA1.js +186 -0
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-callback-server-CjFFVGqa.js → oauth-callback-server-02Pej6hj.js} +2 -2
- package/dist/{prompt-BPSdXYXV.js → prompt-vfceH0c-.js} +1 -1
- package/dist/{registry-CndmkP2P.js → registry-7XgwNgQe.js} +2 -2
- package/dist/{reporting-window-DRCi1Ls_.js → reporting-window-DgHgwQB3.js} +6 -1
- package/dist/{resolve-BkAA1wH7.js → resolve-CuuxNfWG.js} +3 -3
- package/dist/{result-9TJTpuYP.js → result-BRhb6iN1.js} +17 -13
- package/dist/{runner-BmKLSyJm.js → runner-DaWCofuS.js} +11 -11
- package/dist/{sandbox-egress-signals-CjLaogMo.js → sandbox-egress-signals-Bn6FA1UC.js} +1 -1
- package/dist/{schema-WayPSHFu.d.ts → schema-CNjAzYOw.d.ts} +28 -5
- package/dist/{schema-DNLJ_MzW.js → schema-D5VLF4NT.js} +13 -9
- package/dist/{service-account-DlhYl-Mu.js → service-account-D9vrsi8d.js} +3 -3
- package/dist/{service-account-D6e9cVmH.js → service-account-H45LIAG2.js} +3 -3
- package/dist/{session-stop-MZRgYqYH.js → session-stop-HKl0ECX0.js} +81 -153
- package/dist/{skills-BggTR_ue.js → skills-CsiKu3-g.js} +2 -2
- package/dist/{spawn-DmtlcAT_.js → spawn-DqjBxqWh.js} +2 -2
- package/dist/{store-BeWGgaMA.js → store-CPF2kzbu.js} +3 -3
- package/dist/{store-Byarin7b.js → store-DyVKH0QB.js} +47 -30
- package/dist/{task-queue-Dt1_ZoI_.js → task-queue-BbQXCcNX.js} +3 -3
- package/dist/{task-runner-DyKqAPpm.js → task-runner-ChzW5E7R.js} +7 -7
- package/dist/{thread-state-BHBLMvgb.js → thread-state-Ds8JTsX6.js} +5 -5
- package/dist/{turn-failure-response-DWXy_0oJ.js → turn-failure-response-DCMvjsA0.js} +15 -10
- package/dist/{turn-lifecycle-AiXkVqCB.js → turn-lifecycle-DM_77q33.js} +1 -1
- package/dist/{turn-session-routing-B9KLBhaT.js → turn-session-routing-BV_gX7n3.js} +13 -13
- package/dist/{validation-BW60Vtx_.js → validation-DcGelbBi.js} +1 -1
- package/dist/{version-CivPYmkH.js → version-C48azPKq.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-BTgAfdUg.js → viewer-BCRuO8Wg.js} +26 -10
- package/dist/{work-Bjm52fHo.js → work-zxkmbJAp.js} +27 -11
- package/dist/{worker-CMbgtHLu.js → worker-CNNxHF1V.js} +6 -6
- package/migrations/0071_review_item_turn.sql +1 -0
- package/migrations/0072_conversation_read_positions.sql +10 -0
- package/migrations/meta/0071_snapshot.json +4003 -0
- package/migrations/meta/0072_snapshot.json +4064 -0
- package/migrations/meta/_journal.json +14 -0
- package/package.json +4 -4
- package/dist/message-DsjiWRVg.js +0 -59
- package/migrations/AGENTS.md +0 -17
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as resolveLocalScheduleAtMs, i as isValidTimeZone, r as getZonedDateTimeParts, t as getFirstRunAtMs } from "./cadence-R7Em4RjE.js";
|
|
2
|
-
import { n as actorIdentitySchema } from "./conversation-
|
|
2
|
+
import { n as actorIdentitySchema } from "./conversation-BtQzLoK8.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { actorUserIdSchema, destinationVisibilitySchema, eventMatchFieldsSchema, eventMatchSchema, eventReachSchema, eventTypeSchema, pluginEventTypeSchema, slackDestinationSchema, taskOutcomeSchema } from "@sentry/junior-plugin-api";
|
|
5
5
|
// src/chat/scheduled-automations/schedule-intent.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { i as completeObject } from "./client-
|
|
1
|
+
import { i as completeObject } from "./client-FRphcDWW.js";
|
|
2
2
|
import { i as defaultModelId } from "./model-profile-B998sjVd.js";
|
|
3
|
-
import {
|
|
4
|
-
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-
|
|
3
|
+
import { K as briefCodeChangeSchema, X as parseBriefInput, d as conversationDetailReportSchema, p as conversationEventPageSchema } from "./conversation-BtQzLoK8.js";
|
|
4
|
+
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-vfceH0c-.js";
|
|
5
5
|
import { CLI_USAGE } from "./cli/run.js";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import { z } from "zod";
|
|
@@ -267,7 +267,7 @@ async function parseRunOptions(argv) {
|
|
|
267
267
|
* `DATABASE_URL` at import, and `briefs pull` must work with only a token.
|
|
268
268
|
*/
|
|
269
269
|
async function configuredDefaultModelId() {
|
|
270
|
-
const { botConfig } = await import("./config-
|
|
270
|
+
const { botConfig } = await import("./config-BUP9wjiR.js").then((n) => n.r);
|
|
271
271
|
return defaultModelId(botConfig);
|
|
272
272
|
}
|
|
273
273
|
function apiUrl(baseUrl, pathname) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
|
|
2
|
-
import { t as createPluginCatalogRuntime } from "./registry-
|
|
2
|
+
import { t as createPluginCatalogRuntime } from "./registry-7XgwNgQe.js";
|
|
3
3
|
// src/chat/plugins/catalog-runtime.ts
|
|
4
4
|
var catalog_runtime_exports = /* @__PURE__ */ __exportAll({ pluginCatalogRuntime: () => pluginCatalogRuntime });
|
|
5
5
|
const pluginCatalogRuntime = createPluginCatalogRuntime();
|
package/dist/cli/chat.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-
|
|
1
|
+
import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-Cl6Usx2Y.js";
|
|
2
2
|
import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { createHash, randomUUID } from "node:crypto";
|
|
@@ -99,10 +99,10 @@ async function loadLocalPluginSet() {
|
|
|
99
99
|
async function configureLocalChatPlugins(pluginSet) {
|
|
100
100
|
const [pluginsModule, agentHooksModule, catalogRuntimeModule, validationModule, databaseModule] = await Promise.all([
|
|
101
101
|
import("../plugins-DOm9Y6qI.js").then((n) => n.o),
|
|
102
|
-
import("../credentialed-
|
|
103
|
-
import("../catalog-runtime-
|
|
104
|
-
import("../validation-
|
|
105
|
-
import("../viewer-
|
|
102
|
+
import("../credentialed-CgTulRDH.js").then((n) => n.a),
|
|
103
|
+
import("../catalog-runtime-BNeCWIaF.js").then((n) => n.t),
|
|
104
|
+
import("../validation-DcGelbBi.js").then((n) => n.r),
|
|
105
|
+
import("../viewer-BCRuO8Wg.js").then((n) => n.v)
|
|
106
106
|
]);
|
|
107
107
|
const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
|
|
108
108
|
const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
|
|
@@ -152,18 +152,18 @@ function localDevServerUrl() {
|
|
|
152
152
|
async function prepareLocalChatRun(io, pluginSet) {
|
|
153
153
|
defaultStateAdapterForLocalChat();
|
|
154
154
|
await configureLocalChatPlugins(pluginSet);
|
|
155
|
-
const { setBriefsConfig } = await import("../credentialed-
|
|
155
|
+
const { setBriefsConfig } = await import("../credentialed-CgTulRDH.js").then((n) => n._);
|
|
156
156
|
setBriefsConfig({ enabled: true });
|
|
157
|
-
const { runLocalAgentTurn } = await import("../runner-
|
|
158
|
-
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-
|
|
157
|
+
const { runLocalAgentTurn } = await import("../runner-DaWCofuS.js");
|
|
158
|
+
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-02Pej6hj.js");
|
|
159
159
|
const { createLocalOAuthState } = await import("../oauth-relay-CTygMkNx.js").then((n) => n.t);
|
|
160
|
-
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-
|
|
161
|
-
const { bindSpawnAgent } = await import("../spawn-
|
|
162
|
-
const { bindMessageAgent } = await import("../message-
|
|
163
|
-
const { createChildConversationWorker } = await import("../result-
|
|
164
|
-
const { skipInputBeforeConversationStop } = await import("../session-stop-
|
|
160
|
+
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-Bn6FA1UC.js");
|
|
161
|
+
const { bindSpawnAgent } = await import("../spawn-DqjBxqWh.js").then((n) => n.n);
|
|
162
|
+
const { bindMessageAgent } = await import("../message-D9y8PKA1.js").then((n) => n.n);
|
|
163
|
+
const { createChildConversationWorker } = await import("../result-BRhb6iN1.js").then((n) => n.i);
|
|
164
|
+
const { skipInputBeforeConversationStop } = await import("../session-stop-HKl0ECX0.js").then((n) => n.r);
|
|
165
165
|
const { createLocalConversationWork } = await import("../conversation-work-BaT_T6EB.js");
|
|
166
|
-
const { processConversationWork } = await import("../worker-
|
|
166
|
+
const { processConversationWork } = await import("../worker-CNNxHF1V.js").then((n) => n.n);
|
|
167
167
|
let agentRunner;
|
|
168
168
|
const localConversationWork = createLocalConversationWork(async (message) => {
|
|
169
169
|
if (!agentRunner) throw new Error("Local agent runner is not ready");
|
package/dist/cli/check.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { D as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, P as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, k as JUNIOR_HEARTBEAT_ROUTE } from "../logging-
|
|
2
|
-
import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-
|
|
3
|
-
import { i as parseSkillFile } from "../skills-
|
|
1
|
+
import { D as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, P as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, k as JUNIOR_HEARTBEAT_ROUTE } from "../logging-CjkDr-jP.js";
|
|
2
|
+
import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-7XgwNgQe.js";
|
|
3
|
+
import { i as parseSkillFile } from "../skills-CsiKu3-g.js";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import fs from "node:fs/promises";
|
|
6
6
|
import { pathToFileURL } from "node:url";
|
package/dist/cli/main.js
CHANGED
|
@@ -25,13 +25,13 @@ async function runChat(argv, pluginSet) {
|
|
|
25
25
|
return await (await import("./chat.js")).runChat(argv, void 0, { pluginSet });
|
|
26
26
|
}
|
|
27
27
|
async function runAdmin(argv) {
|
|
28
|
-
return await (await import("../admin-
|
|
28
|
+
return await (await import("../admin-Dj7EFycG.js")).runAdmin(argv);
|
|
29
29
|
}
|
|
30
30
|
async function runServiceAccount(argv) {
|
|
31
|
-
return await (await import("../service-account-
|
|
31
|
+
return await (await import("../service-account-D9vrsi8d.js")).runServiceAccount(argv);
|
|
32
32
|
}
|
|
33
33
|
async function runBriefs(argv) {
|
|
34
|
-
return await (await import("../briefs-
|
|
34
|
+
return await (await import("../briefs-PysAqnjV.js")).runBriefs(argv);
|
|
35
35
|
}
|
|
36
36
|
function topLevelCommand(argv) {
|
|
37
37
|
return (argv[0] === "--" ? argv.slice(1) : argv)[0];
|
package/dist/cli/plugins.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { S as getDb } from "../viewer-
|
|
2
|
-
import { n as pluginCatalogRuntime } from "../catalog-runtime-
|
|
3
|
-
import { ar as createPluginLogger, h as validatePlugins, m as setPlugins } from "../credentialed-
|
|
4
|
-
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-
|
|
1
|
+
import { S as getDb } from "../viewer-BCRuO8Wg.js";
|
|
2
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime-BNeCWIaF.js";
|
|
3
|
+
import { ar as createPluginLogger, h as validatePlugins, m as setPlugins } from "../credentialed-CgTulRDH.js";
|
|
4
|
+
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-DcGelbBi.js";
|
|
5
5
|
import { a as pluginRuntimeRegistrationsFromPluginSet, i as pluginCliRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "../plugins-DOm9Y6qI.js";
|
|
6
6
|
import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
|
|
7
7
|
import { stderr, stdout } from "node:process";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as pluginCatalogRuntime } from "../catalog-runtime-
|
|
2
|
-
import { nt as create } from "../credentialed-
|
|
3
|
-
import { t as disconnectStateAdapter } from "../adapter-
|
|
4
|
-
import { n as resolve } from "../resolve-
|
|
1
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime-BNeCWIaF.js";
|
|
2
|
+
import { nt as create } from "../credentialed-CgTulRDH.js";
|
|
3
|
+
import { t as disconnectStateAdapter } from "../adapter-BDYDi1F9.js";
|
|
4
|
+
import { n as resolve } from "../resolve-CuuxNfWG.js";
|
|
5
5
|
// src/cli/snapshot-create.ts
|
|
6
6
|
const DEFAULT_RUNTIME = "node22";
|
|
7
7
|
const DEFAULT_TIMEOUT_MS = 6e5;
|
package/dist/cli/upgrade.d.ts
CHANGED
package/dist/cli/upgrade.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as getChatConfig } from "../config-
|
|
2
|
-
import { t as createJuniorSqlExecutor } from "../executor-
|
|
3
|
-
import { t as createPluginCatalogRuntime } from "../registry-
|
|
1
|
+
import { i as getChatConfig } from "../config-BUP9wjiR.js";
|
|
2
|
+
import { t as createJuniorSqlExecutor } from "../executor-DGDpyegI.js";
|
|
3
|
+
import { t as createPluginCatalogRuntime } from "../registry-7XgwNgQe.js";
|
|
4
4
|
import { n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "../plugins-DOm9Y6qI.js";
|
|
5
5
|
import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
|
|
6
6
|
import { basename, dirname, join, resolve } from "node:path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as withSpan, g as normalizeGenAiFinishReason, h as logWarn, i as extractGenAiUsageAttributes, p as logException, v as serializeGenAiAttribute } from "./logging-
|
|
2
|
-
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-
|
|
1
|
+
import { E as withSpan, g as normalizeGenAiFinishReason, h as logWarn, i as extractGenAiUsageAttributes, p as logException, v as serializeGenAiAttribute } from "./logging-CjkDr-jP.js";
|
|
2
|
+
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-DiGvA9a3.js";
|
|
3
3
|
import { calculateCost, completeSimple, getEnvApiKey, getModels, registerApiProvider } from "@earendil-works/pi-ai/compat";
|
|
4
4
|
import { stream as streamAnthropic, streamSimple as streamSimpleAnthropic } from "@earendil-works/pi-ai/api/anthropic-messages";
|
|
5
5
|
import { createGatewayProvider } from "@ai-sdk/gateway";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
|
|
2
|
-
import { S as toOptionalTrimmed, s as resolveGatewayModel } from "./client-
|
|
3
|
-
import { h as logWarn } from "./logging-
|
|
2
|
+
import { S as toOptionalTrimmed, s as resolveGatewayModel } from "./client-FRphcDWW.js";
|
|
3
|
+
import { h as logWarn } from "./logging-CjkDr-jP.js";
|
|
4
4
|
import { c as modelProfileSchema, d as parseTurnReasoningLevel, t as DEFAULT_MODEL_PROFILES, u as TURN_REASONING_LEVELS } from "./model-profile-B998sjVd.js";
|
|
5
5
|
import { AwsClient } from "aws4fetch";
|
|
6
6
|
// src/chat/attachments/s3.ts
|
|
@@ -264,7 +264,7 @@ const DEFAULT_HANDOFF_MODEL_ID = resolveGatewayModel(DEFAULT_MODEL_PROFILES.hand
|
|
|
264
264
|
const DEFAULT_WEB_SEARCH_MODEL_ID = resolveGatewayModel("openai/gpt-6-luna").id;
|
|
265
265
|
const DEFAULT_DECISION_MODEL_ID = "typesafe-ai/jev";
|
|
266
266
|
const DEFAULT_EMBEDDING_MODEL_ID = "openai/text-embedding-3-small";
|
|
267
|
-
const DEFAULT_IMAGE_GENERATION_MODEL_ID = "
|
|
267
|
+
const DEFAULT_IMAGE_GENERATION_MODEL_ID = "openai/gpt-image-2";
|
|
268
268
|
const DEFAULT_VISION_MODEL_ID = resolveGatewayModel("openai/gpt-5.6-sol").id;
|
|
269
269
|
function validateGatewayModelId(raw) {
|
|
270
270
|
const trimmed = toOptionalTrimmed(raw);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Cn as loadTurnCheckpoint, Dn as failTurnRecord, On as getTurnRecord, n as resolveTurnSessionRouting } from "./turn-session-routing-
|
|
2
|
-
import { n as botConfig } from "./config-
|
|
3
|
-
import { C as getSqlExecutor, F as deleteProviderIdentityForUser, P as deleteProviderIdentityForSlackUser, y as getConversationEventStore } from "./viewer-
|
|
4
|
-
import { u as hasRequiredOAuthScope } from "./registry-
|
|
5
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
6
|
-
import { c as deleteMcpServerSessionId, l as deleteMcpStoredOAuthCredentials, s as deleteMcpAuthSessionsForUserProvider } from "./agent-runner-
|
|
7
|
-
import { pt as startOAuthFlow } from "./credentialed-
|
|
8
|
-
import { r as getStateAdapter } from "./adapter-
|
|
9
|
-
import { a as getVercelConversationWorkQueue } from "./job-queue-
|
|
10
|
-
import { m as ensureConversationWake, w as requestConversationWork } from "./store-
|
|
1
|
+
import { Cn as loadTurnCheckpoint, Dn as failTurnRecord, On as getTurnRecord, n as resolveTurnSessionRouting } from "./turn-session-routing-BV_gX7n3.js";
|
|
2
|
+
import { n as botConfig } from "./config-BUP9wjiR.js";
|
|
3
|
+
import { C as getSqlExecutor, F as deleteProviderIdentityForUser, P as deleteProviderIdentityForSlackUser, y as getConversationEventStore } from "./viewer-BCRuO8Wg.js";
|
|
4
|
+
import { u as hasRequiredOAuthScope } from "./registry-7XgwNgQe.js";
|
|
5
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-BNeCWIaF.js";
|
|
6
|
+
import { c as deleteMcpServerSessionId, l as deleteMcpStoredOAuthCredentials, s as deleteMcpAuthSessionsForUserProvider } from "./agent-runner-Cl6Usx2Y.js";
|
|
7
|
+
import { pt as startOAuthFlow } from "./credentialed-CgTulRDH.js";
|
|
8
|
+
import { r as getStateAdapter } from "./adapter-BDYDi1F9.js";
|
|
9
|
+
import { a as getVercelConversationWorkQueue } from "./job-queue-CjB97sii.js";
|
|
10
|
+
import { m as ensureConversationWake, w as requestConversationWork } from "./store-CPF2kzbu.js";
|
|
11
11
|
import { z } from "zod";
|
|
12
12
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
13
13
|
// src/chat/task-execution/authorized-turn.ts
|
|
@@ -230,6 +230,15 @@ function annotationCard(annotation) {
|
|
|
230
230
|
title: value.label
|
|
231
231
|
};
|
|
232
232
|
}
|
|
233
|
+
// src/api/schema/conversation-read-position.ts
|
|
234
|
+
/**
|
|
235
|
+
* How far the signed-in viewer has read a Conversation transcript.
|
|
236
|
+
*
|
|
237
|
+
* `lastReadSeq` is the event sequence of the last transcript row the viewer
|
|
238
|
+
* saw. The server keeps the highest value it receives, so it only moves
|
|
239
|
+
* forward.
|
|
240
|
+
*/
|
|
241
|
+
const conversationReadPositionSchema = z.object({ lastReadSeq: z.number().int().nonnegative() }).strict();
|
|
233
242
|
// src/api/schema/child-agent-totals.ts
|
|
234
243
|
/**
|
|
235
244
|
* The part of a Conversation total that its child agents spent, at any depth.
|
|
@@ -815,6 +824,8 @@ const conversationDetailReportSchema = conversationSummaryReportSchema.extend({
|
|
|
815
824
|
agentTree: z.array(conversationAgentTreeNodeSchema).min(2).optional(),
|
|
816
825
|
/** The viewer can fork this conversation from an assistant reply. */
|
|
817
826
|
canFork: z.boolean().optional(),
|
|
827
|
+
/** How far the signed-in viewer has read. Absent until they read. */
|
|
828
|
+
readPosition: conversationReadPositionSchema.optional(),
|
|
818
829
|
forkedFromConversationId: z.string().optional(),
|
|
819
830
|
/** Title of the fork source, when the viewer can open it. */
|
|
820
831
|
forkedFromTitle: z.string().optional(),
|
|
@@ -845,4 +856,4 @@ const conversationFeedSchema = z.object({
|
|
|
845
856
|
source: z.literal("conversation_index"),
|
|
846
857
|
generatedAt: z.string()
|
|
847
858
|
}).strict();
|
|
848
|
-
export { createConversationMessageBodySchema as A,
|
|
859
|
+
export { createConversationMessageBodySchema as A, readMessageCardRefs as B, conversationReportEventSchema as C, conversationSurfaceSchema as D, conversationSummaryReportSchema as E, conversationChildAgentTotalsSchema as F, readMessageAttachments as G, resolveMessageCards as H, conversationReadPositionSchema as I, briefOutcomeStatusSchema as J, briefCodeChangeSchema as K, annotationCard as L, forkConversationResponseSchema as M, steerConversationPendingMessagesBodySchema as N, conversationUsageSchema as O, steerConversationPendingMessagesResponseSchema as P, messageCardRef as R, conversationReportEventDataSchema as S, conversationReportStatusSchema as T, MAX_INPUT_IMAGES as U, removedCardSchema as V, MAX_INPUT_IMAGE_BYTES as W, parseBriefInput as X, conversationBriefSchema as Y, conversationParamsSchema as _, cancelConversationPendingMessagesBodySchema as a, conversationPendingMessageSchema as b, conversationAttachmentParamsSchema as c, conversationDetailReportSchema as d, conversationEventHistorySchema as f, conversationFeedSchema as g, conversationFeedQuerySchema as h, archiveConversationResponseSchema as i, forkConversationBodySchema as j, createConversationBodySchema as k, conversationAuxiliaryCostsSchema as l, conversationEventsQuerySchema as m, actorIdentitySchema as n, cancelConversationPendingMessagesResponseSchema as o, conversationEventPageSchema as p, briefLinkSchema as q, archiveConversationBodySchema as r, conversationActivityPreviewSchema as s, acceptedConversationMessageSchema as t, conversationDetailQuerySchema as u, conversationPendingAuthorizationSchema as v, conversationReportMessageEventSchema as w, conversationPendingMessagesReportSchema as x, conversationPendingMessageDeliverySchema as y, messageCardText as z };
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { It as recordAuthenticationLinked, Lt as recordAuthorizationCompleted, On as getTurnRecord, bn as getConversationPendingAuth } from "./turn-session-routing-
|
|
2
|
-
import { p as escapeXml } from "./client-
|
|
3
|
-
import { a as getRuntimeMetadata, n as botConfig } from "./config-
|
|
4
|
-
import { R as isNativeIdentityProvider, _ as runBestEffort, h as logWarn, p as logException } from "./logging-
|
|
5
|
-
import { p as parseSlackUserId } from "./actor-
|
|
6
|
-
import { B as upsertLinkedIdentity, C as getSqlExecutor, I as findUserByVerifiedEmails, M as resolveActorIdentityId, o as readIdentityById } from "./viewer-
|
|
1
|
+
import { It as recordAuthenticationLinked, Lt as recordAuthorizationCompleted, On as getTurnRecord, bn as getConversationPendingAuth } from "./turn-session-routing-BV_gX7n3.js";
|
|
2
|
+
import { p as escapeXml } from "./client-FRphcDWW.js";
|
|
3
|
+
import { a as getRuntimeMetadata, n as botConfig } from "./config-BUP9wjiR.js";
|
|
4
|
+
import { R as isNativeIdentityProvider, _ as runBestEffort, h as logWarn, p as logException } from "./logging-CjkDr-jP.js";
|
|
5
|
+
import { p as parseSlackUserId } from "./actor-B4DYygOB.js";
|
|
6
|
+
import { B as upsertLinkedIdentity, C as getSqlExecutor, I as findUserByVerifiedEmails, M as resolveActorIdentityId, o as readIdentityById } from "./viewer-BCRuO8Wg.js";
|
|
7
7
|
import { i as homeDir } from "./package-discovery-DJBompdd.js";
|
|
8
|
-
import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-
|
|
9
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
10
|
-
import { t as discoverSkills } from "./skills-
|
|
11
|
-
import { a as finalizeMcpAuthorization, d as getMcpStoredOAuthCredentials, f as putMcpStoredOAuthCredentials, o as deleteMcpAuthSession, u as getMcpAuthSession, v as lookupSlackUserProfile } from "./agent-runner-
|
|
12
|
-
import { Dn as getSlackClient, Et as postSlackMessage, dt as parseOAuthStatePayload, ft as resolveBaseUrl, i as resolvePluginOAuthAccount, n as createUserTokenStore, ut as formatProviderLabel } from "./credentialed-
|
|
8
|
+
import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-7XgwNgQe.js";
|
|
9
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-BNeCWIaF.js";
|
|
10
|
+
import { t as discoverSkills } from "./skills-CsiKu3-g.js";
|
|
11
|
+
import { a as finalizeMcpAuthorization, d as getMcpStoredOAuthCredentials, f as putMcpStoredOAuthCredentials, o as deleteMcpAuthSession, u as getMcpAuthSession, v as lookupSlackUserProfile } from "./agent-runner-Cl6Usx2Y.js";
|
|
12
|
+
import { Dn as getSlackClient, Et as postSlackMessage, dt as parseOAuthStatePayload, ft as resolveBaseUrl, i as resolvePluginOAuthAccount, n as createUserTokenStore, ut as formatProviderLabel } from "./credentialed-CgTulRDH.js";
|
|
13
13
|
import { r as acquireActiveLock } from "./locks-D-0h111u.js";
|
|
14
|
-
import { r as getStateAdapter } from "./adapter-
|
|
15
|
-
import { _ as getMcpProviderErrorAttributes } from "./service-account-
|
|
16
|
-
import { o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-
|
|
17
|
-
import { c as deleteWebAuthorization, i as readConnectedOAuthTokens, m as wakePausedTurn, p as wakeAuthorizedTurn, u as htmlCallbackResponse } from "./connections-
|
|
14
|
+
import { r as getStateAdapter } from "./adapter-BDYDi1F9.js";
|
|
15
|
+
import { _ as getMcpProviderErrorAttributes } from "./service-account-H45LIAG2.js";
|
|
16
|
+
import { o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-Ds8JTsX6.js";
|
|
17
|
+
import { c as deleteWebAuthorization, i as readConnectedOAuthTokens, m as wakePausedTurn, p as wakeAuthorizedTurn, u as htmlCallbackResponse } from "./connections-CesHau9u.js";
|
|
18
18
|
import { n as relayLocalOAuthCallback } from "./oauth-relay-CTygMkNx.js";
|
|
19
19
|
import path from "node:path";
|
|
20
20
|
import { z } from "zod";
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
|
|
2
|
-
import { S as toOptionalTrimmed, i as completeObject, o as embedTexts, t as GEN_AI_PROVIDER_NAME } from "./client-
|
|
3
|
-
import { i as getChatConfig, n as botConfig, o as getSlackBotToken, v as normalizeSlackEmojiName } from "./config-
|
|
4
|
-
import { B as isRecord$2, E as withSpan, a as extractGenAiUsageSummary, b as setSpanAttributes, c as getLogContextAttributes, d as logAudit, h as logWarn, m as logInfo, p as logException, y as setSentryUser } from "./logging-
|
|
2
|
+
import { S as toOptionalTrimmed, i as completeObject, o as embedTexts, t as GEN_AI_PROVIDER_NAME } from "./client-FRphcDWW.js";
|
|
3
|
+
import { i as getChatConfig, n as botConfig, o as getSlackBotToken, v as normalizeSlackEmojiName } from "./config-BUP9wjiR.js";
|
|
4
|
+
import { B as isRecord$2, E as withSpan, a as extractGenAiUsageSummary, b as setSpanAttributes, c as getLogContextAttributes, d as logAudit, h as logWarn, m as logInfo, p as logException, y as setSentryUser } from "./logging-CjkDr-jP.js";
|
|
5
5
|
import { a as getClient$1, n as captureMessage, r as continueTrace } from "./sentry-MDkYAVPV.js";
|
|
6
|
-
import { t as canExposeConversationPayload } from "./conversation-privacy-
|
|
6
|
+
import { t as canExposeConversationPayload } from "./conversation-privacy-DiGvA9a3.js";
|
|
7
7
|
import { i as defaultModelId } from "./model-profile-B998sjVd.js";
|
|
8
|
-
import { d as parseSlackChannelReferenceId, f as parseSlackTeamId,
|
|
9
|
-
import { C as getSqlExecutor, D as createSqlStore, L as readUserTimezone, S as getDb, X as parseDestination, g as createCache, i as readActorIdentity, l as resolveViewerUser, n as findUserByEmailFromSql, o as readIdentityById, p as parseAvatarUrl, q as hasAgentTurnUsage, s as readIdentityByIdFromSql, y as getConversationEventStore, z as saveUserTimezone } from "./viewer-
|
|
8
|
+
import { d as parseSlackChannelReferenceId, f as parseSlackTeamId, h as parseSlackMessageTs, i as isActorUserId, p as parseSlackUserId, s as parseActorUserId } from "./actor-B4DYygOB.js";
|
|
9
|
+
import { C as getSqlExecutor, D as createSqlStore, L as readUserTimezone, S as getDb, X as parseDestination, g as createCache, i as readActorIdentity, l as resolveViewerUser, n as findUserByEmailFromSql, o as readIdentityById, p as parseAvatarUrl, q as hasAgentTurnUsage, s as readIdentityByIdFromSql, y as getConversationEventStore, z as saveUserTimezone } from "./viewer-BCRuO8Wg.js";
|
|
10
10
|
import { c as juniorIdentities, d as juniorDestinations, l as juniorUsers, s as juniorConversations } from "./agent-invocations-C1RNOCs8.js";
|
|
11
|
-
import { C as
|
|
11
|
+
import { C as juniorCodeChanges, S as juniorConversationAnnotations, T as juniorAttachments, _ as juniorConversationBriefs, a as juniorReviewItemAssignees, b as juniorConversationEvents, c as juniorReviewItems, d as juniorAutomations, h as juniorConversationParticipants, i as juniorWorkspaces, n as juniorSnapshots, o as juniorReviewItemConversations, r as juniorWorkspaceRepos, w as juniorCodeRepositories } from "./executor-DGDpyegI.js";
|
|
12
12
|
import { l as decodeStoredConversationEvent } from "./media-U6Tuz6Mi.js";
|
|
13
|
-
import { _ as CredentialUnavailableError, a as resolveAuthTokenPlaceholder, h as credentialSubjectSchema, m as credentialLogContext, o as resolvePluginCommandEnv, p as credentialContextSchema } from "./registry-
|
|
14
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
13
|
+
import { _ as CredentialUnavailableError, a as resolveAuthTokenPlaceholder, h as credentialSubjectSchema, m as credentialLogContext, o as resolvePluginCommandEnv, p as credentialContextSchema } from "./registry-7XgwNgQe.js";
|
|
14
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-BNeCWIaF.js";
|
|
15
15
|
import { r as acquireActiveLock } from "./locks-D-0h111u.js";
|
|
16
|
-
import { n as getDefaultRedisStateAdapterFor, r as getStateAdapter } from "./adapter-
|
|
16
|
+
import { n as getDefaultRedisStateAdapterFor, r as getStateAdapter } from "./adapter-BDYDi1F9.js";
|
|
17
17
|
import { i as isValidTimeZone } from "./cadence-R7Em4RjE.js";
|
|
18
|
-
import {
|
|
19
|
-
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-
|
|
18
|
+
import { B as readMessageCardRefs, C as conversationReportEventSchema, G as readMessageAttachments, X as parseBriefInput, Y as conversationBriefSchema, w as conversationReportMessageEventSchema } from "./conversation-BtQzLoK8.js";
|
|
19
|
+
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-vfceH0c-.js";
|
|
20
20
|
import path from "node:path";
|
|
21
21
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
22
22
|
import { z } from "zod";
|
|
23
23
|
import { createHash, createHmac, createPrivateKey, createPublicKey, generateKeyPairSync, randomBytes, randomUUID, sign, timingSafeEqual } from "node:crypto";
|
|
24
|
-
import { and, arrayContains, asc, count, desc, eq, exists, getTableColumns, gte, ilike, inArray, isNotNull, isNull, lt, lte, max, ne, notExists, or, sql } from "drizzle-orm";
|
|
24
|
+
import { and, arrayContains, asc, count, desc, eq, exists, getTableColumns, gt, gte, ilike, inArray, isNotNull, isNull, lt, lte, max, ne, notExists, or, sql } from "drizzle-orm";
|
|
25
25
|
import { EgressAuthRequired, EgressPolicyDenied, actorSchema, codeChangeInputSchema, conversationAnnotationInputSchema, conversationEventPresentationSchema, defineConversationEvent, eventDataSchema, eventInputSchema, eventMatchSchema, eventMatches, eventTypeSchema, missingToolAnnotationKeys, normalizeEventIdentifier, objectAnnotationSchema, objectIconPath, objectTypeSchema, pluginAuthorizationSchema, pluginCredentialHeaderTransformSchema, pluginCredentialResultSchema, pluginEventsSchema, pluginGrantSchema, pluginProviderAccountSchema, pluginStoredTokensSchema, promptContextSchema, promptMessageSchema, sourceSchema, stableEventMatchKey } from "@sentry/junior-plugin-api";
|
|
26
26
|
import { alias, union } from "drizzle-orm/pg-core";
|
|
27
27
|
import fs from "node:fs/promises";
|
|
@@ -7757,6 +7757,7 @@ async function hydrate(db, rows) {
|
|
|
7757
7757
|
updatedAt: row.updatedAt,
|
|
7758
7758
|
visibility: row.visibility,
|
|
7759
7759
|
...row.answer ? { answer: row.answer } : void 0,
|
|
7760
|
+
...row.addedByTurnId ? { addedByTurnId: row.addedByTurnId } : void 0,
|
|
7760
7761
|
...row.automationId ? { automationId: row.automationId } : void 0,
|
|
7761
7762
|
...row.closeReason ? { closeReason: row.closeReason } : void 0,
|
|
7762
7763
|
...row.closedAt ? { closedAt: row.closedAt } : void 0,
|
|
@@ -7829,6 +7830,7 @@ async function insertReviewItem(db, input) {
|
|
|
7829
7830
|
const inserted = await tx.insert(juniorReviewItems).values({
|
|
7830
7831
|
...contentColumns(input),
|
|
7831
7832
|
addedByConversationId: input.addedByConversationId,
|
|
7833
|
+
addedByTurnId: input.addedByTurnId ?? null,
|
|
7832
7834
|
automationId: input.automationId ?? null,
|
|
7833
7835
|
createdAt: now,
|
|
7834
7836
|
dedupeKey: input.dedupeKey,
|
|
@@ -7847,12 +7849,17 @@ async function insertReviewItem(db, input) {
|
|
|
7847
7849
|
if (!item) throw new Error(`Review item ${id} is missing after insert`);
|
|
7848
7850
|
return item;
|
|
7849
7851
|
}
|
|
7850
|
-
/**
|
|
7852
|
+
/**
|
|
7853
|
+
* Replace the content of one open Review item. Return false when closed.
|
|
7854
|
+
* `addedByTurnId` moves the Turn pointer to the Turn that added the item
|
|
7855
|
+
* again; omit it to keep the stored Turn.
|
|
7856
|
+
*/
|
|
7851
7857
|
async function updateReviewItemContent(db, input) {
|
|
7852
7858
|
return await db.transaction(async (tx) => {
|
|
7853
7859
|
if (!(await tx.update(juniorReviewItems).set({
|
|
7854
7860
|
...contentColumns(input),
|
|
7855
|
-
updatedAt: new Date(input.nowMs)
|
|
7861
|
+
updatedAt: new Date(input.nowMs),
|
|
7862
|
+
...input.addedByTurnId ? { addedByTurnId: input.addedByTurnId } : void 0
|
|
7856
7863
|
}).where(and(eq(juniorReviewItems.id, input.id), eq(juniorReviewItems.status, "open"))).returning({ id: juniorReviewItems.id }))[0]) return false;
|
|
7857
7864
|
await replaceLinks(tx, input.id, input);
|
|
7858
7865
|
return true;
|
|
@@ -7911,7 +7918,7 @@ async function takeReviewItem(db, input) {
|
|
|
7911
7918
|
}
|
|
7912
7919
|
function searchConditions(reader, filters) {
|
|
7913
7920
|
const conditions = [reviewItemVisibleTo(reader), inArray(juniorReviewItems.status, [...filters.statuses])];
|
|
7914
|
-
if (filters.after) conditions.push(or(
|
|
7921
|
+
if (filters.after) conditions.push(or(gt(juniorReviewItems.createdAt, filters.after.createdAt), and(eq(juniorReviewItems.createdAt, filters.after.createdAt), gt(juniorReviewItems.id, filters.after.id))));
|
|
7915
7922
|
if (filters.subjectId) conditions.push(eq(juniorReviewItems.subjectId, filters.subjectId));
|
|
7916
7923
|
if (filters.automationId) conditions.push(eq(juniorReviewItems.automationId, filters.automationId));
|
|
7917
7924
|
if (filters.conversationId) conditions.push(reviewItemLinkedTo(filters.conversationId));
|
|
@@ -7929,11 +7936,12 @@ async function countReviewItemsNeedingUser(db, userId) {
|
|
|
7929
7936
|
/**
|
|
7930
7937
|
* Find the Review items that a reader can see. Open items come first, so
|
|
7931
7938
|
* the limit never drops an open item for a closed one. Then the newest
|
|
7932
|
-
* change comes first: `updated_at`, then `id`, both descending.
|
|
7933
|
-
*
|
|
7939
|
+
* change comes first: `updated_at`, then `id`, both descending. With
|
|
7940
|
+
* `order: "oldest"`, the oldest item comes first: `created_at`, then `id`,
|
|
7941
|
+
* both ascending. `after` pages through that order.
|
|
7934
7942
|
*/
|
|
7935
7943
|
async function searchReviewItems(db, reader, filters) {
|
|
7936
|
-
return await hydrate(db, await db.select().from(juniorReviewItems).where(and(...searchConditions(reader, filters))).orderBy(desc(eq(juniorReviewItems.status, "open")), desc(juniorReviewItems.updatedAt), desc(juniorReviewItems.id)).limit(filters.limit));
|
|
7944
|
+
return await hydrate(db, await db.select().from(juniorReviewItems).where(and(...searchConditions(reader, filters))).orderBy(desc(eq(juniorReviewItems.status, "open")), ...filters.order === "oldest" ? [asc(juniorReviewItems.createdAt), asc(juniorReviewItems.id)] : [desc(juniorReviewItems.updatedAt), desc(juniorReviewItems.id)]).limit(filters.limit));
|
|
7937
7945
|
}
|
|
7938
7946
|
/**
|
|
7939
7947
|
* List the Conversations that wait on a User: each is linked to an open item
|
|
@@ -7944,17 +7952,16 @@ async function listWaitingConversationIds(db, userId) {
|
|
|
7944
7952
|
}
|
|
7945
7953
|
// src/chat/review-items/plugin.ts
|
|
7946
7954
|
/**
|
|
7947
|
-
* Resolve the Users to assign.
|
|
7948
|
-
*
|
|
7949
|
-
*
|
|
7955
|
+
* Resolve the Users to assign. A plugin notice goes only to people in its
|
|
7956
|
+
* Conversation, public or private. Junior leaves out an Identity without a
|
|
7957
|
+
* User and a User who is not in the Conversation.
|
|
7950
7958
|
*/
|
|
7951
|
-
async function assigneeUserIds(db, identityIds, conversationId
|
|
7959
|
+
async function assigneeUserIds(db, identityIds, conversationId) {
|
|
7952
7960
|
const userIds = [];
|
|
7953
7961
|
for (const identityId of new Set(identityIds)) {
|
|
7954
7962
|
const user = (await readIdentityByIdFromSql(db, identityId))?.user;
|
|
7955
7963
|
if (!user) continue;
|
|
7956
|
-
if (
|
|
7957
|
-
userIds.push(user.id);
|
|
7964
|
+
if ((await readConversationAccessFromSql(db, [conversationId], user)).get(conversationId)?.isParticipant) userIds.push(user.id);
|
|
7958
7965
|
}
|
|
7959
7966
|
return userIds;
|
|
7960
7967
|
}
|
|
@@ -7982,7 +7989,7 @@ function createPluginReviewItems(args) {
|
|
|
7982
7989
|
if (existing && isPrivate && existing.addedByConversationId !== conversationId) throw new Error("A private review item links only to the Conversation that added it");
|
|
7983
7990
|
const content = {
|
|
7984
7991
|
assignedToEveryone: false,
|
|
7985
|
-
assigneeUserIds: await assigneeUserIds(db, notice.assigneeIdentityIds, conversationId
|
|
7992
|
+
assigneeUserIds: await assigneeUserIds(db, notice.assigneeIdentityIds, conversationId),
|
|
7986
7993
|
body: notice.body,
|
|
7987
7994
|
conversationIds: [.../* @__PURE__ */ new Set([conversationId, ...existing?.conversationIds ?? []])],
|
|
7988
7995
|
kind: "notice",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./schema-
|
|
1
|
+
import "./schema-CNjAzYOw.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { Destination, Source, locationSchema } from "@sentry/junior-plugin-api";
|
|
4
4
|
import "drizzle-orm/pg-core";
|
|
@@ -149,6 +149,16 @@ interface ConversationStore {
|
|
|
149
149
|
providerDestinationId: string;
|
|
150
150
|
providerTenantId?: string;
|
|
151
151
|
}): Promise<ConversationPrivacy | undefined>;
|
|
152
|
+
/**
|
|
153
|
+
* Store live visibility for a Destination that has no Conversation yet,
|
|
154
|
+
* such as a channel that an Automation moves to.
|
|
155
|
+
*/
|
|
156
|
+
recordDestinationVisibility(args: {
|
|
157
|
+
channelName?: string;
|
|
158
|
+
destination: Destination;
|
|
159
|
+
nowMs?: number;
|
|
160
|
+
visibility: ConversationPrivacy;
|
|
161
|
+
}): Promise<void>;
|
|
152
162
|
/**
|
|
153
163
|
* Resolve one Slack channel id from a known destination display name.
|
|
154
164
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./config-
|
|
2
|
-
import { p as logException } from "./logging-
|
|
1
|
+
import "./config-BUP9wjiR.js";
|
|
2
|
+
import { p as logException } from "./logging-CjkDr-jP.js";
|
|
3
3
|
import { a as juniorAgentInvocations, c as juniorIdentities, d as juniorDestinations, f as timestamptz, i as juniorAgentBindings, l as juniorUsers, s as juniorConversations } from "./agent-invocations-C1RNOCs8.js";
|
|
4
4
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
5
5
|
import { sql } from "drizzle-orm";
|
|
@@ -239,8 +239,8 @@ const juniorConversationBindings = pgTable("junior_conversation_bindings", {
|
|
|
239
239
|
// src/db/schema/conversation-participants.ts
|
|
240
240
|
/**
|
|
241
241
|
* Materialized personal-feed membership for one linked user on one root
|
|
242
|
-
* conversation. Rows come from the root actor and from
|
|
243
|
-
*
|
|
242
|
+
* conversation. Rows come from the root actor and from the authors of Turn
|
|
243
|
+
* input messages. Thread context authors do not get a row.
|
|
244
244
|
*/
|
|
245
245
|
const juniorConversationParticipants = pgTable("junior_conversation_participants", {
|
|
246
246
|
userId: text("user_id").notNull().references(() => juniorUsers.id),
|
|
@@ -255,6 +255,23 @@ const juniorConversationParticipants = pgTable("junior_conversation_participants
|
|
|
255
255
|
index("junior_conversation_participants_user_activity_idx").on(table.userId, table.lastMessageAt.desc()),
|
|
256
256
|
index("junior_conversation_participants_root_idx").on(table.rootConversationId)
|
|
257
257
|
]);
|
|
258
|
+
// src/db/schema/conversation-read-positions.ts
|
|
259
|
+
/**
|
|
260
|
+
* How far one signed-in user has read one Conversation transcript.
|
|
261
|
+
*
|
|
262
|
+
* `last_read_seq` is the event sequence of the last transcript row the user
|
|
263
|
+
* saw. It only moves forward, so clients on several devices can write in any
|
|
264
|
+
* order.
|
|
265
|
+
*/
|
|
266
|
+
const juniorConversationReadPositions = pgTable("junior_conversation_read_positions", {
|
|
267
|
+
userId: text("user_id").notNull().references(() => juniorUsers.id),
|
|
268
|
+
conversationId: text("conversation_id").notNull().references(() => juniorConversations.conversationId),
|
|
269
|
+
lastReadSeq: integer("last_read_seq").notNull(),
|
|
270
|
+
updatedAt: timestamptz("updated_at").notNull()
|
|
271
|
+
}, (table) => [primaryKey({
|
|
272
|
+
name: "junior_conversation_read_positions_user_conversation_pk",
|
|
273
|
+
columns: [table.userId, table.conversationId]
|
|
274
|
+
})]);
|
|
258
275
|
// src/db/schema/location-configurations.ts
|
|
259
276
|
/** Durable user configuration entries scoped to provider Locations. */
|
|
260
277
|
const juniorLocationConfigurations = pgTable("junior_location_configurations", {
|
|
@@ -384,8 +401,8 @@ const juniorAutomationRuns = pgTable("junior_automation_runs", {
|
|
|
384
401
|
]);
|
|
385
402
|
// src/db/schema/review-items.ts
|
|
386
403
|
/**
|
|
387
|
-
* One Review item: something that needs a person.
|
|
388
|
-
* `
|
|
404
|
+
* One Review item: something that needs a person. An action item stores its
|
|
405
|
+
* `request`, and
|
|
389
406
|
* its `answer` after an assignee submits it. `closed_at` is set for `done`
|
|
390
407
|
* and `dismissed`. `closed_by_user_id` is null when an agent closed it.
|
|
391
408
|
*/
|
|
@@ -410,6 +427,11 @@ const juniorReviewItems = pgTable("junior_review_items", {
|
|
|
410
427
|
/** Conversation of the agent that added the item. */
|
|
411
428
|
addedByConversationId: text("added_by_conversation_id").notNull().references(() => juniorConversations.conversationId, { onDelete: "cascade" }),
|
|
412
429
|
/**
|
|
430
|
+
* Turn of the agent that added the item, or that last added it again with
|
|
431
|
+
* its dedupe key. Null for a plugin item, which has no Turn.
|
|
432
|
+
*/
|
|
433
|
+
addedByTurnId: text("added_by_turn_id"),
|
|
434
|
+
/**
|
|
413
435
|
* Provider tenant, such as a Slack workspace, of the Conversation that
|
|
414
436
|
* added the item. A public item is visible only inside it.
|
|
415
437
|
*/
|
|
@@ -521,6 +543,7 @@ const juniorSqlSchema = {
|
|
|
521
543
|
juniorConversationBriefs,
|
|
522
544
|
juniorConversationBindings,
|
|
523
545
|
juniorConversationParticipants,
|
|
546
|
+
juniorConversationReadPositions,
|
|
524
547
|
juniorConversations,
|
|
525
548
|
juniorLocationConfigurations,
|
|
526
549
|
juniorDestinations,
|
|
@@ -783,4 +806,4 @@ function createJuniorSqlExecutor(args) {
|
|
|
783
806
|
statementTimeoutMs
|
|
784
807
|
});
|
|
785
808
|
}
|
|
786
|
-
export {
|
|
809
|
+
export { juniorCodeChanges as C, juniorArtifacts as E, juniorConversationAnnotations as S, juniorAttachments as T, juniorConversationBriefs as _, juniorReviewItemAssignees as a, juniorConversationEvents as b, juniorReviewItems as c, juniorAutomations as d, juniorStats as f, juniorConversationBindings as g, juniorConversationParticipants as h, juniorWorkspaces as i, juniorAutomationRuns as l, juniorConversationReadPositions as m, juniorSnapshots as n, juniorReviewItemConversations as o, juniorLocationConfigurations as p, juniorWorkspaceRepos as r, juniorReviewItemSlackCards as s, createJuniorSqlExecutor as t, juniorAutomationVersions as u, CONVERSATION_METRICS as v, juniorCodeRepositories as w, juniorApiTokens as x, juniorConversationMetrics as y };
|
package/dist/instrumentation.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { F as getDeploymentServiceVersion, I as getDeploymentTelemetryAttributes } from "./logging-
|
|
1
|
+
import { F as getDeploymentServiceVersion, I as getDeploymentTelemetryAttributes } from "./logging-CjkDr-jP.js";
|
|
2
2
|
import { a as getClient, c as init, o as getGlobalScope } from "./sentry-MDkYAVPV.js";
|
|
3
|
-
import { n as getCurrentConversationPrivacy } from "./conversation-privacy-
|
|
3
|
+
import { n as getCurrentConversationPrivacy } from "./conversation-privacy-DiGvA9a3.js";
|
|
4
4
|
import { t as consumePrivateTraceResultMarker } from "./private-trace-result-CE7_lEdq.js";
|
|
5
5
|
// src/chat/sentry-payload-filter.ts
|
|
6
6
|
const PAYLOAD_ATTRIBUTE_KEYS = /* @__PURE__ */ new Set([
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as getChatConfig } from "./config-
|
|
2
|
-
import { E as withSpan, m as logInfo, p as logException } from "./logging-
|
|
1
|
+
import { i as getChatConfig } from "./config-BUP9wjiR.js";
|
|
2
|
+
import { E as withSpan, m as logInfo, p as logException } from "./logging-CjkDr-jP.js";
|
|
3
3
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { createHash, createHmac, timingSafeEqual } from "node:crypto";
|