@sentry/junior 0.225.0 → 0.227.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/{agent-hooks-CRuRcOg9.js → agent-hooks-bEwEJhlg.js} +231 -17
- package/dist/{agent-runner-Cad1RtWn.js → agent-runner-BGDSjciH.js} +2899 -159
- package/dist/api/schema.d.ts +417 -15
- package/dist/api/schema.js +4 -4
- package/dist/api.js +57 -32
- package/dist/{app-BbSD6EtD.d.ts → app-CjRIKZb5.d.ts} +1 -1
- package/dist/app.d.ts +1 -1
- package/dist/app.js +971 -7685
- package/dist/{briefs-BtnkPWT5.js → briefs-BkM_ZW4B.js} +4 -4
- package/dist/{catalog-runtime-pv4grNNb.js → catalog-runtime-Cw9V2jpn.js} +1 -1
- package/dist/{checkpoint-6fkAdB3g.js → checkpoint-oZYD3-Ar.js} +77 -11
- package/dist/cli/chat.js +13 -13
- package/dist/cli/check.js +3 -3
- package/dist/cli/main.js +1 -1
- package/dist/cli/plugins.js +3 -3
- package/dist/cli/snapshot-create.js +3 -3
- package/dist/cli/upgrade.js +3 -3
- package/dist/{client-ihmkx60d.js → client-Pcxo3lGn.js} +2 -2
- package/dist/{config-DMg679BW.js → config-CYvEow1F.js} +2 -2
- package/dist/{context-Bplcgypl.js → context-0Et9iVSB.js} +1 -1
- package/dist/{conversation-Bygi39Xj.js → conversation-BnhOMfEB.js} +113 -25
- package/dist/{conversation-privacy-ZYy05Y3q.js → conversation-privacy-hQmyZbOC.js} +1 -1
- package/dist/{credential-sync-DCB2SwnQ.js → credential-sync-CUGbiiCM.js} +15 -135
- package/dist/{executor-B9R4cHte.js → executor-BXMlFrV6.js} +1 -1
- package/dist/history-nukv1YN8.d.ts +127 -0
- package/dist/images-8siTAUNW.js +82 -0
- package/dist/instrumentation.js +2 -2
- package/dist/{vercel-queue-DIkVcfK4.js → job-queue-AI0_QAgc.js} +61 -2
- package/dist/{logging-CcTvYQ8A.js → logging-BPBx6WF-.js} +1 -1
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -4
- package/dist/{oauth-authorization-BS4vPJmu.js → oauth-authorization-Cq1GaLIP.js} +1 -1
- package/dist/{oauth-callback-server-DnlQsGBJ.js → oauth-callback-server-CnF03VYh.js} +2 -2
- package/dist/pending-auth-CHUjr_6d.js +59 -0
- package/dist/{profile-CV97YuiL.js → profile-upzC-wN1.js} +4 -4
- package/dist/{prompt-CL8zxsmm.js → prompt-CZIQcPHy.js} +1 -1
- package/dist/{registry-C8I4IejN.js → registry-DM5aMhjm.js} +2 -2
- package/dist/{resolve-DXVAzYa3.js → resolve-sF6Lg7Ay.js} +2 -2
- package/dist/{runner-Die1RJ_z.js → runner-Bu2wYpK8.js} +10 -10
- package/dist/{sandbox-egress-signals-BZepyVh1.js → sandbox-egress-signals-Dgerhizb.js} +1 -1
- package/dist/{schema-BE4uso4i.js → schema-BSiwcvjm.js} +2 -2
- package/dist/{skills-DUcDEgDI.js → skills-CAI5s___.js} +2 -2
- package/dist/{spawn-o15i3tJu.js → spawn-DRK9TBgY.js} +2 -2
- package/dist/{task-queue-D3PLY59C.js → task-queue-iuDAqfZg.js} +3 -4
- package/dist/{task-runner-BMl2aM2v.js → task-runner-S3QtH38c.js} +381 -12
- package/dist/{thread-state-CAR6gdAm.js → thread-state-C_arVuaN.js} +5 -5
- package/dist/{turn-failure-response-CZyoUMkD.js → turn-failure-response-DarwGYgC.js} +9 -10
- package/dist/{turn-lifecycle-DPDHKi2U.js → turn-lifecycle-CdiIejXH.js} +1 -1
- package/dist/{turn-session-routing-Jkmmxpp-.js → turn-session-routing-DyLGd_wU.js} +1 -1
- package/dist/{validation-BcGGxOa6.js → validation-BMig74Zp.js} +1 -1
- package/dist/{version-DYcuOFQb.js → version-lhQSfLjx.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/web-authorization-r2lKYKJ2.js +162 -0
- package/dist/web-input-BU-Fu7iq.js +7784 -0
- package/dist/{reporting-window-DbUqng0P.js → web-message-id-xPI_EFSC.js} +11 -1
- package/dist/{work-Bm90pR9P.js → work-B9koS8sW.js} +7 -8
- package/dist/{worker-BvHr6JhE.js → worker-C_iJSRgG.js} +5 -6
- package/package.json +5 -4
- package/dist/execution-stats-CR9CYpyj.js +0 -373
- package/dist/history-yaSjGMD_.d.ts +0 -65
- package/dist/job-queue-D2SiTrnt.js +0 -63
- package/dist/short-title-3wYH3ipl.js +0 -71
- package/dist/stats-DawHjcTw.js +0 -2758
- package/dist/web-authorization-B09B8A8R.js +0 -38
- package/dist/web-input-CGE58TpK.js +0 -899
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { r as completeObject } from "./client-
|
|
1
|
+
import { r as completeObject } from "./client-Pcxo3lGn.js";
|
|
2
2
|
import { r as defaultModelId } from "./model-profile-BwU8mqwD.js";
|
|
3
|
-
import {
|
|
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-BnhOMfEB.js";
|
|
4
|
+
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-CZIQcPHy.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-CYvEow1F.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-DM5aMhjm.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();
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { i as completeText, m as escapeXml, o as resolveGatewayModel, p as unwrapCurrentInstruction } from "./client-
|
|
2
|
-
import { d as logException, o as getActiveTraceId, p as logWarn, t as buildTurnFailureResponse, v as setSpanAttributes } from "./logging-
|
|
3
|
-
import { n as botConfig } from "./config-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { D as fenceLock, O as withLock, T as MUTATION_LOCK_TTL_MS, k as sleep, w as getStateAdapter } from "./profile-CV97YuiL.js";
|
|
1
|
+
import { i as completeText, m as escapeXml, o as resolveGatewayModel, p as unwrapCurrentInstruction } from "./client-Pcxo3lGn.js";
|
|
2
|
+
import { d as logException, o as getActiveTraceId, p as logWarn, t as buildTurnFailureResponse, v as setSpanAttributes } from "./logging-BPBx6WF-.js";
|
|
3
|
+
import { n as botConfig } from "./config-CYvEow1F.js";
|
|
4
|
+
import { b as parseSlackMessageTs, f as toStoredSlackActor } from "./context-0Et9iVSB.js";
|
|
5
|
+
import { Gt as JUNIOR_NATIVE_EVENT_NAMESPACE, Jt as authenticationUnlinkedEvent, Kt as agentsInstructionsUpdatedEvent, Qt as getConversationStore, Xt as getConversationEventStore, an as bindProviderConversation, en as getSqlExecutor, nn as withConversationEventLock, qt as authenticationLinkedEvent, sn as addAgentTurnUsage, tn as createSqlConversationEventStore } from "./agent-hooks-bEwEJhlg.js";
|
|
6
|
+
import { $ as contextProvenance, G as agentHistoryItemSchema, et as instructionActors, tt as instructionProvenanceFor } from "./conversation-BnhOMfEB.js";
|
|
7
|
+
import { D as fenceLock, O as withLock, T as MUTATION_LOCK_TTL_MS, k as sleep, w as getStateAdapter } from "./profile-upzC-wN1.js";
|
|
9
8
|
import { isDeepStrictEqual } from "node:util";
|
|
10
9
|
import { z } from "zod";
|
|
11
10
|
import { createHash } from "node:crypto";
|
|
@@ -440,6 +439,73 @@ function isHumanConversationMessage(message) {
|
|
|
440
439
|
function getConversationMessageSlackTs(message) {
|
|
441
440
|
return parseSlackMessageTs(message.meta?.slackTs);
|
|
442
441
|
}
|
|
442
|
+
const TITLE_PROMPTS = {
|
|
443
|
+
conversation: [
|
|
444
|
+
"Generate a concise 5-8 word conversation title from the first user message below.",
|
|
445
|
+
"Capture the user's main request.",
|
|
446
|
+
"Reply with ONLY the title, with no quotes or trailing punctuation."
|
|
447
|
+
],
|
|
448
|
+
task: [
|
|
449
|
+
"Generate a concise 5-8 word task title from the task instruction below.",
|
|
450
|
+
"Capture the task's main purpose.",
|
|
451
|
+
"Reply with ONLY the title, with no quotes or trailing punctuation."
|
|
452
|
+
]
|
|
453
|
+
};
|
|
454
|
+
/** Collapse whitespace and cap a candidate short title. */
|
|
455
|
+
function normalizeShortTitle(value) {
|
|
456
|
+
return value.replace(/\s+/g, " ").trim().slice(0, 60);
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
* Deterministic display title when no generated title is stored.
|
|
460
|
+
* Uses the first non-empty line of the source text, capped like generated titles.
|
|
461
|
+
*/
|
|
462
|
+
function fallbackShortTitle(sourceText, fallback = "Untitled") {
|
|
463
|
+
return normalizeShortTitle(sourceText.split(/\r?\n/).map((line) => line.trim()).find((line) => line.length > 0) ?? "") || fallback;
|
|
464
|
+
}
|
|
465
|
+
/** Generate a short title with the fast model, or return undefined on failure. */
|
|
466
|
+
async function generateShortTitle(args) {
|
|
467
|
+
args.signal?.throwIfAborted();
|
|
468
|
+
const sourceText = args.sourceText.trim();
|
|
469
|
+
if (!sourceText) return void 0;
|
|
470
|
+
try {
|
|
471
|
+
const result = await args.completeText({
|
|
472
|
+
signal: args.signal,
|
|
473
|
+
modelId: botConfig.fastModelId,
|
|
474
|
+
temperature: 0,
|
|
475
|
+
promptName: `junior.${args.kind}_title`,
|
|
476
|
+
messages: [{
|
|
477
|
+
role: "user",
|
|
478
|
+
content: [
|
|
479
|
+
...TITLE_PROMPTS[args.kind],
|
|
480
|
+
"",
|
|
481
|
+
args.kind === "conversation" ? `First user message: ${sourceText.slice(0, 500)}` : `Task instruction: ${sourceText.slice(0, 500)}`
|
|
482
|
+
].join("\n"),
|
|
483
|
+
timestamp: Date.now()
|
|
484
|
+
}],
|
|
485
|
+
metadata: { modelId: botConfig.fastModelId }
|
|
486
|
+
});
|
|
487
|
+
args.signal?.throwIfAborted();
|
|
488
|
+
return normalizeShortTitle(result.text) || void 0;
|
|
489
|
+
} catch (error) {
|
|
490
|
+
args.signal?.throwIfAborted();
|
|
491
|
+
logWarn(`${args.kind}.title.generation.failed`, { "exception.message": error instanceof Error ? error.message : String(error) });
|
|
492
|
+
return;
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
/**
|
|
496
|
+
* Prefer an explicit task title when provided; otherwise generate one from the
|
|
497
|
+
* instruction with the fast model.
|
|
498
|
+
*/
|
|
499
|
+
async function resolveTaskTitle(args) {
|
|
500
|
+
const explicit = normalizeShortTitle(args.title ?? "");
|
|
501
|
+
if (explicit) return explicit;
|
|
502
|
+
return generateShortTitle({
|
|
503
|
+
completeText: args.completeText,
|
|
504
|
+
kind: "task",
|
|
505
|
+
sourceText: args.instruction,
|
|
506
|
+
signal: args.signal
|
|
507
|
+
});
|
|
508
|
+
}
|
|
443
509
|
//#endregion
|
|
444
510
|
//#region src/chat/services/conversation-title.ts
|
|
445
511
|
const inFlightTitles = /* @__PURE__ */ new Map();
|
|
@@ -735,9 +801,9 @@ var AgentHistoryBranchError = class extends Error {
|
|
|
735
801
|
this.name = "AgentHistoryBranchError";
|
|
736
802
|
}
|
|
737
803
|
};
|
|
738
|
-
/**
|
|
804
|
+
/** Snapshot Pi's JSON message without changing text or nested object order. */
|
|
739
805
|
function normalizeDurableMessage(message) {
|
|
740
|
-
return piMessageSchema.parse(JSON.parse(JSON.stringify(
|
|
806
|
+
return piMessageSchema.parse(JSON.parse(JSON.stringify(message)));
|
|
741
807
|
}
|
|
742
808
|
/**
|
|
743
809
|
* Identity used for append-only prefix checks.
|
|
@@ -2075,4 +2141,4 @@ async function saveDone(args) {
|
|
|
2075
2141
|
});
|
|
2076
2142
|
}
|
|
2077
2143
|
//#endregion
|
|
2078
|
-
export {
|
|
2144
|
+
export { fallbackShortTitle as $, commitAcceptedReply as A, recordAuthorizationCompleted as B, isToolResultError as C, stripRuntimeTurnContext as D, retainRuntimeTurnContext as E, loadTurnRoute as F, recordToolExecutionStarted as G, recordGuardianActionReviewed as H, openConversationProjection as I, hydrateConversationMessages as J, recordTurnRoute as K, recordAgentsInstructionsUpdated as L, loadConnectedMcpProviders as M, loadConversationProjection as N, trimTrailingAssistantMessages as O, loadProjection as P, resolveConversationTitle as Q, recordAttachmentsDelivered as R, isContinuablePiBoundary as S, normalizeToolNameFromResult as T, recordMcpProviderConnected as U, recordAuthorizationRequested as V, recordSubscribedReplyRoute as W, projectConversationMessages as X, persistConversationMessages as Y, persistConversationMessageSummaries as Z, getTerminalAssistantMessages as _, piMessageFromHistoryItem as _t, completeTurnRecord as a, estimateConversationContextTokens as at, instructionTextForProjection as b, listTurnSummaries as c, markConversationMessage as ct, TurnSliceLimitExceededError as d, turnHasReply as dt, generateShortTitle as et, assertTurnToolCallLimit as f, upsertConversationMessage as ft, getPiMessageRole as g, historyItemFromPiMessage as gt, extractAssistantText as h, getAgentContextInputLimitTokens as ht, abandonTurnRecord as i, createConversationMemoryService as it, commitMessages as j, TURN_CONTEXT_TAG as k, recordTurnSummary as l, normalizeConversationText as lt, isTurnExecutionLimitExceededError as m, getAgentContextCompactionTriggerTokens as mt, loadTurnCheckpoint as n, appendThreadContextMessages as nt, failTurnRecord as o, getConversationMessageSlackTs as ot, buildTurnErrorResponse as p, estimateTextTokens as pt, appendConversationMessages as q, saveTurnCheckpoint as r, buildConversationContext as rt, getTurnRecord as s, isHumanConversationMessage as st, continuableMessages as t, resolveTaskTitle as tt, persistWithRetry as u, recordDeliveredAssistantMessage as ut, getUserMessageInstructionText as v, isToolResultMessage as w, isAssistantMessage as x, hasRuntimeTurnContext as y, recordAuthenticationLinked as z };
|
package/dist/cli/chat.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as executeAgentRun, t as createAgentRunner } from "../agent-runner-
|
|
1
|
+
import { s as executeAgentRun, t as createAgentRunner } from "../agent-runner-BGDSjciH.js";
|
|
2
2
|
import { t as loadAppPluginSet } from "../plugin-module-BKGOXca2.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("../agent-hooks-
|
|
103
|
+
import("../agent-hooks-bEwEJhlg.js").then((n) => n.t),
|
|
104
|
+
import("../catalog-runtime-Cw9V2jpn.js").then((n) => n.t),
|
|
105
|
+
import("../validation-BMig74Zp.js").then((n) => n.r),
|
|
106
|
+
import("../agent-hooks-bEwEJhlg.js").then((n) => n.Yt)
|
|
107
107
|
]);
|
|
108
108
|
const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
|
|
109
109
|
const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
|
|
@@ -153,18 +153,18 @@ function localDevServerUrl() {
|
|
|
153
153
|
async function prepareLocalChatRun(io, pluginSet) {
|
|
154
154
|
defaultStateAdapterForLocalChat();
|
|
155
155
|
await configureLocalChatPlugins(pluginSet);
|
|
156
|
-
const { setExperimentalFeatures } = await import("../agent-runner-
|
|
156
|
+
const { setExperimentalFeatures } = await import("../agent-runner-BGDSjciH.js").then((n) => n.r);
|
|
157
157
|
setExperimentalFeatures({ subagents: true });
|
|
158
|
-
const { setBriefsConfig } = await import("../agent-hooks-
|
|
158
|
+
const { setBriefsConfig } = await import("../agent-hooks-bEwEJhlg.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-Bu2wYpK8.js");
|
|
161
|
+
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-CnF03VYh.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 { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-
|
|
163
|
+
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-Dgerhizb.js");
|
|
164
|
+
const { bindSpawnAgent } = await import("../spawn-DRK9TBgY.js").then((n) => n.n);
|
|
165
|
+
const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-B9koS8sW.js").then((n) => n.a);
|
|
166
166
|
const { createLocalConversationWork } = await import("../conversation-work-C6y3T5Hx.js");
|
|
167
|
-
const { processConversationWork } = await import("../worker-
|
|
167
|
+
const { processConversationWork } = await import("../worker-C_iJSRgG.js").then((n) => n.n);
|
|
168
168
|
let agentRunner;
|
|
169
169
|
const localConversationWork = createLocalConversationWork(async (message) => {
|
|
170
170
|
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_HEARTBEAT_ROUTE, M as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, T as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-
|
|
2
|
-
import { f as parseInlinePluginManifest, p as parsePluginManifest } from "../registry-
|
|
3
|
-
import { i as parseSkillFile } from "../skills-
|
|
1
|
+
import { D as JUNIOR_HEARTBEAT_ROUTE, M as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, T as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-BPBx6WF-.js";
|
|
2
|
+
import { f as parseInlinePluginManifest, p as parsePluginManifest } from "../registry-DM5aMhjm.js";
|
|
3
|
+
import { i as parseSkillFile } from "../skills-CAI5s___.js";
|
|
4
4
|
import { pathToFileURL } from "node:url";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import fs from "node:fs/promises";
|
package/dist/cli/main.js
CHANGED
|
@@ -25,7 +25,7 @@ async function runChat(argv, pluginSet) {
|
|
|
25
25
|
return await (await import("./chat.js")).runChat(argv, void 0, { pluginSet });
|
|
26
26
|
}
|
|
27
27
|
async function runBriefs(argv) {
|
|
28
|
-
return await (await import("../briefs-
|
|
28
|
+
return await (await import("../briefs-BkM_ZW4B.js")).runBriefs(argv);
|
|
29
29
|
}
|
|
30
30
|
function topLevelCommand(argv) {
|
|
31
31
|
return (argv[0] === "--" ? argv.slice(1) : argv)[0];
|
package/dist/cli/plugins.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as pluginCatalogRuntime } from "../catalog-runtime-
|
|
3
|
-
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-
|
|
1
|
+
import { $t as getDb, St as createPluginLogger, d as setPlugins, f as validatePlugins } from "../agent-hooks-bEwEJhlg.js";
|
|
2
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime-Cw9V2jpn.js";
|
|
3
|
+
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-BMig74Zp.js";
|
|
4
4
|
import { a as pluginRuntimeRegistrationsFromPluginSet, i as pluginCliRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "../plugins-egKWjgue.js";
|
|
5
5
|
import { t as loadAppPluginSet } from "../plugin-module-BKGOXca2.js";
|
|
6
6
|
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-Cw9V2jpn.js";
|
|
2
|
+
import { S as disconnectStateAdapter, t as create } from "../profile-upzC-wN1.js";
|
|
3
|
+
import { r as resolve } from "../resolve-sF6Lg7Ay.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 { a as getChatConfig } from "../config-
|
|
2
|
-
import { t as createJuniorSqlExecutor } from "../executor-
|
|
3
|
-
import { t as createPluginCatalogRuntime } from "../registry-
|
|
1
|
+
import { a as getChatConfig } from "../config-CYvEow1F.js";
|
|
2
|
+
import { t as createJuniorSqlExecutor } from "../executor-BXMlFrV6.js";
|
|
3
|
+
import { t as createPluginCatalogRuntime } from "../registry-DM5aMhjm.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-BKGOXca2.js";
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as logException, g as serializeGenAiAttribute, i as extractGenAiUsageAttributes, m as normalizeGenAiFinishReason, p as logWarn, w as withSpan } from "./logging-
|
|
2
|
-
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-
|
|
1
|
+
import { d as logException, g as serializeGenAiAttribute, i as extractGenAiUsageAttributes, m as normalizeGenAiFinishReason, p as logWarn, w as withSpan } from "./logging-BPBx6WF-.js";
|
|
2
|
+
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-hQmyZbOC.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 { o as resolveGatewayModel, w as toOptionalTrimmed } from "./client-
|
|
3
|
-
import { p as logWarn } from "./logging-
|
|
2
|
+
import { o as resolveGatewayModel, w as toOptionalTrimmed } from "./client-Pcxo3lGn.js";
|
|
3
|
+
import { p as logWarn } from "./logging-BPBx6WF-.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]))?$/;
|
|
@@ -295,4 +295,4 @@ function credentialUserSubjectId(context) {
|
|
|
295
295
|
return "subject" in context ? context.subject?.userId : void 0;
|
|
296
296
|
}
|
|
297
297
|
//#endregion
|
|
298
|
-
export {
|
|
298
|
+
export { slackChannelIdSchema as _, createActor as a, parseSlackMessageTs as b, isActorUserId as c, parseStoredSlackActor as d, toStoredSlackActor as f, parseSlackUserId as g, parseSlackTeamId as h, credentialUserSubjectId as i, isUserActor as l, parseSlackChannelReferenceId as m, credentialContextSchema as n, createSlackActor as o, parseSlackChannelId as p, credentialSubjectSchema as r, createSlackResumeActor as s, credentialContextForActor as t, parseActorUserId as u, slackTeamIdSchema as v, slackMessageTsSchema as x, slackUserIdSchema as y };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { l as TURN_REASONING_LEVELS, s as modelProfileSchema } from "./model-profile-BwU8mqwD.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import { actorSchema, codeChangeStateSchema, conversationAnnotationInputSchema, conversationEventPresentationSchema, conversationSidebarAnnotationSchema, ownedObjectAnnotationSchema } from "@sentry/junior-plugin-api";
|
|
3
|
+
import { actorSchema, codeChangeStateSchema, conversationAnnotationInputSchema, conversationEventPresentationSchema, conversationSidebarAnnotationSchema, objectFactFields, ownedObjectAnnotationSchema } from "@sentry/junior-plugin-api";
|
|
4
4
|
//#region src/usage-schema.ts
|
|
5
5
|
const usageCostSchema = z.object({
|
|
6
6
|
input: z.number().finite().nonnegative().optional(),
|
|
@@ -64,6 +64,58 @@ function instructionActors(provenance) {
|
|
|
64
64
|
return actors;
|
|
65
65
|
}
|
|
66
66
|
//#endregion
|
|
67
|
+
//#region src/chat/conversations/history-payload.ts
|
|
68
|
+
const messageFieldsSchema = z.record(z.string(), z.unknown());
|
|
69
|
+
const replacementEntrySchema = z.object({ item: z.string() }).passthrough();
|
|
70
|
+
/** Identify history events that store message fields as JSON strings. */
|
|
71
|
+
function isEncodedHistoryType(type) {
|
|
72
|
+
return type === "user_message" || type === "assistant_message" || type === "tool_result" || type === "handoff" || type === "compaction";
|
|
73
|
+
}
|
|
74
|
+
/** Encode agent history before SQL can change keys or string contents. */
|
|
75
|
+
function encodeHistoryPayload(data) {
|
|
76
|
+
const { type, ...payload } = data;
|
|
77
|
+
if (!isEncodedHistoryType(type)) return {
|
|
78
|
+
schemaVersion: 1,
|
|
79
|
+
payload
|
|
80
|
+
};
|
|
81
|
+
if (data.type === "handoff" || data.type === "compaction") return {
|
|
82
|
+
schemaVersion: 2,
|
|
83
|
+
payload: {
|
|
84
|
+
...payload,
|
|
85
|
+
replacementHistory: data.replacementHistory.map(({ item, ...entry }) => ({
|
|
86
|
+
...entry,
|
|
87
|
+
item: JSON.stringify(item)
|
|
88
|
+
}))
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
const { provenance, ...message } = payload;
|
|
92
|
+
return {
|
|
93
|
+
schemaVersion: 2,
|
|
94
|
+
payload: {
|
|
95
|
+
message: JSON.stringify(message),
|
|
96
|
+
provenance,
|
|
97
|
+
model: message.model,
|
|
98
|
+
provider: message.provider,
|
|
99
|
+
usage: message.usage,
|
|
100
|
+
toolCallId: message.toolCallId
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
/** Decode stored history for validation by the conversation event schema. */
|
|
105
|
+
function decodeHistoryPayload(type, payload) {
|
|
106
|
+
const fields = messageFieldsSchema.parse(payload);
|
|
107
|
+
if (type === "handoff" || type === "compaction") return {
|
|
108
|
+
...fields,
|
|
109
|
+
replacementHistory: z.array(replacementEntrySchema).parse(fields.replacementHistory).map(({ item, ...entry }) => ({
|
|
110
|
+
...entry,
|
|
111
|
+
item: JSON.parse(item)
|
|
112
|
+
}))
|
|
113
|
+
};
|
|
114
|
+
const message = messageFieldsSchema.parse(JSON.parse(z.string().parse(fields.message)));
|
|
115
|
+
if (fields.provenance !== void 0) message.provenance = fields.provenance;
|
|
116
|
+
return message;
|
|
117
|
+
}
|
|
118
|
+
//#endregion
|
|
67
119
|
//#region src/chat/conversations/history.ts
|
|
68
120
|
/**
|
|
69
121
|
* Durable conversation event history port.
|
|
@@ -413,9 +465,9 @@ const conversationEventEnvelopeSchema = z.object({
|
|
|
413
465
|
* `schemaVersion` is persisted with every physical event row.
|
|
414
466
|
*/
|
|
415
467
|
const conversationEventSchema = z.union([conversationEventEnvelopeSchema.extend({
|
|
416
|
-
schemaVersion: z.literal(1),
|
|
468
|
+
schemaVersion: z.union([z.literal(1), z.literal(2)]),
|
|
417
469
|
data: conversationEventDataSchema
|
|
418
|
-
}), conversationEventEnvelopeSchema.extend({ data: unknownConversationEventDataSchema })]);
|
|
470
|
+
}).refine((event) => event.schemaVersion === 1 || isEncodedHistoryType(event.data.type)), conversationEventEnvelopeSchema.extend({ data: unknownConversationEventDataSchema })]);
|
|
419
471
|
const storedConversationEventSchema = conversationEventEnvelopeSchema.extend({
|
|
420
472
|
type: z.string().min(1),
|
|
421
473
|
payload: z.unknown()
|
|
@@ -423,13 +475,20 @@ const storedConversationEventSchema = conversationEventEnvelopeSchema.extend({
|
|
|
423
475
|
/**
|
|
424
476
|
* Decode a physical event row without making old or future event types
|
|
425
477
|
* unreadable. Unsupported rows stay opaque until an upgrade migration defines
|
|
426
|
-
* their semantics;
|
|
478
|
+
* their semantics; supported events remain strict so corrupt canonical
|
|
427
479
|
* data cannot be mistaken for compatibility data.
|
|
428
480
|
*/
|
|
429
481
|
function decodeStoredConversationEvent(value) {
|
|
430
482
|
const stored = storedConversationEventSchema.parse(value);
|
|
431
483
|
const { type, payload, ...envelope } = stored;
|
|
432
484
|
const knownType = knownConversationEventTypeSchema.safeParse(type).success;
|
|
485
|
+
if (stored.schemaVersion === 2 && isEncodedHistoryType(type)) return conversationEventSchema.parse({
|
|
486
|
+
...envelope,
|
|
487
|
+
data: {
|
|
488
|
+
...decodeHistoryPayload(type, payload),
|
|
489
|
+
type
|
|
490
|
+
}
|
|
491
|
+
});
|
|
433
492
|
if (stored.schemaVersion === 1 && knownType) {
|
|
434
493
|
const data = typeof payload === "object" && payload !== null && !Array.isArray(payload) ? {
|
|
435
494
|
...payload,
|
|
@@ -574,6 +633,41 @@ function parseBriefInput(input) {
|
|
|
574
633
|
};
|
|
575
634
|
}
|
|
576
635
|
//#endregion
|
|
636
|
+
//#region src/chat/attachments/media.ts
|
|
637
|
+
const INPUT_IMAGE_TYPES = [
|
|
638
|
+
"image/png",
|
|
639
|
+
"image/jpeg",
|
|
640
|
+
"image/gif",
|
|
641
|
+
"image/webp"
|
|
642
|
+
];
|
|
643
|
+
/** Report whether a media type is a raster image accepted by vision models. */
|
|
644
|
+
function isVisionImageMediaType(mediaType) {
|
|
645
|
+
const normalized = mediaType.split(";", 1)[0]?.trim().toLowerCase();
|
|
646
|
+
return normalized ? INPUT_IMAGE_TYPES.some((type) => type === normalized) : false;
|
|
647
|
+
}
|
|
648
|
+
//#endregion
|
|
649
|
+
//#region src/chat/attachments/input.ts
|
|
650
|
+
/** Bound JSON image input below the hosting platform's request size limit. */
|
|
651
|
+
const MAX_INPUT_IMAGE_BYTES = 3145728;
|
|
652
|
+
const MAX_INPUT_IMAGES = 3;
|
|
653
|
+
/** Image bytes accepted with a web message, never stored in its mailbox row. */
|
|
654
|
+
const inputImageSchema = z.object({
|
|
655
|
+
filename: z.string().trim().min(1).max(255),
|
|
656
|
+
contentType: z.enum(INPUT_IMAGE_TYPES),
|
|
657
|
+
data: z.string().min(4).max(MAX_INPUT_IMAGE_BYTES * 4 / 3).regex(/^[A-Za-z0-9+/]*={0,2}$/).refine((data) => data.length % 4 === 0)
|
|
658
|
+
}).strict();
|
|
659
|
+
/** Safe attachment facts shared by mailbox input and transcript messages. */
|
|
660
|
+
const messageAttachmentSchema = z.object({
|
|
661
|
+
id: z.string().min(1),
|
|
662
|
+
filename: z.string().min(1),
|
|
663
|
+
contentType: z.string().min(1),
|
|
664
|
+
bytes: z.number().int().nonnegative()
|
|
665
|
+
}).strict();
|
|
666
|
+
/** Read attachment metadata without exposing object storage keys or bytes. */
|
|
667
|
+
function readMessageAttachments(value) {
|
|
668
|
+
return messageAttachmentSchema.array().parse(value ?? []);
|
|
669
|
+
}
|
|
670
|
+
//#endregion
|
|
577
671
|
//#region src/chat/automations/card.ts
|
|
578
672
|
/** Saved automation facts shown with a Message, not a live status view. */
|
|
579
673
|
const automationCardSchema = z.object({
|
|
@@ -617,6 +711,7 @@ function messageCardText(card) {
|
|
|
617
711
|
card.label !== card.title ? card.label : void 0,
|
|
618
712
|
card.description,
|
|
619
713
|
card.status,
|
|
714
|
+
...objectFactFields(card.facts).map((field) => `${field.label}: ${field.value}`),
|
|
620
715
|
card.trigger,
|
|
621
716
|
card.warning,
|
|
622
717
|
card.url
|
|
@@ -677,16 +772,14 @@ const archiveConversationBodySchema = z.object({
|
|
|
677
772
|
lastSeenAt: z.string().datetime()
|
|
678
773
|
}).strict();
|
|
679
774
|
const archiveConversationResponseSchema = z.object({ archivedAt: z.string().datetime().nullable() }).strict();
|
|
680
|
-
const createConversationBodySchema = z.object({
|
|
681
|
-
idempotencyKey: z.string().trim().min(1).max(200),
|
|
682
|
-
message: z.string().trim().min(1).max(32e3),
|
|
683
|
-
/** New roots default public. Private roots stay participant-only. */
|
|
684
|
-
visibility: z.enum(["private", "public"]).optional()
|
|
685
|
-
}).strict();
|
|
686
775
|
const createConversationMessageBodySchema = z.object({
|
|
687
776
|
idempotencyKey: z.string().trim().min(1).max(200),
|
|
688
|
-
message: z.string().trim().
|
|
689
|
-
|
|
777
|
+
message: z.string().trim().max(32e3),
|
|
778
|
+
images: z.array(inputImageSchema).max(3).optional()
|
|
779
|
+
}).strict().refine((body) => Boolean(body.message || body.images?.length), "Add a message or an image.").refine((body) => (body.images ?? []).reduce((sum, image) => sum + image.data.length, 0) <= MAX_INPUT_IMAGE_BYTES * 4 / 3, "Images must total 3 MB or less.");
|
|
780
|
+
const createConversationBodySchema = createConversationMessageBodySchema.safeExtend({
|
|
781
|
+
/** New roots default public. Private roots stay participant-only. */
|
|
782
|
+
visibility: z.enum(["private", "public"]).optional() });
|
|
690
783
|
const acceptedConversationMessageSchema = z.object({
|
|
691
784
|
conversationId: z.string().min(1),
|
|
692
785
|
messageId: z.string().min(1),
|
|
@@ -711,15 +804,16 @@ const conversationPendingMessageSchema = z.object({
|
|
|
711
804
|
role: z.literal("user"),
|
|
712
805
|
source: z.enum(["slack", "web"]),
|
|
713
806
|
text: z.string().optional(),
|
|
807
|
+
attachments: z.array(messageAttachmentSchema).optional(),
|
|
714
808
|
redacted: z.literal(true).optional()
|
|
715
809
|
}).strict().superRefine((data, context) => {
|
|
716
810
|
if (data.text === void 0 === (data.redacted !== true)) context.addIssue({
|
|
717
811
|
code: "custom",
|
|
718
812
|
message: "pending message content must be text or explicitly redacted"
|
|
719
813
|
});
|
|
720
|
-
if (data.redacted && data.actorIdentity) context.addIssue({
|
|
814
|
+
if (data.redacted && (data.actorIdentity || data.attachments)) context.addIssue({
|
|
721
815
|
code: "custom",
|
|
722
|
-
message: "redacted pending messages must not expose actor identity"
|
|
816
|
+
message: "redacted pending messages must not expose actor identity or attachments"
|
|
723
817
|
});
|
|
724
818
|
});
|
|
725
819
|
/** Participant-only authorization prompt for a parked web turn. */
|
|
@@ -838,15 +932,16 @@ const conversationReportMessageEventDataSchema = z.object({
|
|
|
838
932
|
trustedSummary: z.string().min(1).optional(),
|
|
839
933
|
cards: z.array(messageCardSchema).optional(),
|
|
840
934
|
text: z.string().optional(),
|
|
935
|
+
attachments: z.array(messageAttachmentSchema).optional(),
|
|
841
936
|
redacted: z.literal(true).optional()
|
|
842
937
|
}).strict().superRefine((data, context) => {
|
|
843
938
|
if (data.text === void 0 === (data.redacted !== true)) context.addIssue({
|
|
844
939
|
code: "custom",
|
|
845
940
|
message: "message content must be text or explicitly redacted"
|
|
846
941
|
});
|
|
847
|
-
if (data.redacted && (data.actorIdentity || data.cards)) context.addIssue({
|
|
942
|
+
if (data.redacted && (data.actorIdentity || data.cards || data.attachments)) context.addIssue({
|
|
848
943
|
code: "custom",
|
|
849
|
-
message: "redacted messages must not expose actor identity or
|
|
944
|
+
message: "redacted messages must not expose actor identity, cards, or attachments"
|
|
850
945
|
});
|
|
851
946
|
});
|
|
852
947
|
const conversationReportMessageHandledEventDataSchema = z.object({
|
|
@@ -984,16 +1079,9 @@ const conversationReportStructuredEventDataSchema = z.object({
|
|
|
984
1079
|
turnId: z.string().min(1).optional(),
|
|
985
1080
|
presentation: conversationEventPresentationSchema
|
|
986
1081
|
}).strict();
|
|
987
|
-
/** Public attachment metadata on conversation reports and transcript media. */
|
|
988
|
-
const conversationReportDeliveredAttachmentSchema = z.object({
|
|
989
|
-
id: z.string().min(1),
|
|
990
|
-
filename: z.string().min(1),
|
|
991
|
-
contentType: z.string().min(1),
|
|
992
|
-
bytes: z.number().int().nonnegative()
|
|
993
|
-
}).strict();
|
|
994
1082
|
const conversationReportAttachmentsDeliveredEventDataSchema = z.object({
|
|
995
1083
|
type: z.literal("attachments_delivered"),
|
|
996
|
-
attachments: z.array(
|
|
1084
|
+
attachments: z.array(messageAttachmentSchema).min(1)
|
|
997
1085
|
}).strict();
|
|
998
1086
|
const conversationReportCompactionEventDataSchema = z.object({
|
|
999
1087
|
type: z.literal("compaction"),
|
|
@@ -1233,4 +1321,4 @@ const conversationStatsReportSchema = z.object({
|
|
|
1233
1321
|
windowStart: z.string()
|
|
1234
1322
|
}).strict();
|
|
1235
1323
|
//#endregion
|
|
1236
|
-
export { messageCardKey as A,
|
|
1324
|
+
export { contextProvenance as $, messageCardKey as A, briefLinkSchema as B, conversationReportEventSchema as C, createConversationBodySchema as D, conversationSummaryReportSchema as E, MAX_INPUT_IMAGE_BYTES as F, agentHistoryItemSchema as G, conversationBriefSchema as H, readMessageAttachments as I, conversationTurnFailureReasonSchema as J, conversationEventDataSchema as K, INPUT_IMAGE_TYPES as L, messageCardText as M, readMessageCards as N, createConversationMessageBodySchema as O, MAX_INPUT_IMAGES as P, encodeHistoryPayload as Q, isVisionImageMediaType as R, conversationReportEventDataSchema as S, conversationStatsReportSchema as T, parseBriefInput as U, briefOutcomeStatusSchema as V, KNOWN_CONVERSATION_EVENT_TYPES as W, historyReplacementSchema as X, decodeStoredConversationEvent as Y, newConversationEventSchema as Z, conversationParamsSchema as _, cancelConversationPendingMessagesBodySchema as a, conversationPendingMessageSchema as b, conversationAttachmentParamsSchema as c, conversationDetailReportSchema as d, instructionActors as et, conversationEventHistorySchema as f, conversationFeedSchema as g, conversationFeedQuerySchema as h, archiveConversationResponseSchema as i, messageCardRefSchema as j, annotationCard as k, conversationAuxiliaryCostsSchema as l, conversationEventsQuerySchema as m, actorIdentitySchema as n, sameActorIdentity as nt, cancelConversationPendingMessagesResponseSchema as o, conversationEventPageSchema as p, conversationTurnFailureCodeSchema as q, archiveConversationBodySchema as r, usageSchema as rt, conversationActivityPreviewSchema as s, acceptedConversationMessageSchema as t, instructionProvenanceFor as tt, conversationDetailQuerySchema as u, conversationPendingAuthorizationSchema as v, conversationStatsItemSchema as w, conversationPendingMessagesReportSchema as x, conversationPendingMessageDeliverySchema as y, briefCodeChangeSchema as z };
|