@sentry/junior 0.299.0 → 0.300.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{adapter-AgCNqqsG.js → adapter-S5UkjNK3.js} +5 -4
- package/dist/{admin-1VwEXztm.js → admin-UrTniSPO.js} +2 -2
- package/dist/{agent-runner-Ciet8_nn.js → agent-runner-bY4_0UPm.js} +508 -203
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +6 -7
- package/dist/api.d.ts +1 -1
- package/dist/api.js +293 -61
- package/dist/{app--ky-Eu33.d.ts → app-D-AcIcCV.d.ts} +13 -2
- package/dist/app.d.ts +1 -1
- package/dist/app.js +57 -219
- package/dist/{automation-M3RFJUBf.js → automation-Dw82oQ-h.js} +2 -2
- package/dist/{background-compaction-queue-CnimvRdk.js → background-compaction-queue-B6U3060-.js} +8 -4
- package/dist/{briefs-CwzvgdCa.js → briefs-DqiwWu-n.js} +3 -3
- package/dist/{catalog-runtime-DaBaHY7u.js → catalog-runtime-D1oYNv04.js} +1 -1
- package/dist/cli/chat.js +16 -16
- package/dist/cli/check.js +3 -3
- package/dist/cli/main.js +3 -3
- package/dist/cli/plugins.js +5 -5
- package/dist/cli/snapshot-create.js +4 -4
- package/dist/cli/upgrade.d.ts +1 -1
- package/dist/cli/upgrade.js +4 -4
- package/dist/{config-CAXIpWQb.js → config-9nHoFiJP.js} +39 -8
- package/dist/{connections-Dy0hPdUq.js → connections-DZjTN3JC.js} +6 -6
- package/dist/{continue-in-slack-DIOjFj76.js → continue-in-slack-Dtv7_U42.js} +6 -6
- package/dist/{conversation-fCWD9Az3.js → conversation-Dyjq2CZ8.js} +19 -8
- package/dist/{conversation-feed-BPK8vkkZ.js → conversation-feed-CcDxlrlQ.js} +23 -2
- package/dist/{conversation-privacy-DUgtRkf8.js → conversation-privacy-D-5HTXjS.js} +1 -1
- package/dist/{conversation-turn-DkJB6yMF.js → conversation-turn-Cxl8WZD7.js} +17 -17
- package/dist/{credential-sync-RX24Y8aY.js → credential-sync-C49ClwDX.js} +15 -15
- package/dist/{db-B07FtU9g.d.ts → db-2resqBh1.d.ts} +1 -1
- package/dist/{db-COYOGzYS.js → db-BJNo6fK5.js} +13 -8
- package/dist/{executor-BWmAgSyi.js → executor-DBIaOeJ_.js} +9 -4
- package/dist/instrumentation.js +14 -5
- package/dist/{lineage-D-5jm_oj.js → lineage-0dereG7H.js} +2 -2
- package/dist/{logging-DPLEa8Bn.js → logging-BIclibct.js} +1 -1
- package/dist/{message-BIHR1yRk.js → message-dkOl-Iii.js} +8 -8
- package/dist/{model-input-BPZYH8Nd.js → model-input-CLo9TaUd.js} +4 -4
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +4 -4
- package/dist/{oauth-callback-server-R7qvSzFG.js → oauth-callback-server-WmpjfJgQ.js} +2 -2
- package/dist/{plugins-CBW2Prb_.js → plugins-BBX07Jzt.js} +1 -1
- package/dist/{projection-DEdP1q6f.js → projection-w_X-zi7v.js} +3742 -3624
- package/dist/{prompt-4M98h_tC.js → prompt-B1Xw46-S.js} +4 -4
- package/dist/{registry-BTKmKM-r.js → registry-BmP5vnlj.js} +2 -2
- package/dist/{resolve-B8hXNVZ3.js → resolve-goo34bJK.js} +3 -3
- package/dist/{result-g-XAaOj6.js → result-PVBeU0Wf.js} +9 -9
- package/dist/{runner-BlPSA5A8.js → runner-DKrfvNV6.js} +9 -9
- package/dist/{sandbox-egress-signals-Pai-MzEY.js → sandbox-egress-signals-DsUcqrI0.js} +1 -1
- package/dist/{schema-BNnY_trV.js → schema-C9iNFz5n.js} +20 -16
- package/dist/{schema-DbuWR-DN.d.ts → schema-Dns-sTas.d.ts} +219 -6
- package/dist/{service-account-BYGZ08DQ.js → service-account-CMAAloAL.js} +3 -3
- package/dist/{service-account-9OLNQMyz.js → service-account-CmowamcB.js} +4 -4
- package/dist/{session-stop-2XJrcNCy.js → session-stop-BcAXze8a.js} +15 -41
- package/dist/{skills-DpBQoeHV.js → skills-DfsazET6.js} +2 -2
- package/dist/{slack-conversation-unfurl-BcDIWo67.js → slack-conversation-unfurl-CzQonuWz.js} +7 -7
- package/dist/{spawn-09GssFod.js → spawn-C7o0FDDp.js} +6 -6
- package/dist/{state-Cufq0_rH.js → state-zSilNpbi.js} +2 -2
- package/dist/{statuses-B8mUfghF.js → statuses-Hn-HsOph.js} +86 -2
- package/dist/{stop-U7iUrR1g.js → stop-CFOujp8C.js} +2938 -76
- package/dist/{store-CSgUTMdv.js → store-Dkeis_8o.js} +9 -9
- package/dist/{store-BHiaHCQu.js → store-E3x2Fg_F.js} +5 -5
- package/dist/{task-queue-bMNq0clp.js → task-queue-D-hCqdZW.js} +3 -3
- package/dist/{task-runner-B__rxwxU.js → task-runner-vohUPLHe.js} +8 -8
- package/dist/{thread-context-d0ceWbVT.js → thread-context-BzvdkgI9.js} +8 -8
- package/dist/{turn-session-routing-BVZHBFCF.js → turn-session-routing-Bo_LxFum.js} +5 -5
- package/dist/{turn-user-message-BEw7acTP.js → turn-user-message-D5RnVmxQ.js} +3 -3
- package/dist/{users-BK3dbxZL.js → users-2bggndVg.js} +3 -3
- package/dist/{validation-BDVJjO2E.js → validation-BbWikeSa.js} +1 -1
- package/dist/{version-DQgZoQ3D.js → version-GVBMW2jA.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-CAWfFo29.js → viewer-BpxRliyO.js} +16 -114
- package/dist/{warmup-9ySPacF9.js → warmup-BW2qwnal.js} +18 -16
- package/dist/{worker-D8jJO-WO.js → worker-Cbd-iuwZ.js} +24 -20
- package/migrations/0107_attachment_deferred_download.sql +2 -0
- package/migrations/meta/0107_snapshot.json +4617 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +10 -8
- package/dist/media-BAHvgkok.js +0 -85
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as disconnectStateAdapter } from "./adapter-
|
|
2
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
3
|
-
import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-
|
|
1
|
+
import { t as disconnectStateAdapter } from "./adapter-S5UkjNK3.js";
|
|
2
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-D1oYNv04.js";
|
|
3
|
+
import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-CmowamcB.js";
|
|
4
4
|
import { CLI_USAGE } from "./cli/run.js";
|
|
5
5
|
import { createServer } from "node:http";
|
|
6
6
|
// src/cli/service-account.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { G as isRecord, b as setSpanAttributes, h as logWarn } from "./logging-
|
|
2
|
-
import { c as fenceLock, l as withLock, o as MUTATION_LOCK_TTL_MS, r as getStateAdapter } from "./adapter-
|
|
3
|
-
import { c as fetchWithBoundedOAuthErrorBodies, i as resolvePluginHeaderEnvRefs } from "./registry-
|
|
4
|
-
import { n as readEncryptedState, t as createEncryptedState } from "./state-
|
|
1
|
+
import { G as isRecord, b as setSpanAttributes, h as logWarn } from "./logging-BIclibct.js";
|
|
2
|
+
import { c as fenceLock, l as withLock, o as MUTATION_LOCK_TTL_MS, r as getStateAdapter } from "./adapter-S5UkjNK3.js";
|
|
3
|
+
import { c as fetchWithBoundedOAuthErrorBodies, i as resolvePluginHeaderEnvRefs } from "./registry-BmP5vnlj.js";
|
|
4
|
+
import { n as readEncryptedState, t as createEncryptedState } from "./state-zSilNpbi.js";
|
|
5
5
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
6
6
|
import { randomUUID } from "node:crypto";
|
|
7
7
|
import { UnauthorizedError, auth } from "@modelcontextprotocol/sdk/client/auth.js";
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { v as __exportAll } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import { Ai as getDashboardObjectIconLink, Bn as SCRIPT_TOOLS_SECTION_TAG,
|
|
3
|
-
import {
|
|
4
|
-
import { h as logWarn, m as logInfo, p as logException, v as serializeGenAiAttribute } from "./logging-
|
|
2
|
+
import { Ai as getDashboardObjectIconLink, Bn as SCRIPT_TOOLS_SECTION_TAG, Di as JUNIOR_THREAD_STATE_TTL_MS, Ei as verifyTimerWatchCredentialSubject, Fn as retainRuntimeTurnContext, Gi as listWorkspaces, Hn as TURN_CONTEXT_TAG, In as stripRuntimeTurnContext, Jn as renderUntrustedTag, Kn as renderChildTag, M as normalizeConversationText, Mr as getReviewItem, Nn as latestTurnContextSection, Oi as getDashboardConversationLink, Po as buildSentryConversationUrl, Qa as ToolInputError, Rn as CAPABILITY_SECTION_TAG, Ta as postSlackMessage, Tn as hasRuntimeTurnContext, Un as escapeClosingTags, Vn as SESSION_CONTEXT_SECTION_TAG, Wn as escapeTagText, Yn as tagJson, ao as SANDBOX_REPOS_ROOT, co as sandboxSkillDir, cr as getPluginSystemPromptContributions, ct as listTurnSummaries, dr as getPlugins, fa as escapeSlackMrkdwnText, fn as NO_REPLY_TOOL_NAME, in as REPLY_TOOL_NAME, io as SANDBOX_DATA_ROOT, lo as sandboxSkillFile, ma as normalizeSlackReplyMarkdown, ot as getStoredTurnFields, pa as formatSlackLink, qn as renderTag$1, so as SANDBOX_WORKSPACE_ROOT, sr as getPluginSlackConversationLink, st as getTurnRecord, ui as cancelSubscriptions, uo as sandboxSkillPathResolution, ur as getPluginUserPromptContributions, vn as REPORT_BLOCKED_TOOL_NAME, x as toStoredConversationMessage, zn as REQUEST_CONTEXT_SECTION_TAG } from "./projection-w_X-zi7v.js";
|
|
3
|
+
import { I as renderCurrentInstruction, R as escapeXml, n as botConfig, z as escapeXmlText } from "./config-9nHoFiJP.js";
|
|
4
|
+
import { h as logWarn, m as logInfo, p as logException, v as serializeGenAiAttribute } from "./logging-BIclibct.js";
|
|
5
5
|
import { o as isUserActor, t as createActor } from "./actor-D2iXzvlN.js";
|
|
6
|
-
import { C as isPersonInput, a as getConversationStore, j as SYSTEM_IDENTITY_ID, nt as nextDetailVersion, o as getDb, r as getConversationEventStore, s as getSqlExecutor } from "./db-
|
|
7
|
-
import { N as juniorUsers, j as juniorConversations } from "./executor-
|
|
8
|
-
import { r as getStateAdapter } from "./adapter-
|
|
6
|
+
import { C as isPersonInput, a as getConversationStore, j as SYSTEM_IDENTITY_ID, nt as nextDetailVersion, o as getDb, r as getConversationEventStore, s as getSqlExecutor } from "./db-BJNo6fK5.js";
|
|
7
|
+
import { N as juniorUsers, j as juniorConversations } from "./executor-DBIaOeJ_.js";
|
|
8
|
+
import { r as getStateAdapter } from "./adapter-S5UkjNK3.js";
|
|
9
9
|
import { a as listReferenceFiles, c as soulPathCandidates, l as worldPathCandidates } from "./package-discovery-DJhGdS4c.js";
|
|
10
|
-
import { h as credentialSubjectSchema } from "./registry-
|
|
11
|
-
import { i as parseSkillFile } from "./skills-
|
|
12
|
-
import { a as EVENT_SYSTEM_ACTOR, d as JUNIOR_NATIVE_EVENT_NAMESPACE, h as conversationNoteEvent, i as EVENT_MESSAGE_AUTHOR, o as isEventConversationMessage, r as EVENT_AUTHOR_ID } from "./prompt-
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { p as userCustomizationTextSchema, s as formatUserInputAnswer } from "./statuses-B8mUfghF.js";
|
|
10
|
+
import { h as credentialSubjectSchema } from "./registry-BmP5vnlj.js";
|
|
11
|
+
import { i as parseSkillFile } from "./skills-DfsazET6.js";
|
|
12
|
+
import { a as EVENT_SYSTEM_ACTOR, d as JUNIOR_NATIVE_EVENT_NAMESPACE, h as conversationNoteEvent, i as EVENT_MESSAGE_AUTHOR, o as isEventConversationMessage, r as EVENT_AUTHOR_ID } from "./prompt-B1Xw46-S.js";
|
|
13
|
+
import { r as appendAndEnqueueInboundMessage } from "./store-E3x2Fg_F.js";
|
|
14
|
+
import { f as eventCatalogEntry, l as CORE_EVENT_NAMESPACE, p as eventGuidance } from "./turn-session-routing-Bo_LxFum.js";
|
|
15
|
+
import { _ as userCustomizationTextSchema, m as isVisionImageMediaType, s as formatUserInputAnswer } from "./statuses-Hn-HsOph.js";
|
|
17
16
|
import * as z from "zod";
|
|
18
17
|
import path from "node:path";
|
|
19
18
|
import { isDeepStrictEqual } from "node:util";
|
|
@@ -550,7 +549,8 @@ const TOOL_POLICY_RULES = [
|
|
|
550
549
|
"- Resolve provider action targets before calls: explicit target wins; ambient `<configuration>` fills omitted targets. Treat non-target links/references as context.",
|
|
551
550
|
"- When a tool result includes a subscription, those events are already watched; do not call watchEvents for them. When a tool result includes a subscribable resource with suggested_events, use watchEvents only for those remaining events that serve the current intent. If suggested_events is empty or omitted, do not invent a watch. Do not create scheduled polling tasks for events a watch can deliver. Write a concise intent summary. Stop only the requested watch by id unless the user explicitly asks to stop every watch in the thread.",
|
|
552
551
|
"- New scheduled and event automations run on your own credentials by default. Make the creator's connected credentials available only when the creator asks for that. Do not decide from the tools, access, or connections in this turn whether an automation's runs can do the work; each run loads its own tools. Do not ask for credential confirmation, access, or a connection before you create one.",
|
|
553
|
-
"- Before loading a skill or starting substantial work, decide whether `spawnAgent` fits better than inline work."
|
|
552
|
+
"- Before loading a skill or starting substantial work, decide whether `spawnAgent` fits better than inline work.",
|
|
553
|
+
"- When several tool calls need no judgment from you between them, such as the same lookup for many items, results you only filter, count, or combine, or independent calls to different tools, make them in one `codemode` script instead of separate or parallel direct calls. Call tools directly when one call is enough or when you must read a result to decide what to do next."
|
|
554
554
|
];
|
|
555
555
|
/** Block 5, `<skill-policy>`: when to load a skill and how to use one. */
|
|
556
556
|
const SKILL_POLICY_RULES = [
|
|
@@ -2749,7 +2749,6 @@ async function saveUserCustomization(userId, customization) {
|
|
|
2749
2749
|
* contributions, bootstrap turn context, resume-safe history trimming, and
|
|
2750
2750
|
* the optional canonical telemetry view of public input messages.
|
|
2751
2751
|
*/
|
|
2752
|
-
const MAX_INLINE_ATTACHMENT_BASE64_CHARS = 12e4;
|
|
2753
2752
|
/**
|
|
2754
2753
|
* Keep host-owned thread history as one evidence-only block.
|
|
2755
2754
|
*
|
|
@@ -2811,23 +2810,6 @@ function renderExplicitSkillInstructions(skill) {
|
|
|
2811
2810
|
"</skill>"
|
|
2812
2811
|
].join("\n");
|
|
2813
2812
|
}
|
|
2814
|
-
/** Encode a non-image attachment as base64 XML for the prompt. */
|
|
2815
|
-
function encodeNonImageAttachmentForPrompt(attachment) {
|
|
2816
|
-
const base64 = attachment.data.toString("base64");
|
|
2817
|
-
const wasTruncated = base64.length > MAX_INLINE_ATTACHMENT_BASE64_CHARS;
|
|
2818
|
-
const encodedPayload = wasTruncated ? `${base64.slice(0, MAX_INLINE_ATTACHMENT_BASE64_CHARS)}...` : base64;
|
|
2819
|
-
return [
|
|
2820
|
-
"<attachment>",
|
|
2821
|
-
`filename: ${attachment.filename ?? "unnamed"}`,
|
|
2822
|
-
`media_type: ${attachment.mediaType}`,
|
|
2823
|
-
"encoding: base64",
|
|
2824
|
-
`truncated: ${wasTruncated ? "true" : "false"}`,
|
|
2825
|
-
"<data_base64>",
|
|
2826
|
-
encodedPayload,
|
|
2827
|
-
"</data_base64>",
|
|
2828
|
-
"</attachment>"
|
|
2829
|
-
].join("\n");
|
|
2830
|
-
}
|
|
2831
2813
|
/** Redact image data from prompt content parts for observability. */
|
|
2832
2814
|
function toObservablePromptPart(part) {
|
|
2833
2815
|
if (part.type === "text") return {
|
|
@@ -2887,15 +2869,7 @@ function buildUserTurnInput(args) {
|
|
|
2887
2869
|
});
|
|
2888
2870
|
continue;
|
|
2889
2871
|
}
|
|
2890
|
-
|
|
2891
|
-
userContentParts.push({
|
|
2892
|
-
type: "text",
|
|
2893
|
-
text: encodeNonImageAttachmentForPrompt({
|
|
2894
|
-
data: attachment.data,
|
|
2895
|
-
mediaType: attachment.mediaType,
|
|
2896
|
-
filename: attachment.filename
|
|
2897
|
-
})
|
|
2898
|
-
});
|
|
2872
|
+
throw new Error("Non-image attachment is missing its prompt text");
|
|
2899
2873
|
}
|
|
2900
2874
|
return {
|
|
2901
2875
|
contextContentParts: [],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { v as __exportAll } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import { h as logWarn } from "./logging-
|
|
2
|
+
import { h as logWarn } from "./logging-BIclibct.js";
|
|
3
3
|
import { s as skillRoots } from "./package-discovery-DJhGdS4c.js";
|
|
4
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
4
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-D1oYNv04.js";
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import fs from "node:fs/promises";
|
package/dist/{slack-conversation-unfurl-BcDIWo67.js → slack-conversation-unfurl-CzQonuWz.js}
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { v as __exportAll } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import {
|
|
3
|
-
import { E as withSpan } from "./logging-
|
|
2
|
+
import { Da as unfurlSlackLinks, Ii as parseDashboardConversationLink, Oo as readLatestConversationBrief, Tt as deferConversationMove, fa as escapeSlackMrkdwnText, pa as formatSlackLink, rs as getWorkspaceTeamId, wa as postSlackEphemeralMessage, yo as readConversationAccessFromSql } from "./projection-w_X-zi7v.js";
|
|
3
|
+
import { E as withSpan } from "./logging-BIclibct.js";
|
|
4
4
|
import { _ as slackUserIdSchema, b as slackMessageTsSchema, f as parseSlackTeamId, g as slackTeamIdSchema, h as slackChannelIdSchema, m as slackBotIdSchema, n as createSlackActor, p as parseSlackUserId, s as parseActorUserId, u as parseSlackChannelId } from "./actor-D2iXzvlN.js";
|
|
5
|
-
import { K as getConversationIdByProviderConversation, W as createCache, a as getConversationStore, o as getDb, s as getSqlExecutor } from "./db-
|
|
6
|
-
import { i as readActorIdentity } from "./viewer-
|
|
7
|
-
import "./store-
|
|
8
|
-
import { a as runWithSlackInstallation, r as lookupSlackUserProfile, s as checkSlackChannelReadAccess, t as lookupSlackBot } from "./users-
|
|
9
|
-
import { a as isMovableToSlack, i as continueConversationInSlack, n as alreadyContinuesInSlackMessage, t as BUSY } from "./continue-in-slack-
|
|
5
|
+
import { K as getConversationIdByProviderConversation, W as createCache, a as getConversationStore, o as getDb, s as getSqlExecutor } from "./db-BJNo6fK5.js";
|
|
6
|
+
import { i as readActorIdentity } from "./viewer-BpxRliyO.js";
|
|
7
|
+
import "./store-E3x2Fg_F.js";
|
|
8
|
+
import { a as runWithSlackInstallation, r as lookupSlackUserProfile, s as checkSlackChannelReadAccess, t as lookupSlackBot } from "./users-2bggndVg.js";
|
|
9
|
+
import { a as isMovableToSlack, i as continueConversationInSlack, n as alreadyContinuesInSlackMessage, t as BUSY } from "./continue-in-slack-Dtv7_U42.js";
|
|
10
10
|
import * as z from "zod";
|
|
11
11
|
// src/chat/ingress/workspace-membership.ts
|
|
12
12
|
const MEMBER_TTL_MS = 3e5;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { v as __exportAll } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import { n as botConfig } from "./config-
|
|
3
|
-
import {
|
|
4
|
-
import { $ as AgentDepthLimitError, _ as getAgentInvocation, ot as getAgentBinding, z as createAndEnqueueAgentInvocation } from "./warmup-
|
|
5
|
-
import { I as getUnnamedAgentConversationId, T as getAgentInvocationId, k as getAgentInvocationMessageId } from "./turn-user-message-
|
|
6
|
-
import { _ as getConversationWorkState } from "./store-
|
|
7
|
-
import { t as readConversationLineage } from "./lineage-
|
|
2
|
+
import { n as botConfig } from "./config-9nHoFiJP.js";
|
|
3
|
+
import { Ft as toolInvocationDestination, Pt as actorFromRun } from "./agent-runner-bY4_0UPm.js";
|
|
4
|
+
import { $ as AgentDepthLimitError, _ as getAgentInvocation, ot as getAgentBinding, z as createAndEnqueueAgentInvocation } from "./warmup-BW2qwnal.js";
|
|
5
|
+
import { I as getUnnamedAgentConversationId, T as getAgentInvocationId, k as getAgentInvocationMessageId } from "./turn-user-message-D5RnVmxQ.js";
|
|
6
|
+
import { _ as getConversationWorkState } from "./store-E3x2Fg_F.js";
|
|
7
|
+
import { t as readConversationLineage } from "./lineage-0dereG7H.js";
|
|
8
8
|
// src/chat/agent-invocations/spawn.ts
|
|
9
9
|
var spawn_exports = /* @__PURE__ */ __exportAll({ bindSpawnAgent: () => bindSpawnAgent });
|
|
10
10
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as getChatConfig } from "./config-
|
|
2
|
-
import { h as logWarn } from "./logging-
|
|
1
|
+
import { i as getChatConfig } from "./config-9nHoFiJP.js";
|
|
2
|
+
import { h as logWarn } from "./logging-BIclibct.js";
|
|
3
3
|
import { createCipheriv, createDecipheriv, randomBytes } from "node:crypto";
|
|
4
4
|
// src/chat/encryption/secret.ts
|
|
5
5
|
/**
|
|
@@ -27,6 +27,90 @@ const USER_CUSTOMIZATION_MAX_CHARS = 1e3;
|
|
|
27
27
|
const userCustomizationTextSchema = z.string().trim().max(USER_CUSTOMIZATION_MAX_CHARS);
|
|
28
28
|
/** Request and response body for the viewer's customization. */
|
|
29
29
|
const userCustomizationSchema = z.object({ customization: userCustomizationTextSchema }).strict();
|
|
30
|
+
// src/chat/attachments/media.ts
|
|
31
|
+
const INPUT_IMAGE_TYPES = [
|
|
32
|
+
"image/png",
|
|
33
|
+
"image/jpeg",
|
|
34
|
+
"image/gif",
|
|
35
|
+
"image/webp"
|
|
36
|
+
];
|
|
37
|
+
/** Video types that browsers play in a `<video>` element. */
|
|
38
|
+
const INLINE_VIDEO_TYPES = ["video/mp4", "video/webm"];
|
|
39
|
+
/** Leading bytes of each accepted image type. `null` matches any byte. */
|
|
40
|
+
const IMAGE_SIGNATURES = [
|
|
41
|
+
{
|
|
42
|
+
mediaType: "image/png",
|
|
43
|
+
bytes: [
|
|
44
|
+
137,
|
|
45
|
+
80,
|
|
46
|
+
78,
|
|
47
|
+
71,
|
|
48
|
+
13,
|
|
49
|
+
10,
|
|
50
|
+
26,
|
|
51
|
+
10
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
mediaType: "image/jpeg",
|
|
56
|
+
bytes: [
|
|
57
|
+
255,
|
|
58
|
+
216,
|
|
59
|
+
255
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
mediaType: "image/gif",
|
|
64
|
+
bytes: [
|
|
65
|
+
71,
|
|
66
|
+
73,
|
|
67
|
+
70,
|
|
68
|
+
56,
|
|
69
|
+
55,
|
|
70
|
+
97
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
mediaType: "image/gif",
|
|
75
|
+
bytes: [
|
|
76
|
+
71,
|
|
77
|
+
73,
|
|
78
|
+
70,
|
|
79
|
+
56,
|
|
80
|
+
57,
|
|
81
|
+
97
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
mediaType: "image/webp",
|
|
86
|
+
bytes: [
|
|
87
|
+
82,
|
|
88
|
+
73,
|
|
89
|
+
70,
|
|
90
|
+
70,
|
|
91
|
+
null,
|
|
92
|
+
null,
|
|
93
|
+
null,
|
|
94
|
+
null,
|
|
95
|
+
87,
|
|
96
|
+
69,
|
|
97
|
+
66,
|
|
98
|
+
80
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
];
|
|
102
|
+
/**
|
|
103
|
+
* Detect an accepted image type from file bytes. Use this instead of a file
|
|
104
|
+
* name or declared content type, which can be wrong.
|
|
105
|
+
*/
|
|
106
|
+
function detectImageMediaType(data) {
|
|
107
|
+
return IMAGE_SIGNATURES.find(({ bytes }) => data.length >= bytes.length && bytes.every((byte, index) => byte === null || data[index] === byte))?.mediaType;
|
|
108
|
+
}
|
|
109
|
+
/** Report whether a media type is a raster image accepted by vision models. */
|
|
110
|
+
function isVisionImageMediaType(mediaType) {
|
|
111
|
+
const normalized = mediaType.split(";", 1)[0]?.trim().toLowerCase();
|
|
112
|
+
return normalized ? INPUT_IMAGE_TYPES.some((type) => type === normalized) : false;
|
|
113
|
+
}
|
|
30
114
|
// src/chat/tools/runtime/user-input-request.ts
|
|
31
115
|
const USER_INPUT_LIMITS = {
|
|
32
116
|
maxButtonOptions: 5,
|
|
@@ -43,7 +127,7 @@ const descriptionSchema = z.string().trim().min(1).max(USER_INPUT_LIMITS.maxDesc
|
|
|
43
127
|
const optionSchema = z.object({
|
|
44
128
|
label: labelSchema.describe("Short choice text, such as `Accept` or `Decline`. The answer uses this exact text."),
|
|
45
129
|
description: descriptionSchema.describe("Optional short note about what this choice does."),
|
|
46
|
-
recommended: z.boolean().optional().describe("Set true on the choice that you recommend, and say why in its description. A `choice` field can recommend one option.")
|
|
130
|
+
recommended: z.boolean().optional().describe("Set true on the choice that you recommend, put that choice first, and say why in its description. A `choice` field can recommend one option.")
|
|
47
131
|
});
|
|
48
132
|
const fieldBase = {
|
|
49
133
|
id: z.string().regex(/^[a-z][a-z0-9_]{0,31}$/).describe("Stable key for this field, such as `approach`."),
|
|
@@ -181,4 +265,4 @@ const AGENT_INVOCATION_PARENT_MAILBOX_STATUSES = [
|
|
|
181
265
|
"skipped",
|
|
182
266
|
"steered"
|
|
183
267
|
];
|
|
184
|
-
export {
|
|
268
|
+
export { isAgentInvocationResultEventType as C, agentInvocationResultEventType as S, userCustomizationTextSchema as _, USER_INPUT_NOTE as a, AGENT_PARENT_MESSAGE_EVENT_TYPE as b, isEmptyUserInputAnswer as c, INLINE_VIDEO_TYPES as d, INPUT_IMAGE_TYPES as f, userCustomizationSchema as g, USER_CUSTOMIZATION_MAX_CHARS as h, USER_INPUT_LIMITS as i, normalizeUserInputAnswer as l, isVisionImageMediaType as m, AGENT_INVOCATION_PARENT_MAILBOX_STATUSES as n, buttonUserInputField as o, detectImageMediaType as p, AGENT_INVOCATION_STATUSES as r, formatUserInputAnswer as s, AGENT_INVOCATION_MAILBOX_STATUSES as t, userInputRequestSchema as u, AGENT_INVOCATION_EVENT_NAMESPACE as v, AGENT_REPLY_EVENT_TYPE as x, AGENT_MESSAGE_EVENT_TYPE as y };
|