@sentry/junior 0.255.0 → 0.257.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{admin-CeJh4SuR.js → admin-DgIkm6Vy.js} +1 -1
- package/dist/{agent-hooks-CDVx26Uu.js → agent-hooks-BjtTzvru.js} +13 -13
- package/dist/{agent-invocations-BY60iNw-.js → agent-invocations-Bdu3ROfo.js} +2 -1
- package/dist/{agent-runner-Caiof09f.js → agent-runner-D7OboVb3.js} +41 -33
- package/dist/api/schema.d.ts +41 -1
- package/dist/api/schema.js +2 -2
- package/dist/api.js +121 -33
- package/dist/{app-B0gT1Slp.d.ts → app-BsU5QNBd.d.ts} +7 -1
- package/dist/app.d.ts +1 -1
- package/dist/app.js +587 -210
- package/dist/{assistant-reply-BddmM66R.js → assistant-reply-CbTPebzL.js} +1 -1
- package/dist/{briefs-iVq_8-ft.js → briefs-oLOldnDM.js} +4 -4
- package/dist/{catalog-runtime-hKmI-iZa.js → catalog-runtime-CZzhGQ7F.js} +1 -1
- package/dist/cli/chat.js +16 -16
- package/dist/cli/check.js +3 -3
- package/dist/cli/main.js +2 -2
- package/dist/cli/plugins.js +4 -4
- package/dist/cli/snapshot-create.js +3 -3
- package/dist/cli/upgrade.js +3 -3
- package/dist/{client-Clj7onnT.js → client-D8HnkOQX.js} +2 -2
- package/dist/{config-BDAfLTI9.js → config-CJRnWK9H.js} +2 -2
- package/dist/{connections-BC0RTejT.js → connections-ClYrKzpX.js} +16 -11
- package/dist/{conversation-T18Xlkx9.js → conversation-CKNLYBJt.js} +3 -2
- package/dist/{conversation-privacy-1ERtieuM.js → conversation-privacy-C8b1nphZ.js} +1 -1
- package/dist/{credential-sync-BZuqqIHk.js → credential-sync-BXfohNmJ.js} +82 -40
- package/dist/{executor-Dh4Ofsnx.js → executor-Do0THDRR.js} +33 -23
- package/dist/{experimental-Qn9rKLgx.js → experimental-CQIvMUO7.js} +1 -0
- package/dist/{images-C-WOnTc_.js → images-BN_BiBXF.js} +3 -3
- package/dist/instrumentation.js +2 -2
- package/dist/{job-queue-BaCL36FY.js → job-queue-B6SV9uVa.js} +1 -1
- package/dist/{logging-D3aYP0aG.js → logging-CWxiIuCF.js} +50 -15
- package/dist/{message-B9xqD2BP.js → message-TUOdbSBW.js} +3 -3
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-callback-server-i5qdAou6.js → oauth-callback-server-Dj5UJODo.js} +2 -2
- package/dist/{pending-auth-D2t1Moxf.js → pending-auth-s_QFribU.js} +3 -3
- package/dist/{profile-DnkX3e2S.js → profile-h-72wM78.js} +4 -4
- package/dist/{prompt-C04mP1hu.js → prompt-DyoEj9c2.js} +1 -1
- package/dist/{registry-CmKmKHpp.js → registry-sLTr-sV9.js} +43 -3
- package/dist/{resolve-jfNHtEBx.js → resolve-ncQPZROQ.js} +2 -2
- package/dist/{result-Df5nEDX2.js → result-C883vngT.js} +7 -7
- package/dist/{runner-CmzoXEI4.js → runner-CzYImdOF.js} +10 -10
- package/dist/{sandbox-egress-signals-DjMNKLZz.js → sandbox-egress-signals-CZbMINHI.js} +1 -1
- package/dist/{schema-BBgv0MNf.js → schema-Dy69D4Ge.js} +4 -3
- package/dist/{session-stop-BEBfE97J.js → session-stop-CQjKd4a2.js} +46 -20
- package/dist/{skills-Dc-AMYi4.js → skills-C22SLruK.js} +2 -2
- package/dist/{spawn-OgTwBUj0.js → spawn-DY9CLXDL.js} +2 -2
- package/dist/{store-BashBewg.js → store-DXFIQy-G.js} +6 -6
- package/dist/{task-queue-VvIKqlQ4.js → task-queue-B17vV0La.js} +3 -3
- package/dist/{task-runner-D2CpD6GN.js → task-runner-DUjvzYXj.js} +11 -11
- package/dist/{tasks-dJooqiip.js → tasks-D_WIJtvO.js} +25 -10
- package/dist/{thread-state-CsMC-ob0.js → thread-state-Ch4yuCqG.js} +7 -7
- package/dist/{turn-failure-response-zB364t7_.js → turn-failure-response-C5nBKC4S.js} +8 -8
- package/dist/{turn-lifecycle-BfodfmiY.js → turn-lifecycle-CO-ylUmV.js} +1 -1
- package/dist/{turn-session-routing-BAh_qsBJ.js → turn-session-routing-B3LWooK5.js} +1 -1
- package/dist/{validation-LzIilOb6.js → validation-CXYxaNYx.js} +1 -1
- package/dist/{version-CDM8Rq6E.js → version-BcdZy2zg.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-Rnim7alE.js → viewer-DSZXygMU.js} +53 -5
- package/dist/{web-input-Dc1VwcT4.js → web-input-B9Bv0_lR.js} +73 -75
- package/dist/{work-BAn43SsN.js → work-nAfDSUFP.js} +9 -9
- package/dist/{worker-mBXq4_zg.js → worker-vGXZ6XFT.js} +5 -5
- package/migrations/0059_automation_run_version.sql +2 -0
- package/migrations/0060_identity_signed_in_at.sql +1 -0
- package/migrations/meta/0059_snapshot.json +3619 -0
- package/migrations/meta/0060_snapshot.json +3465 -0
- package/migrations/meta/_journal.json +15 -1
- package/package.json +6 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { r as completeObject } from "./client-
|
|
1
|
+
import { r as completeObject } from "./client-D8HnkOQX.js";
|
|
2
2
|
import { r as defaultModelId } from "./model-profile-BwU8mqwD.js";
|
|
3
|
-
import { U as parseBriefInput, d as conversationDetailReportSchema, p as conversationEventPageSchema, z as briefCodeChangeSchema } from "./conversation-
|
|
4
|
-
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-
|
|
3
|
+
import { U as parseBriefInput, d as conversationDetailReportSchema, p as conversationEventPageSchema, z as briefCodeChangeSchema } from "./conversation-CKNLYBJt.js";
|
|
4
|
+
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-DyoEj9c2.js";
|
|
5
5
|
import { CLI_USAGE } from "./cli/run.js";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import { z } from "zod";
|
|
@@ -269,7 +269,7 @@ async function parseRunOptions(argv) {
|
|
|
269
269
|
* `DATABASE_URL` at import, and `briefs pull` must work with only a token.
|
|
270
270
|
*/
|
|
271
271
|
async function configuredDefaultModelId() {
|
|
272
|
-
const { botConfig } = await import("./config-
|
|
272
|
+
const { botConfig } = await import("./config-CJRnWK9H.js").then((n) => n.r);
|
|
273
273
|
return defaultModelId(botConfig);
|
|
274
274
|
}
|
|
275
275
|
function apiUrl(baseUrl, pathname) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { t as createPluginCatalogRuntime } from "./registry-
|
|
2
|
+
import { t as createPluginCatalogRuntime } from "./registry-sLTr-sV9.js";
|
|
3
3
|
//#region 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-D7OboVb3.js";
|
|
2
2
|
import { t as loadAppPluginSet } from "../plugin-module-CVvEUSMH.js";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { createHash, randomUUID } from "node:crypto";
|
|
@@ -100,10 +100,10 @@ async function loadLocalPluginSet() {
|
|
|
100
100
|
async function configureLocalChatPlugins(pluginSet) {
|
|
101
101
|
const [pluginsModule, agentHooksModule, catalogRuntimeModule, validationModule, databaseModule] = await Promise.all([
|
|
102
102
|
import("../plugins-egKWjgue.js").then((n) => n.o),
|
|
103
|
-
import("../agent-hooks-
|
|
104
|
-
import("../catalog-runtime-
|
|
105
|
-
import("../validation-
|
|
106
|
-
import("../viewer-
|
|
103
|
+
import("../agent-hooks-BjtTzvru.js").then((n) => n.t),
|
|
104
|
+
import("../catalog-runtime-CZzhGQ7F.js").then((n) => n.t),
|
|
105
|
+
import("../validation-CXYxaNYx.js").then((n) => n.r),
|
|
106
|
+
import("../viewer-DSZXygMU.js").then((n) => n.c)
|
|
107
107
|
]);
|
|
108
108
|
const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
|
|
109
109
|
const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
|
|
@@ -153,21 +153,21 @@ function localDevServerUrl() {
|
|
|
153
153
|
async function prepareLocalChatRun(io, pluginSet) {
|
|
154
154
|
defaultStateAdapterForLocalChat();
|
|
155
155
|
await configureLocalChatPlugins(pluginSet);
|
|
156
|
-
const { setExperimentalFeatures } = await import("../experimental-
|
|
156
|
+
const { setExperimentalFeatures } = await import("../experimental-CQIvMUO7.js").then((n) => n.t);
|
|
157
157
|
setExperimentalFeatures({ subagents: true });
|
|
158
|
-
const { setBriefsConfig } = await import("../agent-hooks-
|
|
158
|
+
const { setBriefsConfig } = await import("../agent-hooks-BjtTzvru.js").then((n) => n.m);
|
|
159
159
|
setBriefsConfig({ enabled: true });
|
|
160
|
-
const { runLocalAgentTurn } = await import("../runner-
|
|
161
|
-
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-
|
|
160
|
+
const { runLocalAgentTurn } = await import("../runner-CzYImdOF.js");
|
|
161
|
+
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-Dj5UJODo.js");
|
|
162
162
|
const { createLocalOAuthState } = await import("../oauth-relay-CdCnu80W.js").then((n) => n.t);
|
|
163
|
-
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-
|
|
164
|
-
const { bindSpawnAgent } = await import("../spawn-
|
|
165
|
-
const { bindMessageAgent } = await import("../message-
|
|
166
|
-
const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-
|
|
167
|
-
const { startAgentInvocationsForChildInput } = await import("../result-
|
|
168
|
-
const { skipInputBeforeConversationStop } = await import("../session-stop-
|
|
163
|
+
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-CZbMINHI.js");
|
|
164
|
+
const { bindSpawnAgent } = await import("../spawn-DY9CLXDL.js").then((n) => n.n);
|
|
165
|
+
const { bindMessageAgent } = await import("../message-TUOdbSBW.js").then((n) => n.n);
|
|
166
|
+
const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-nAfDSUFP.js").then((n) => n.a);
|
|
167
|
+
const { startAgentInvocationsForChildInput } = await import("../result-C883vngT.js").then((n) => n.r);
|
|
168
|
+
const { skipInputBeforeConversationStop } = await import("../session-stop-CQjKd4a2.js").then((n) => n.r);
|
|
169
169
|
const { createLocalConversationWork } = await import("../conversation-work-C6y3T5Hx.js");
|
|
170
|
-
const { processConversationWork } = await import("../worker-
|
|
170
|
+
const { processConversationWork } = await import("../worker-vGXZ6XFT.js").then((n) => n.n);
|
|
171
171
|
let agentRunner;
|
|
172
172
|
const localConversationWork = createLocalConversationWork(async (message) => {
|
|
173
173
|
if (!agentRunner) throw new Error("Local agent runner is not ready");
|
package/dist/cli/check.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { i as parseSkillFile } from "../skills-
|
|
1
|
+
import { E as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, N as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, O as JUNIOR_HEARTBEAT_ROUTE } from "../logging-CWxiIuCF.js";
|
|
2
|
+
import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-sLTr-sV9.js";
|
|
3
|
+
import { i as parseSkillFile } from "../skills-C22SLruK.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,10 +25,10 @@ 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-DgIkm6Vy.js")).runAdmin(argv);
|
|
29
29
|
}
|
|
30
30
|
async function runBriefs(argv) {
|
|
31
|
-
return await (await import("../briefs-
|
|
31
|
+
return await (await import("../briefs-oLOldnDM.js")).runBriefs(argv);
|
|
32
32
|
}
|
|
33
33
|
function topLevelCommand(argv) {
|
|
34
34
|
return (argv[0] === "--" ? argv.slice(1) : argv)[0];
|
package/dist/cli/plugins.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as pluginCatalogRuntime } from "../catalog-runtime-
|
|
3
|
-
import { d as setPlugins, f as validatePlugins, ft as createPluginLogger } from "../agent-hooks-
|
|
4
|
-
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-
|
|
1
|
+
import { f as getDb } from "../viewer-DSZXygMU.js";
|
|
2
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime-CZzhGQ7F.js";
|
|
3
|
+
import { d as setPlugins, f as validatePlugins, ft as createPluginLogger } from "../agent-hooks-BjtTzvru.js";
|
|
4
|
+
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-CXYxaNYx.js";
|
|
5
5
|
import { a as pluginRuntimeRegistrationsFromPluginSet, i as pluginCliRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "../plugins-egKWjgue.js";
|
|
6
6
|
import { t as loadAppPluginSet } from "../plugin-module-CVvEUSMH.js";
|
|
7
7
|
import { stderr, stdout } from "node:process";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as pluginCatalogRuntime } from "../catalog-runtime-
|
|
2
|
-
import { S as disconnectStateAdapter, t as create } from "../profile-
|
|
3
|
-
import { r as resolve } from "../resolve-
|
|
1
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime-CZzhGQ7F.js";
|
|
2
|
+
import { S as disconnectStateAdapter, t as create } from "../profile-h-72wM78.js";
|
|
3
|
+
import { r as resolve } from "../resolve-ncQPZROQ.js";
|
|
4
4
|
//#region src/cli/snapshot-create.ts
|
|
5
5
|
const DEFAULT_RUNTIME = "node22";
|
|
6
6
|
const DEFAULT_TIMEOUT_MS = 6e5;
|
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-CJRnWK9H.js";
|
|
2
|
+
import { t as createJuniorSqlExecutor } from "../executor-Do0THDRR.js";
|
|
3
|
+
import { t as createPluginCatalogRuntime } from "../registry-sLTr-sV9.js";
|
|
4
4
|
import { n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "../plugins-egKWjgue.js";
|
|
5
5
|
import { t as loadAppPluginSet } from "../plugin-module-CVvEUSMH.js";
|
|
6
6
|
import { basename, dirname, join, resolve } from "node:path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-
|
|
1
|
+
import { T as withSpan, _ as serializeGenAiAttribute, f as logException, h as normalizeGenAiFinishReason, i as extractGenAiUsageAttributes, m as logWarn } from "./logging-CWxiIuCF.js";
|
|
2
|
+
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-C8b1nphZ.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-B4FMCO8f.js";
|
|
2
|
-
import { S as toOptionalTrimmed, o as resolveGatewayModel } from "./client-
|
|
3
|
-
import {
|
|
2
|
+
import { S as toOptionalTrimmed, o as resolveGatewayModel } from "./client-D8HnkOQX.js";
|
|
3
|
+
import { m as logWarn } from "./logging-CWxiIuCF.js";
|
|
4
4
|
import { l as TURN_REASONING_LEVELS, s as modelProfileSchema, t as DEFAULT_MODEL_PROFILES, u as parseTurnReasoningLevel } from "./model-profile-BwU8mqwD.js";
|
|
5
5
|
//#region src/chat/slack/emoji.ts
|
|
6
6
|
const SLACK_EMOJI_NAME_RE = /^(?:[a-z0-9_+-]+)(?:::(?:skin-tone-[2-6]))?$/;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { u as hasRequiredOAuthScope } from "./registry-
|
|
4
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
5
|
-
import {
|
|
6
|
-
import { w as getStateAdapter } from "./profile-
|
|
7
|
-
import { a as getVercelConversationWorkQueue } from "./job-queue-
|
|
8
|
-
import { m as ensureConversationWake, w as requestConversationWork } from "./store-
|
|
9
|
-
import { n as resolveTurnSessionRouting } from "./turn-session-routing-
|
|
1
|
+
import { Lt as startOAuthFlow, c as deleteMcpAuthSessionsForUserProvider, l as deleteMcpServerSessionId, u as deleteMcpStoredOAuthCredentials } from "./agent-runner-D7OboVb3.js";
|
|
2
|
+
import { A as deleteProviderIdentityForSlackUser, j as deleteProviderIdentityForUser, l as getConversationEventStore, p as getSqlExecutor } from "./viewer-DSZXygMU.js";
|
|
3
|
+
import { u as hasRequiredOAuthScope } from "./registry-sLTr-sV9.js";
|
|
4
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-CZzhGQ7F.js";
|
|
5
|
+
import { K as loadTurnCheckpoint, X as failTurnRecord, Z as getTurnRecord } from "./tasks-D_WIJtvO.js";
|
|
6
|
+
import { w as getStateAdapter } from "./profile-h-72wM78.js";
|
|
7
|
+
import { a as getVercelConversationWorkQueue } from "./job-queue-B6SV9uVa.js";
|
|
8
|
+
import { m as ensureConversationWake, w as requestConversationWork } from "./store-DXFIQy-G.js";
|
|
9
|
+
import { n as resolveTurnSessionRouting } from "./turn-session-routing-B3LWooK5.js";
|
|
10
10
|
import { z } from "zod";
|
|
11
11
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
12
12
|
//#region src/chat/task-execution/authorized-turn.ts
|
|
@@ -231,8 +231,13 @@ async function startConnection(provider, actor) {
|
|
|
231
231
|
authorizationUrl: request.authorizationUrl
|
|
232
232
|
};
|
|
233
233
|
}
|
|
234
|
-
/**
|
|
235
|
-
|
|
234
|
+
/**
|
|
235
|
+
* Remove the user's stored connection for one provider and the provider
|
|
236
|
+
* identity that the connection linked to the viewer's user.
|
|
237
|
+
*/
|
|
238
|
+
async function disconnectConnection(userId, provider, userTokenStore, viewerUserId) {
|
|
239
|
+
const tokens = await userTokenStore.get(userId, provider);
|
|
240
|
+
if (tokens?.account) await deleteProviderIdentityForUser(getSqlExecutor(), viewerUserId, provider, tokens.account.id);
|
|
236
241
|
await unlinkProvider(userId, provider, userTokenStore);
|
|
237
242
|
}
|
|
238
243
|
//#endregion
|
|
@@ -528,6 +528,7 @@ const conversationReportMessageEventDataSchema = z.object({
|
|
|
528
528
|
]),
|
|
529
529
|
source: z.enum(["slack", "web"]).optional(),
|
|
530
530
|
actorIdentity: actorIdentitySchema.optional(),
|
|
531
|
+
mentions: z.array(actorIdentitySchema).optional(),
|
|
531
532
|
eventType: z.string().min(1).optional(),
|
|
532
533
|
eventObjectType: objectTypeSchema.optional(),
|
|
533
534
|
explicitMention: z.boolean().optional(),
|
|
@@ -541,9 +542,9 @@ const conversationReportMessageEventDataSchema = z.object({
|
|
|
541
542
|
code: "custom",
|
|
542
543
|
message: "message content must be text or explicitly redacted"
|
|
543
544
|
});
|
|
544
|
-
if (data.redacted && (data.actorIdentity || data.cards || data.attachments)) context.addIssue({
|
|
545
|
+
if (data.redacted && (data.actorIdentity || data.mentions || data.cards || data.attachments)) context.addIssue({
|
|
545
546
|
code: "custom",
|
|
546
|
-
message: "redacted messages must not expose actor identity, cards, or attachments"
|
|
547
|
+
message: "redacted messages must not expose actor identity, mentions, cards, or attachments"
|
|
547
548
|
});
|
|
548
549
|
});
|
|
549
550
|
const conversationReportMessageHandledEventDataSchema = z.object({
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { Ft as
|
|
2
|
-
import { f as escapeXml } from "./client-
|
|
3
|
-
import {
|
|
4
|
-
import { a as getRuntimeMetadata, n as botConfig } from "./config-
|
|
1
|
+
import { Ft as parseOAuthStatePayload, It as resolveBaseUrl, Pt as formatProviderLabel, Rt as createUserTokenStore, _ as resolvePluginOAuthAccount, d as getMcpAuthSession, f as getMcpStoredOAuthCredentials, o as finalizeMcpAuthorization, p as putMcpStoredOAuthCredentials, s as deleteMcpAuthSession, x as lookupSlackUserProfile, xt as getMcpProviderErrorAttributes } from "./agent-runner-D7OboVb3.js";
|
|
2
|
+
import { f as escapeXml } from "./client-D8HnkOQX.js";
|
|
3
|
+
import { L as isNativeIdentityProvider, f as logException, g as runBestEffort, m as logWarn } from "./logging-CWxiIuCF.js";
|
|
4
|
+
import { a as getRuntimeMetadata, n as botConfig } from "./config-CJRnWK9H.js";
|
|
5
5
|
import { f as parseSlackUserId } from "./actor-BTtLaeWy.js";
|
|
6
|
-
import {
|
|
6
|
+
import { N as findUserByVerifiedEmails, R as upsertIdentity, p as getSqlExecutor, x as identityFromActor, z as upsertLinkedIdentity } from "./viewer-DSZXygMU.js";
|
|
7
7
|
import { i as homeDir } from "./package-discovery-BVvSnQBB.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 {
|
|
12
|
-
import { Ht as getSlackClient } from "./agent-hooks-
|
|
13
|
-
import { E as acquireActiveLock, w as getStateAdapter } from "./profile-
|
|
14
|
-
import { i as getConversationPendingAuth } from "./pending-auth-
|
|
15
|
-
import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-
|
|
16
|
-
import { c as deleteWebAuthorization, f as wakeAuthorizedTurn, i as readConnectedOAuthTokens, p as wakePausedTurn } from "./connections-
|
|
8
|
+
import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-sLTr-sV9.js";
|
|
9
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-CZzhGQ7F.js";
|
|
10
|
+
import { t as discoverSkills } from "./skills-C22SLruK.js";
|
|
11
|
+
import { B as postSlackMessage, Ft as recordAuthenticationLinked, It as recordAuthorizationCompleted, Z as getTurnRecord } from "./tasks-D_WIJtvO.js";
|
|
12
|
+
import { Ht as getSlackClient } from "./agent-hooks-BjtTzvru.js";
|
|
13
|
+
import { E as acquireActiveLock, w as getStateAdapter } from "./profile-h-72wM78.js";
|
|
14
|
+
import { i as getConversationPendingAuth } from "./pending-auth-s_QFribU.js";
|
|
15
|
+
import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-Ch4yuCqG.js";
|
|
16
|
+
import { c as deleteWebAuthorization, f as wakeAuthorizedTurn, i as readConnectedOAuthTokens, p as wakePausedTurn } from "./connections-ClYrKzpX.js";
|
|
17
17
|
import { n as relayLocalOAuthCallback } from "./oauth-relay-CdCnu80W.js";
|
|
18
18
|
import path from "node:path";
|
|
19
19
|
import { z } from "zod";
|
|
@@ -558,6 +558,57 @@ function oauthTokenErrorAttributes(provider, endpoint, status) {
|
|
|
558
558
|
function pluginAuthorizationId(args) {
|
|
559
559
|
return `${args.sessionId}:plugin:${args.provider}`;
|
|
560
560
|
}
|
|
561
|
+
/** Return the Junior user of the person who started the OAuth connection. */
|
|
562
|
+
async function resolveOAuthActorUserId(actor) {
|
|
563
|
+
if (actor.platform === "web") {
|
|
564
|
+
const observation = identityFromActor(actor.email ? {
|
|
565
|
+
email: actor.email,
|
|
566
|
+
...actor.fullName ? { fullName: actor.fullName } : void 0
|
|
567
|
+
} : void 0);
|
|
568
|
+
return observation ? (await upsertIdentity(getSqlExecutor(), observation)).userId : void 0;
|
|
569
|
+
}
|
|
570
|
+
const slackUserId = parseSlackUserId(actor.userId);
|
|
571
|
+
if (!slackUserId) throw new Error("OAuth Slack actor user id is invalid");
|
|
572
|
+
const profile = await lookupSlackUserProfile(slackUserId);
|
|
573
|
+
return (await upsertIdentity(getSqlExecutor(), {
|
|
574
|
+
kind: "user",
|
|
575
|
+
provider: "slack",
|
|
576
|
+
providerTenantId: actor.teamId,
|
|
577
|
+
providerSubjectId: profile.id,
|
|
578
|
+
displayName: profile.real_name || profile.display_name,
|
|
579
|
+
handle: profile.name,
|
|
580
|
+
...profile.email ? {
|
|
581
|
+
email: profile.email,
|
|
582
|
+
emailVerified: true
|
|
583
|
+
} : void 0
|
|
584
|
+
})).userId;
|
|
585
|
+
}
|
|
586
|
+
/**
|
|
587
|
+
* Link a connected provider account to the person who connected it.
|
|
588
|
+
*
|
|
589
|
+
* The actor's user wins. A provider-verified email that matches exactly one
|
|
590
|
+
* user links the account when the actor has no user, and is saved on the
|
|
591
|
+
* identity when it matches the actor's user.
|
|
592
|
+
*/
|
|
593
|
+
async function linkOAuthAccountIdentity(args) {
|
|
594
|
+
const executor = getSqlExecutor();
|
|
595
|
+
const actorUserId = await resolveOAuthActorUserId(args.actor);
|
|
596
|
+
const emailMatch = await findUserByVerifiedEmails(executor, args.verifiedEmails);
|
|
597
|
+
const userId = actorUserId ?? emailMatch?.userId;
|
|
598
|
+
if (!userId) throw new Error("OAuth account has no Junior user to link");
|
|
599
|
+
const email = emailMatch?.userId === userId ? emailMatch.email : void 0;
|
|
600
|
+
await upsertLinkedIdentity(executor, userId, {
|
|
601
|
+
kind: "user",
|
|
602
|
+
provider: args.provider,
|
|
603
|
+
providerSubjectId: args.account.id,
|
|
604
|
+
displayName: args.account.displayName,
|
|
605
|
+
handle: args.account.handle ?? args.account.label,
|
|
606
|
+
...email ? {
|
|
607
|
+
email,
|
|
608
|
+
emailVerified: true
|
|
609
|
+
} : void 0
|
|
610
|
+
});
|
|
611
|
+
}
|
|
561
612
|
/** Queue the pending Turn, including a newer Turn that reused this auth link. */
|
|
562
613
|
async function wakeAuthorizedPluginTurn(stored, options) {
|
|
563
614
|
if (!stored.resumeConversationId || !stored.resumeSessionId || !stored.destination) return;
|
|
@@ -640,8 +691,9 @@ async function GET(request, provider, waitUntil, options) {
|
|
|
640
691
|
return htmlErrorResponse("Connection failed", "The token exchange with the provider failed. Please try again.", 500);
|
|
641
692
|
}
|
|
642
693
|
let parsedTokenResponse;
|
|
694
|
+
let tokenData;
|
|
643
695
|
try {
|
|
644
|
-
|
|
696
|
+
tokenData = await tokenResponse.json();
|
|
645
697
|
parsedTokenResponse = parseOAuthTokenResponse(tokenData, requestedScope, { treatEmptyScopeAsUnreported: providerConfig.treatEmptyScopeAsUnreported });
|
|
646
698
|
} catch {
|
|
647
699
|
logWarn("oauth.token_exchange.failed", oauthTokenErrorAttributes(provider, providerConfig.tokenEndpoint, tokenResponse.status));
|
|
@@ -650,11 +702,18 @@ async function GET(request, provider, waitUntil, options) {
|
|
|
650
702
|
if (!hasRequiredOAuthScope(parsedTokenResponse.scope, requestedScope)) return htmlErrorResponse("Connection failed", `The ${providerLabel} authorization did not grant the access Junior requires. Return to Junior and connect your ${providerLabel} account again.`, 400);
|
|
651
703
|
const userTokenStore = createUserTokenStore();
|
|
652
704
|
let account;
|
|
705
|
+
let verifiedEmails = [];
|
|
653
706
|
try {
|
|
654
|
-
|
|
707
|
+
const resolved = await resolvePluginOAuthAccount({
|
|
655
708
|
provider,
|
|
709
|
+
tokenResponse: tokenData,
|
|
656
710
|
tokens: parsedTokenResponse
|
|
657
711
|
});
|
|
712
|
+
if (resolved) {
|
|
713
|
+
const { verifiedEmails: emails, ...rest } = resolved;
|
|
714
|
+
account = rest;
|
|
715
|
+
verifiedEmails = emails ?? [];
|
|
716
|
+
}
|
|
658
717
|
} catch {
|
|
659
718
|
return htmlErrorResponse("Connection failed", `Junior could not verify the connected ${providerLabel} account. Please try again.`, 500);
|
|
660
719
|
}
|
|
@@ -662,30 +721,13 @@ async function GET(request, provider, waitUntil, options) {
|
|
|
662
721
|
...parsedTokenResponse,
|
|
663
722
|
...account ? { account } : void 0
|
|
664
723
|
});
|
|
665
|
-
const
|
|
666
|
-
if (account &&
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
const slackIdentity = await upsertIdentity(getSqlExecutor(), {
|
|
671
|
-
kind: "user",
|
|
672
|
-
provider: "slack",
|
|
673
|
-
providerTenantId: slackActor.teamId,
|
|
674
|
-
providerSubjectId: profile.id,
|
|
675
|
-
displayName: profile.real_name || profile.display_name,
|
|
676
|
-
handle: profile.name,
|
|
677
|
-
...profile.email ? {
|
|
678
|
-
email: profile.email,
|
|
679
|
-
emailVerified: true
|
|
680
|
-
} : void 0
|
|
681
|
-
});
|
|
682
|
-
if (!slackIdentity.userId) throw new Error("OAuth Slack identity is not linked to a user");
|
|
683
|
-
await upsertLinkedIdentity(getSqlExecutor(), slackIdentity.userId, {
|
|
684
|
-
kind: "user",
|
|
724
|
+
const linkActor = stored.actor;
|
|
725
|
+
if (account && !isNativeIdentityProvider(provider) && (linkActor?.platform === "slack" || linkActor?.platform === "web")) await runBestEffort(async () => {
|
|
726
|
+
await linkOAuthAccountIdentity({
|
|
727
|
+
account,
|
|
728
|
+
actor: linkActor,
|
|
685
729
|
provider,
|
|
686
|
-
|
|
687
|
-
displayName: account.displayName,
|
|
688
|
-
handle: account.handle ?? account.label
|
|
730
|
+
verifiedEmails
|
|
689
731
|
});
|
|
690
732
|
}, "oauth.callback.identity_link.failed", { "app.credential.provider": provider });
|
|
691
733
|
const resumeConversationId = stored.resumeConversationId;
|
|
@@ -813,4 +855,4 @@ async function receiveLocalOAuthCredential(request) {
|
|
|
813
855
|
return new Response(null, { status: 204 });
|
|
814
856
|
}
|
|
815
857
|
//#endregion
|
|
816
|
-
export { GET$1 as a, publishAppHomeView as i, syncLocalOAuthCredential as n, GET as r, receiveLocalOAuthCredential as t };
|
|
858
|
+
export { GET$1 as a, publishAppHomeView as i, syncLocalOAuthCredential as n, htmlCallbackResponse as o, GET as r, receiveLocalOAuthCredential as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { f as logException } from "./logging-CWxiIuCF.js";
|
|
2
2
|
import { g as startSpanManual } from "./sentry-CgWZM_kV.js";
|
|
3
|
-
import "./config-
|
|
4
|
-
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-
|
|
3
|
+
import "./config-CJRnWK9H.js";
|
|
4
|
+
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-Bdu3ROfo.js";
|
|
5
5
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
6
6
|
import { sql } from "drizzle-orm";
|
|
7
7
|
import { bigint, boolean, check, date, doublePrecision, foreignKey, index, integer, jsonb, pgTable, primaryKey, text, uniqueIndex, uuid } from "drizzle-orm/pg-core";
|
|
@@ -338,6 +338,25 @@ const juniorAutomations = pgTable("junior_automations", {
|
|
|
338
338
|
index("junior_automations_match_idx").on(table.namespace, table.identifier, table.createdAtMs, table.id).where(sql`${table.status} <> 'deleted'`)
|
|
339
339
|
]);
|
|
340
340
|
//#endregion
|
|
341
|
+
//#region src/db/schema/automation-versions.ts
|
|
342
|
+
/** One saved Automation definition. Lifecycle and scheduler state are not versioned. */
|
|
343
|
+
const juniorAutomationVersions = pgTable("junior_automation_versions", {
|
|
344
|
+
automationId: text("automation_id").notNull(),
|
|
345
|
+
/** Starts at 1 and increases by 1 for each saved definition change. */
|
|
346
|
+
version: integer("version").notNull(),
|
|
347
|
+
createdAtMs: bigint("created_at_ms", { mode: "number" }).notNull(),
|
|
348
|
+
/** Slack principal that saved this definition. Null when unknown. */
|
|
349
|
+
editedBy: jsonb("edited_by"),
|
|
350
|
+
definition: jsonb("definition").notNull()
|
|
351
|
+
}, (table) => [primaryKey({
|
|
352
|
+
name: "junior_automation_versions_pk",
|
|
353
|
+
columns: [table.automationId, table.version]
|
|
354
|
+
}), foreignKey({
|
|
355
|
+
name: "junior_automation_versions_automation_id_fk",
|
|
356
|
+
columns: [table.automationId],
|
|
357
|
+
foreignColumns: [juniorAutomations.id]
|
|
358
|
+
}).onDelete("cascade")]);
|
|
359
|
+
//#endregion
|
|
341
360
|
//#region src/db/schema/automation-runs.ts
|
|
342
361
|
/**
|
|
343
362
|
* One dispatch of an Automation, from claim or dispatch to its outcome. A
|
|
@@ -345,12 +364,17 @@ const juniorAutomations = pgTable("junior_automations", {
|
|
|
345
364
|
* automation run id is its dispatch id. Automation code sets
|
|
346
365
|
* `conversation_id` when it dispatches the run. A run that was skipped, or
|
|
347
366
|
* that failed before dispatch, has no Conversation.
|
|
367
|
+
*
|
|
368
|
+
* `automation_version` is the Automation version that the run dispatched. It
|
|
369
|
+
* shows which instruction ran and who saved it after the definition changes.
|
|
370
|
+
* It is null before dispatch, and when no saved version matched.
|
|
348
371
|
*/
|
|
349
372
|
const juniorAutomationRuns = pgTable("junior_automation_runs", {
|
|
350
373
|
id: text("id").primaryKey(),
|
|
351
374
|
automationId: text("automation_id").notNull().references(() => juniorAutomations.id, { onDelete: "cascade" }),
|
|
352
375
|
conversationId: text("conversation_id").unique().references(() => juniorConversations.conversationId),
|
|
353
376
|
status: text("status").$type().notNull(),
|
|
377
|
+
automationVersion: integer("automation_version"),
|
|
354
378
|
scheduledForMs: bigint("scheduled_for_ms", { mode: "number" }),
|
|
355
379
|
attempt: integer("attempt"),
|
|
356
380
|
claimedAtMs: bigint("claimed_at_ms", { mode: "number" }),
|
|
@@ -360,31 +384,17 @@ const juniorAutomationRuns = pgTable("junior_automation_runs", {
|
|
|
360
384
|
errorMessage: text("error_message"),
|
|
361
385
|
resultMessageTs: text("result_message_ts")
|
|
362
386
|
}, (table) => [
|
|
387
|
+
foreignKey({
|
|
388
|
+
name: "junior_automation_runs_automation_version_fk",
|
|
389
|
+
columns: [table.automationId, table.automationVersion],
|
|
390
|
+
foreignColumns: [juniorAutomationVersions.automationId, juniorAutomationVersions.version]
|
|
391
|
+
}),
|
|
363
392
|
check("junior_automation_runs_status_check", sql`${table.status} in ('pending', 'running', 'completed', 'failed', 'blocked', 'skipped')`),
|
|
364
393
|
index("junior_automation_runs_automation_idx").on(table.automationId, table.completedAtMs),
|
|
365
394
|
index("junior_automation_runs_completed_idx").on(table.completedAtMs),
|
|
366
395
|
index("junior_automation_runs_incomplete_idx").on(table.automationId, table.scheduledForMs).where(sql`${table.status} in ('pending', 'running')`)
|
|
367
396
|
]);
|
|
368
397
|
//#endregion
|
|
369
|
-
//#region src/db/schema/automation-versions.ts
|
|
370
|
-
/** One saved Automation definition. Lifecycle and scheduler state are not versioned. */
|
|
371
|
-
const juniorAutomationVersions = pgTable("junior_automation_versions", {
|
|
372
|
-
automationId: text("automation_id").notNull(),
|
|
373
|
-
/** Starts at 1 and increases by 1 for each saved definition change. */
|
|
374
|
-
version: integer("version").notNull(),
|
|
375
|
-
createdAtMs: bigint("created_at_ms", { mode: "number" }).notNull(),
|
|
376
|
-
/** Slack principal that saved this definition. Null when unknown. */
|
|
377
|
-
editedBy: jsonb("edited_by"),
|
|
378
|
-
definition: jsonb("definition").notNull()
|
|
379
|
-
}, (table) => [primaryKey({
|
|
380
|
-
name: "junior_automation_versions_pk",
|
|
381
|
-
columns: [table.automationId, table.version]
|
|
382
|
-
}), foreignKey({
|
|
383
|
-
name: "junior_automation_versions_automation_id_fk",
|
|
384
|
-
columns: [table.automationId],
|
|
385
|
-
foreignColumns: [juniorAutomations.id]
|
|
386
|
-
}).onDelete("cascade")]);
|
|
387
|
-
//#endregion
|
|
388
398
|
//#region src/db/schema/workspaces.ts
|
|
389
399
|
/** Named recipe used to prepare a reusable Sandbox. */
|
|
390
400
|
const juniorWorkspaces = pgTable("junior_workspaces", {
|
|
@@ -1006,4 +1016,4 @@ function createJuniorSqlExecutor(args) {
|
|
|
1006
1016
|
});
|
|
1007
1017
|
}
|
|
1008
1018
|
//#endregion
|
|
1009
|
-
export { juniorConversationAnnotations as _,
|
|
1019
|
+
export { juniorConversationAnnotations as _, juniorAutomationRuns as a, juniorAttachments as b, juniorStats as c, juniorConversationBindings as d, juniorConversationBriefs as f, juniorApiTokens as g, juniorConversationEvents as h, juniorWorkspaces as i, juniorLocationConfigurations as l, juniorConversationMetrics as m, juniorSnapshots as n, juniorAutomationVersions as o, CONVERSATION_METRICS as p, juniorWorkspaceRepos as r, juniorAutomations as s, createJuniorSqlExecutor as t, juniorConversationParticipants as u, juniorCodeChanges as v, juniorArtifacts as x, juniorCodeRepositories as y };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { D as storeAttachment, T as readLiveAttachment } from "./agent-runner-
|
|
3
|
-
import {
|
|
4
|
-
import { L as detectImageMediaType } from "./conversation-
|
|
2
|
+
import { D as storeAttachment, T as readLiveAttachment } from "./agent-runner-D7OboVb3.js";
|
|
3
|
+
import { p as getSqlExecutor } from "./viewer-DSZXygMU.js";
|
|
4
|
+
import { L as detectImageMediaType } from "./conversation-CKNLYBJt.js";
|
|
5
5
|
//#region src/chat/attachments/images.ts
|
|
6
6
|
var images_exports = /* @__PURE__ */ __exportAll({
|
|
7
7
|
decodeInputImages: () => decodeInputImages,
|
package/dist/instrumentation.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { F as getDeploymentTelemetryAttributes, P as getDeploymentServiceVersion } from "./logging-CWxiIuCF.js";
|
|
2
2
|
import { _ as vercelAIIntegration, a as getClient, b as withStreamedSpan, c as init, o as getGlobalScope } from "./sentry-CgWZM_kV.js";
|
|
3
|
-
import { n as getCurrentConversationPrivacy } from "./conversation-privacy-
|
|
3
|
+
import { n as getCurrentConversationPrivacy } from "./conversation-privacy-C8b1nphZ.js";
|
|
4
4
|
import { t as consumePrivateTraceResultMarker } from "./private-trace-result-BLvBjy_e.js";
|
|
5
5
|
//#region src/chat/sentry-payload-filter.ts
|
|
6
6
|
const PAYLOAD_ATTRIBUTE_KEYS = /* @__PURE__ */ new Set([
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as getChatConfig } from "./config-
|
|
1
|
+
import { i as getChatConfig } from "./config-CJRnWK9H.js";
|
|
2
2
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { createHash, createHmac, timingSafeEqual } from "node:crypto";
|