@automagik/omni 2.260804.2 → 2.260804.3
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/index.js +1 -1
- package/dist/server/index.js +182 -122
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -128149,7 +128149,7 @@ import { fileURLToPath } from "url";
|
|
|
128149
128149
|
// package.json
|
|
128150
128150
|
var package_default = {
|
|
128151
128151
|
name: "@automagik/omni",
|
|
128152
|
-
version: "2.260804.
|
|
128152
|
+
version: "2.260804.3",
|
|
128153
128153
|
description: "LLM-optimized CLI for Omni",
|
|
128154
128154
|
type: "module",
|
|
128155
128155
|
bin: {
|
package/dist/server/index.js
CHANGED
|
@@ -37375,6 +37375,82 @@ var init_download_guard = __esm(() => {
|
|
|
37375
37375
|
};
|
|
37376
37376
|
});
|
|
37377
37377
|
|
|
37378
|
+
// ../channel-sdk/src/interactive-plan.ts
|
|
37379
|
+
function buttonId(btn, index) {
|
|
37380
|
+
return (btn.data ?? btn.text ?? `btn_${index}`).slice(0, MAX_ID);
|
|
37381
|
+
}
|
|
37382
|
+
function planInteractive(bodyText, buttons, listButtonLabel, listOptions = {}) {
|
|
37383
|
+
const replyButtons = buttons.filter((b2) => !b2.url);
|
|
37384
|
+
const urlButtons = buttons.filter((b2) => b2.url);
|
|
37385
|
+
const soleCta = replyButtons.length === 0 && urlButtons.length === 1 ? urlButtons[0] : undefined;
|
|
37386
|
+
if (soleCta) {
|
|
37387
|
+
return {
|
|
37388
|
+
interactive: {
|
|
37389
|
+
type: "cta_url",
|
|
37390
|
+
body: { text: bodyText },
|
|
37391
|
+
action: {
|
|
37392
|
+
name: "cta_url",
|
|
37393
|
+
parameters: { display_text: truncate(soleCta.text, MAX_BUTTON_TITLE), url: soleCta.url }
|
|
37394
|
+
}
|
|
37395
|
+
},
|
|
37396
|
+
body: bodyText,
|
|
37397
|
+
droppedRows: 0
|
|
37398
|
+
};
|
|
37399
|
+
}
|
|
37400
|
+
let body = bodyText;
|
|
37401
|
+
if (urlButtons.length > 0) {
|
|
37402
|
+
const lines = urlButtons.map((b2) => `${b2.text}: ${b2.url}`);
|
|
37403
|
+
body = body ? `${body}
|
|
37404
|
+
|
|
37405
|
+
${lines.join(`
|
|
37406
|
+
`)}` : lines.join(`
|
|
37407
|
+
`);
|
|
37408
|
+
}
|
|
37409
|
+
if (replyButtons.length === 0) {
|
|
37410
|
+
return { interactive: null, body, droppedRows: 0 };
|
|
37411
|
+
}
|
|
37412
|
+
const wantsList = listOptions.forceList === true || listOptions.sectionTitle !== undefined || replyButtons.some((b2) => b2.description !== undefined);
|
|
37413
|
+
if (replyButtons.length <= MAX_REPLY_BUTTONS && !wantsList) {
|
|
37414
|
+
return {
|
|
37415
|
+
interactive: {
|
|
37416
|
+
type: "button",
|
|
37417
|
+
body: { text: body },
|
|
37418
|
+
action: {
|
|
37419
|
+
buttons: replyButtons.map((b2, i) => ({
|
|
37420
|
+
type: "reply",
|
|
37421
|
+
reply: { id: buttonId(b2, i), title: truncate(b2.text, MAX_BUTTON_TITLE) }
|
|
37422
|
+
}))
|
|
37423
|
+
}
|
|
37424
|
+
},
|
|
37425
|
+
body,
|
|
37426
|
+
droppedRows: 0
|
|
37427
|
+
};
|
|
37428
|
+
}
|
|
37429
|
+
const rows = replyButtons.slice(0, MAX_LIST_ROWS);
|
|
37430
|
+
return {
|
|
37431
|
+
interactive: {
|
|
37432
|
+
type: "list",
|
|
37433
|
+
body: { text: body },
|
|
37434
|
+
action: {
|
|
37435
|
+
button: truncate(listButtonLabel, MAX_BUTTON_TITLE),
|
|
37436
|
+
sections: [
|
|
37437
|
+
{
|
|
37438
|
+
...listOptions.sectionTitle ? { title: truncate(listOptions.sectionTitle, MAX_SECTION_TITLE) } : {},
|
|
37439
|
+
rows: rows.map((b2, i) => ({
|
|
37440
|
+
id: buttonId(b2, i),
|
|
37441
|
+
title: truncate(b2.text, MAX_ROW_TITLE),
|
|
37442
|
+
...b2.description ? { description: truncate(b2.description, MAX_ROW_DESCRIPTION) } : {}
|
|
37443
|
+
}))
|
|
37444
|
+
}
|
|
37445
|
+
]
|
|
37446
|
+
}
|
|
37447
|
+
},
|
|
37448
|
+
body,
|
|
37449
|
+
droppedRows: replyButtons.length - rows.length
|
|
37450
|
+
};
|
|
37451
|
+
}
|
|
37452
|
+
var MAX_REPLY_BUTTONS = 3, MAX_LIST_ROWS = 10, MAX_BUTTON_TITLE = 20, MAX_ROW_TITLE = 24, MAX_ROW_DESCRIPTION = 72, MAX_SECTION_TITLE = 24, MAX_ID = 256, truncate = (s, max) => s.length <= max ? s : `${s.slice(0, max - 1)}\u2026`;
|
|
37453
|
+
|
|
37378
37454
|
// ../channel-sdk/src/media-backends/config.ts
|
|
37379
37455
|
function boolFromEnv(defaultValue) {
|
|
37380
37456
|
return exports_external.string().optional().transform((value) => {
|
|
@@ -37929,6 +38005,7 @@ __export(exports_src2, {
|
|
|
37929
38005
|
sanitizeOutboundText: () => sanitizeOutboundText,
|
|
37930
38006
|
sanitizeMessage: () => sanitizeMessage,
|
|
37931
38007
|
resolveMediaBackendConfig: () => resolveMediaBackendConfig,
|
|
38008
|
+
planInteractive: () => planInteractive,
|
|
37932
38009
|
parseSubject: () => parseSubject,
|
|
37933
38010
|
parseAssumeRoleWithWebIdentityResponse: () => parseAssumeRoleWithWebIdentityResponse,
|
|
37934
38011
|
matchesPattern: () => matchesPattern,
|
|
@@ -170620,80 +170697,7 @@ var init_reaction = __esm(() => {
|
|
|
170620
170697
|
});
|
|
170621
170698
|
|
|
170622
170699
|
// ../channel-whatsapp-business/src/senders/interactive.ts
|
|
170623
|
-
function
|
|
170624
|
-
return (btn.data ?? btn.text ?? `btn_${index2}`).slice(0, MAX_ID);
|
|
170625
|
-
}
|
|
170626
|
-
function planInteractive(bodyText, buttons, listButtonLabel, listOptions = {}) {
|
|
170627
|
-
const replyButtons = buttons.filter((b3) => !b3.url);
|
|
170628
|
-
const urlButtons = buttons.filter((b3) => b3.url);
|
|
170629
|
-
const soleCta = replyButtons.length === 0 && urlButtons.length === 1 ? urlButtons[0] : undefined;
|
|
170630
|
-
if (soleCta) {
|
|
170631
|
-
return {
|
|
170632
|
-
interactive: {
|
|
170633
|
-
type: "cta_url",
|
|
170634
|
-
body: { text: bodyText },
|
|
170635
|
-
action: {
|
|
170636
|
-
name: "cta_url",
|
|
170637
|
-
parameters: { display_text: truncate2(soleCta.text, MAX_BUTTON_TITLE), url: soleCta.url }
|
|
170638
|
-
}
|
|
170639
|
-
},
|
|
170640
|
-
body: bodyText,
|
|
170641
|
-
droppedRows: 0
|
|
170642
|
-
};
|
|
170643
|
-
}
|
|
170644
|
-
let body = bodyText;
|
|
170645
|
-
if (urlButtons.length > 0) {
|
|
170646
|
-
const lines = urlButtons.map((b3) => `${b3.text}: ${b3.url}`);
|
|
170647
|
-
body = body ? `${body}
|
|
170648
|
-
|
|
170649
|
-
${lines.join(`
|
|
170650
|
-
`)}` : lines.join(`
|
|
170651
|
-
`);
|
|
170652
|
-
}
|
|
170653
|
-
if (replyButtons.length === 0) {
|
|
170654
|
-
return { interactive: null, body, droppedRows: 0 };
|
|
170655
|
-
}
|
|
170656
|
-
const wantsList = listOptions.forceList === true || listOptions.sectionTitle !== undefined || replyButtons.some((b3) => b3.description !== undefined);
|
|
170657
|
-
if (replyButtons.length <= MAX_REPLY_BUTTONS && !wantsList) {
|
|
170658
|
-
return {
|
|
170659
|
-
interactive: {
|
|
170660
|
-
type: "button",
|
|
170661
|
-
body: { text: body },
|
|
170662
|
-
action: {
|
|
170663
|
-
buttons: replyButtons.map((b3, i) => ({
|
|
170664
|
-
type: "reply",
|
|
170665
|
-
reply: { id: buttonId(b3, i), title: truncate2(b3.text, MAX_BUTTON_TITLE) }
|
|
170666
|
-
}))
|
|
170667
|
-
}
|
|
170668
|
-
},
|
|
170669
|
-
body,
|
|
170670
|
-
droppedRows: 0
|
|
170671
|
-
};
|
|
170672
|
-
}
|
|
170673
|
-
const rows = replyButtons.slice(0, MAX_LIST_ROWS);
|
|
170674
|
-
return {
|
|
170675
|
-
interactive: {
|
|
170676
|
-
type: "list",
|
|
170677
|
-
body: { text: body },
|
|
170678
|
-
action: {
|
|
170679
|
-
button: truncate2(listButtonLabel, MAX_BUTTON_TITLE),
|
|
170680
|
-
sections: [
|
|
170681
|
-
{
|
|
170682
|
-
...listOptions.sectionTitle ? { title: truncate2(listOptions.sectionTitle, MAX_SECTION_TITLE) } : {},
|
|
170683
|
-
rows: rows.map((b3, i) => ({
|
|
170684
|
-
id: buttonId(b3, i),
|
|
170685
|
-
title: truncate2(b3.text, MAX_ROW_TITLE),
|
|
170686
|
-
...b3.description ? { description: truncate2(b3.description, MAX_ROW_DESCRIPTION) } : {}
|
|
170687
|
-
}))
|
|
170688
|
-
}
|
|
170689
|
-
]
|
|
170690
|
-
}
|
|
170691
|
-
},
|
|
170692
|
-
body,
|
|
170693
|
-
droppedRows: replyButtons.length - rows.length
|
|
170694
|
-
};
|
|
170695
|
-
}
|
|
170696
|
-
async function sendLocationRequest(client, to, bodyText, replyTo) {
|
|
170700
|
+
async function sendLocationRequest2(client, to, bodyText, replyTo) {
|
|
170697
170701
|
const payload = {
|
|
170698
170702
|
messaging_product: "whatsapp",
|
|
170699
170703
|
recipient_type: "individual",
|
|
@@ -170728,8 +170732,9 @@ async function sendInteractive(client, to, bodyText, buttons, replyTo, listButto
|
|
|
170728
170732
|
payload.context = { message_id: replyTo };
|
|
170729
170733
|
return { response: await client.sendMessage(payload), droppedRows: plan.droppedRows };
|
|
170730
170734
|
}
|
|
170731
|
-
var
|
|
170732
|
-
|
|
170735
|
+
var init_interactive = __esm(() => {
|
|
170736
|
+
init_src2();
|
|
170737
|
+
});
|
|
170733
170738
|
|
|
170734
170739
|
// ../channel-whatsapp-business/src/senders/flow.ts
|
|
170735
170740
|
async function sendFlow(client, to, flow, replyTo) {
|
|
@@ -170807,7 +170812,7 @@ var init_senders = __esm(() => {
|
|
|
170807
170812
|
async function dispatchOutbound2(client, message2, logger6) {
|
|
170808
170813
|
const { content, to, replyTo } = message2;
|
|
170809
170814
|
if (content.type === "text") {
|
|
170810
|
-
return { ok: true, response: await
|
|
170815
|
+
return { ok: true, response: await dispatchOutboundText2(client, message2, logger6) };
|
|
170811
170816
|
}
|
|
170812
170817
|
if (META_MEDIA_TYPES.has(content.type)) {
|
|
170813
170818
|
return {
|
|
@@ -170833,7 +170838,7 @@ async function dispatchOutbound2(client, message2, logger6) {
|
|
|
170833
170838
|
return { ok: true, response: await sendReaction3(client, to, content.targetMessageId ?? "", content.emoji ?? "") };
|
|
170834
170839
|
}
|
|
170835
170840
|
if (content.type === "location_request") {
|
|
170836
|
-
return { ok: true, response: await
|
|
170841
|
+
return { ok: true, response: await sendLocationRequest2(client, to, content.text ?? "", replyTo) };
|
|
170837
170842
|
}
|
|
170838
170843
|
if (content.type === "template") {
|
|
170839
170844
|
return dispatchOutboundTemplate2(client, message2);
|
|
@@ -170854,7 +170859,7 @@ async function dispatchOutboundFlow(client, message2) {
|
|
|
170854
170859
|
const { response } = await sendFlow(client, message2.to, parsed.data, message2.replyTo);
|
|
170855
170860
|
return { ok: true, response };
|
|
170856
170861
|
}
|
|
170857
|
-
async function
|
|
170862
|
+
async function dispatchOutboundText2(client, message2, logger6) {
|
|
170858
170863
|
const { content, to, replyTo } = message2;
|
|
170859
170864
|
const formatMode = message2.metadata?.messageFormatMode ?? "convert";
|
|
170860
170865
|
const text3 = content.text ?? "";
|
|
@@ -188043,7 +188048,7 @@ function shouldIgnoreSpansForIncomingRequest(request, {
|
|
|
188043
188048
|
ignoreStaticAssets,
|
|
188044
188049
|
ignoreIncomingRequests
|
|
188045
188050
|
}) {
|
|
188046
|
-
if (
|
|
188051
|
+
if (import_core61.isTracingSuppressed(import_api7.context.active())) {
|
|
188047
188052
|
return true;
|
|
188048
188053
|
}
|
|
188049
188054
|
const urlPath = request.url;
|
|
@@ -188095,7 +188100,7 @@ function getIncomingRequestAttributesOnResponse(request, response) {
|
|
|
188095
188100
|
[import_semantic_conventions.SEMATTRS_HTTP_STATUS_CODE]: statusCode,
|
|
188096
188101
|
"http.status_text": statusMessage?.toUpperCase()
|
|
188097
188102
|
};
|
|
188098
|
-
const rpcMetadata =
|
|
188103
|
+
const rpcMetadata = import_core61.getRPCMetadata(import_api7.context.active());
|
|
188099
188104
|
if (socket) {
|
|
188100
188105
|
const { localAddress, localPort, remoteAddress, remotePort } = socket;
|
|
188101
188106
|
newAttributes[import_semantic_conventions.SEMATTRS_NET_HOST_IP] = localAddress;
|
|
@@ -188105,7 +188110,7 @@ function getIncomingRequestAttributesOnResponse(request, response) {
|
|
|
188105
188110
|
}
|
|
188106
188111
|
newAttributes[import_semantic_conventions.SEMATTRS_HTTP_STATUS_CODE] = statusCode;
|
|
188107
188112
|
newAttributes["http.status_text"] = (statusMessage || "").toUpperCase();
|
|
188108
|
-
if (rpcMetadata?.type ===
|
|
188113
|
+
if (rpcMetadata?.type === import_core61.RPCType.HTTP && rpcMetadata.route !== undefined) {
|
|
188109
188114
|
const routeName = rpcMetadata.route;
|
|
188110
188115
|
newAttributes[import_semantic_conventions.ATTR_HTTP_ROUTE] = routeName;
|
|
188111
188116
|
}
|
|
@@ -188120,7 +188125,7 @@ function shouldFilterStatusCode(statusCode, dropForStatusCodes) {
|
|
|
188120
188125
|
return statusCode >= min && statusCode <= max;
|
|
188121
188126
|
});
|
|
188122
188127
|
}
|
|
188123
|
-
var import_api7,
|
|
188128
|
+
var import_api7, import_core61, import_semantic_conventions, INTEGRATION_NAME8 = "Http.ServerSpans", _httpServerSpansIntegration = (options = {}) => {
|
|
188124
188129
|
const ignoreStaticAssets = options.ignoreStaticAssets ?? true;
|
|
188125
188130
|
const ignoreIncomingRequests = options.ignoreIncomingRequests;
|
|
188126
188131
|
const ignoreStatusCodes = options.ignoreStatusCodes ?? [
|
|
@@ -188185,10 +188190,10 @@ var import_api7, import_core60, import_semantic_conventions, INTEGRATION_NAME8 =
|
|
|
188185
188190
|
applyCustomAttributesOnSpan?.(span, request, response);
|
|
188186
188191
|
onSpanCreated?.(span, request, response);
|
|
188187
188192
|
const rpcMetadata = {
|
|
188188
|
-
type:
|
|
188193
|
+
type: import_core61.RPCType.HTTP,
|
|
188189
188194
|
span
|
|
188190
188195
|
};
|
|
188191
|
-
return import_api7.context.with(
|
|
188196
|
+
return import_api7.context.with(import_core61.setRPCMetadata(import_api7.trace.setSpan(import_api7.context.active(), span), rpcMetadata), () => {
|
|
188192
188197
|
import_api7.context.bind(import_api7.context.active(), request);
|
|
188193
188198
|
import_api7.context.bind(import_api7.context.active(), response);
|
|
188194
188199
|
let isEnded = false;
|
|
@@ -188250,7 +188255,7 @@ var init_httpServerSpansIntegration = __esm(() => {
|
|
|
188250
188255
|
init_debug_build2();
|
|
188251
188256
|
init_httpServerIntegration();
|
|
188252
188257
|
import_api7 = __toESM(require_src(), 1);
|
|
188253
|
-
|
|
188258
|
+
import_core61 = __toESM(require_src6(), 1);
|
|
188254
188259
|
import_semantic_conventions = __toESM(require_src5(), 1);
|
|
188255
188260
|
httpServerSpansIntegration = _httpServerSpansIntegration;
|
|
188256
188261
|
});
|
|
@@ -190084,13 +190089,13 @@ import { subscribe as subscribe2 } from "diagnostics_channel";
|
|
|
190084
190089
|
import { errorMonitor as errorMonitor2 } from "events";
|
|
190085
190090
|
import * as http from "http";
|
|
190086
190091
|
import * as https from "https";
|
|
190087
|
-
var import_api8,
|
|
190092
|
+
var import_api8, import_core64, import_instrumentation, FULLY_SUPPORTS_HTTP_DIAGNOSTICS_CHANNEL, SentryHttpInstrumentation;
|
|
190088
190093
|
var init_SentryHttpInstrumentation = __esm(() => {
|
|
190089
190094
|
init_esm();
|
|
190090
190095
|
init_constants10();
|
|
190091
190096
|
init_nodeVersion();
|
|
190092
190097
|
import_api8 = __toESM(require_src(), 1);
|
|
190093
|
-
|
|
190098
|
+
import_core64 = __toESM(require_src6(), 1);
|
|
190094
190099
|
import_instrumentation = __toESM(require_src8(), 1);
|
|
190095
190100
|
FULLY_SUPPORTS_HTTP_DIAGNOSTICS_CHANNEL = NODE_VERSION.major === 22 && NODE_VERSION.minor >= 12 || NODE_VERSION.major === 23 && NODE_VERSION.minor >= 2 || NODE_VERSION.major >= 24;
|
|
190096
190101
|
SentryHttpInstrumentation = class SentryHttpInstrumentation extends import_instrumentation.InstrumentationBase {
|
|
@@ -190105,7 +190110,7 @@ var init_SentryHttpInstrumentation = __esm(() => {
|
|
|
190105
190110
|
...options,
|
|
190106
190111
|
spans: options.createSpansForOutgoingRequests && (options.spans ?? true),
|
|
190107
190112
|
ignoreOutgoingRequests(url, request) {
|
|
190108
|
-
return
|
|
190113
|
+
return import_core64.isTracingSuppressed(import_api8.context.active()) || !!options.ignoreOutgoingRequests?.(url, getRequestOptions(request));
|
|
190109
190114
|
},
|
|
190110
190115
|
outgoingRequestHook(span, request) {
|
|
190111
190116
|
options.outgoingRequestHook?.(span, request);
|
|
@@ -190325,13 +190330,13 @@ var init_outgoingFetchRequest = __esm(() => {
|
|
|
190325
190330
|
|
|
190326
190331
|
// ../../node_modules/.bun/@sentry+node-core@10.52.0+6488de8736d8e524/node_modules/@sentry/node-core/build/esm/integrations/node-fetch/SentryNodeFetchInstrumentation.js
|
|
190327
190332
|
import * as diagch from "diagnostics_channel";
|
|
190328
|
-
var import_api9,
|
|
190333
|
+
var import_api9, import_core67, import_instrumentation2, SentryNodeFetchInstrumentation;
|
|
190329
190334
|
var init_SentryNodeFetchInstrumentation = __esm(() => {
|
|
190330
190335
|
init_esm();
|
|
190331
190336
|
init_nodeVersion();
|
|
190332
190337
|
init_outgoingFetchRequest();
|
|
190333
190338
|
import_api9 = __toESM(require_src(), 1);
|
|
190334
|
-
|
|
190339
|
+
import_core67 = __toESM(require_src6(), 1);
|
|
190335
190340
|
import_instrumentation2 = __toESM(require_src8(), 1);
|
|
190336
190341
|
SentryNodeFetchInstrumentation = class SentryNodeFetchInstrumentation extends import_instrumentation2.InstrumentationBase {
|
|
190337
190342
|
constructor(config2 = {}) {
|
|
@@ -190402,7 +190407,7 @@ var init_SentryNodeFetchInstrumentation = __esm(() => {
|
|
|
190402
190407
|
});
|
|
190403
190408
|
}
|
|
190404
190409
|
_shouldIgnoreOutgoingRequest(request) {
|
|
190405
|
-
if (
|
|
190410
|
+
if (import_core67.isTracingSuppressed(import_api9.context.active())) {
|
|
190406
190411
|
return true;
|
|
190407
190412
|
}
|
|
190408
190413
|
const url = getAbsoluteUrl2(request.origin, request.path);
|
|
@@ -192762,7 +192767,7 @@ function makeTraceState({
|
|
|
192762
192767
|
sampled
|
|
192763
192768
|
}) {
|
|
192764
192769
|
const dscString = dsc ? dynamicSamplingContextToSentryBaggageHeader(dsc) : undefined;
|
|
192765
|
-
const traceStateBase = new
|
|
192770
|
+
const traceStateBase = new import_core70.TraceState;
|
|
192766
192771
|
const traceStateWithDsc = dscString ? traceStateBase.set(SENTRY_TRACE_STATE_DSC, dscString) : traceStateBase;
|
|
192767
192772
|
return sampled === false ? traceStateWithDsc.set(SENTRY_TRACE_STATE_SAMPLED_NOT_RECORDING, "1") : traceStateWithDsc;
|
|
192768
192773
|
}
|
|
@@ -192886,13 +192891,13 @@ function _startSpan(options, callback, autoEnd) {
|
|
|
192886
192891
|
return wrapper(() => {
|
|
192887
192892
|
const activeCtx = getContext(options.scope, options.forceTransaction);
|
|
192888
192893
|
const missingRequiredParent = options.onlyIfParent && !import_api10.trace.getSpan(activeCtx);
|
|
192889
|
-
const ctx = missingRequiredParent ?
|
|
192894
|
+
const ctx = missingRequiredParent ? import_core70.suppressTracing(activeCtx) : activeCtx;
|
|
192890
192895
|
if (missingRequiredParent) {
|
|
192891
192896
|
getClient()?.recordDroppedEvent("no_parent_span", "span");
|
|
192892
192897
|
}
|
|
192893
192898
|
const spanOptions = getSpanOptions(options);
|
|
192894
192899
|
if (!hasSpansEnabled()) {
|
|
192895
|
-
const suppressedCtx =
|
|
192900
|
+
const suppressedCtx = import_core70.isTracingSuppressed(ctx) ? ctx : import_core70.suppressTracing(ctx);
|
|
192896
192901
|
return import_api10.context.with(suppressedCtx, () => {
|
|
192897
192902
|
return tracer2.startActiveSpan(name, spanOptions, suppressedCtx, (span) => {
|
|
192898
192903
|
patchSpanEnd(span);
|
|
@@ -192929,13 +192934,13 @@ function startInactiveSpan2(options) {
|
|
|
192929
192934
|
return wrapper(() => {
|
|
192930
192935
|
const activeCtx = getContext(options.scope, options.forceTransaction);
|
|
192931
192936
|
const missingRequiredParent = options.onlyIfParent && !import_api10.trace.getSpan(activeCtx);
|
|
192932
|
-
let ctx = missingRequiredParent ?
|
|
192937
|
+
let ctx = missingRequiredParent ? import_core70.suppressTracing(activeCtx) : activeCtx;
|
|
192933
192938
|
if (missingRequiredParent) {
|
|
192934
192939
|
getClient()?.recordDroppedEvent("no_parent_span", "span");
|
|
192935
192940
|
}
|
|
192936
192941
|
const spanOptions = getSpanOptions(options);
|
|
192937
192942
|
if (!hasSpansEnabled()) {
|
|
192938
|
-
ctx =
|
|
192943
|
+
ctx = import_core70.isTracingSuppressed(ctx) ? ctx : import_core70.suppressTracing(ctx);
|
|
192939
192944
|
}
|
|
192940
192945
|
const span = tracer2.startSpan(name, spanOptions, ctx);
|
|
192941
192946
|
patchSpanEnd(span);
|
|
@@ -193044,7 +193049,7 @@ function getActiveSpanWrapper2(parentSpan) {
|
|
|
193044
193049
|
} : (callback) => callback();
|
|
193045
193050
|
}
|
|
193046
193051
|
function suppressTracing2(callback) {
|
|
193047
|
-
const ctx =
|
|
193052
|
+
const ctx = import_core70.suppressTracing(import_api10.context.active());
|
|
193048
193053
|
return import_api10.context.with(ctx, callback);
|
|
193049
193054
|
}
|
|
193050
193055
|
function setupEventContextTrace(client) {
|
|
@@ -193731,7 +193736,7 @@ function wrapSamplingDecision({
|
|
|
193731
193736
|
function getBaseTraceState(context8, spanAttributes) {
|
|
193732
193737
|
const parentSpan = import_api10.trace.getSpan(context8);
|
|
193733
193738
|
const parentContext = parentSpan?.spanContext();
|
|
193734
|
-
let traceState = parentContext?.traceState || new
|
|
193739
|
+
let traceState = parentContext?.traceState || new import_core70.TraceState;
|
|
193735
193740
|
const url = spanAttributes[import_semantic_conventions2.SEMATTRS_HTTP_URL] || spanAttributes[import_semantic_conventions2.ATTR_URL_FULL];
|
|
193736
193741
|
if (url && typeof url === "string") {
|
|
193737
193742
|
traceState = traceState.set(SENTRY_TRACE_STATE_URL, url);
|
|
@@ -193792,12 +193797,12 @@ function getSentryResource(serviceNameFallback) {
|
|
|
193792
193797
|
...otelResourceAttrs,
|
|
193793
193798
|
...otelServiceName ? { [import_semantic_conventions2.ATTR_SERVICE_NAME]: otelServiceName } : {},
|
|
193794
193799
|
[import_semantic_conventions2.ATTR_SERVICE_VERSION]: SDK_VERSION,
|
|
193795
|
-
[import_semantic_conventions2.ATTR_TELEMETRY_SDK_LANGUAGE]:
|
|
193796
|
-
[import_semantic_conventions2.ATTR_TELEMETRY_SDK_NAME]:
|
|
193797
|
-
[import_semantic_conventions2.ATTR_TELEMETRY_SDK_VERSION]:
|
|
193800
|
+
[import_semantic_conventions2.ATTR_TELEMETRY_SDK_LANGUAGE]: import_core70.SDK_INFO[import_semantic_conventions2.ATTR_TELEMETRY_SDK_LANGUAGE],
|
|
193801
|
+
[import_semantic_conventions2.ATTR_TELEMETRY_SDK_NAME]: import_core70.SDK_INFO[import_semantic_conventions2.ATTR_TELEMETRY_SDK_NAME],
|
|
193802
|
+
[import_semantic_conventions2.ATTR_TELEMETRY_SDK_VERSION]: import_core70.SDK_INFO[import_semantic_conventions2.ATTR_TELEMETRY_SDK_VERSION]
|
|
193798
193803
|
});
|
|
193799
193804
|
}
|
|
193800
|
-
var api, import_api10, import_semantic_conventions2,
|
|
193805
|
+
var api, import_api10, import_semantic_conventions2, import_core70, import_sdk_trace_base, SEMANTIC_ATTRIBUTE_SENTRY_PARENT_IS_REMOTE = "sentry.parentIsRemote", SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION = "sentry.graphql.operation", SENTRY_TRACE_HEADER2 = "sentry-trace", SENTRY_BAGGAGE_HEADER2 = "baggage", SENTRY_TRACE_STATE_DSC = "sentry.dsc", SENTRY_TRACE_STATE_SAMPLED_NOT_RECORDING = "sentry.sampled_not_recording", SENTRY_TRACE_STATE_URL = "sentry.url", SENTRY_TRACE_STATE_SAMPLE_RAND = "sentry.sample_rand", SENTRY_TRACE_STATE_SAMPLE_RATE = "sentry.sample_rate", SENTRY_TRACE_STATE_CHILD_IGNORED = "sentry.ignored", SENTRY_TRACE_STATE_SEGMENT_IGNORED = "sentry.segment_ignored", SENTRY_SCOPES_CONTEXT_KEY, SENTRY_FORK_ISOLATION_SCOPE_CONTEXT_KEY, SENTRY_FORK_SET_SCOPE_CONTEXT_KEY, SENTRY_FORK_SET_ISOLATION_SCOPE_CONTEXT_KEY, SCOPE_CONTEXT_FIELD = "_scopeContext", setupElements, SentryPropagator, canonicalGrpcErrorCodesMap, isStatusErrorMessageValid = (message2) => {
|
|
193801
193806
|
return Object.values(canonicalGrpcErrorCodesMap).includes(message2);
|
|
193802
193807
|
}, MAX_SPAN_COUNT2 = 1000, DEFAULT_TIMEOUT = 300;
|
|
193803
193808
|
var init_resource_Bhpm2sLf = __esm(() => {
|
|
@@ -193806,21 +193811,21 @@ var init_resource_Bhpm2sLf = __esm(() => {
|
|
|
193806
193811
|
api = __toESM(require_src(), 1);
|
|
193807
193812
|
import_api10 = __toESM(require_src(), 1);
|
|
193808
193813
|
import_semantic_conventions2 = __toESM(require_src5(), 1);
|
|
193809
|
-
|
|
193814
|
+
import_core70 = __toESM(require_src6(), 1);
|
|
193810
193815
|
import_sdk_trace_base = __toESM(require_src10(), 1);
|
|
193811
193816
|
SENTRY_SCOPES_CONTEXT_KEY = import_api10.createContextKey("sentry_scopes");
|
|
193812
193817
|
SENTRY_FORK_ISOLATION_SCOPE_CONTEXT_KEY = import_api10.createContextKey("sentry_fork_isolation_scope");
|
|
193813
193818
|
SENTRY_FORK_SET_SCOPE_CONTEXT_KEY = import_api10.createContextKey("sentry_fork_set_scope");
|
|
193814
193819
|
SENTRY_FORK_SET_ISOLATION_SCOPE_CONTEXT_KEY = import_api10.createContextKey("sentry_fork_set_isolation_scope");
|
|
193815
193820
|
setupElements = new Set;
|
|
193816
|
-
SentryPropagator = class SentryPropagator extends
|
|
193821
|
+
SentryPropagator = class SentryPropagator extends import_core70.W3CBaggagePropagator {
|
|
193817
193822
|
constructor() {
|
|
193818
193823
|
super();
|
|
193819
193824
|
setIsSetup("SentryPropagator");
|
|
193820
193825
|
this._urlMatchesTargetsMap = new LRUMap(100);
|
|
193821
193826
|
}
|
|
193822
193827
|
inject(context8, carrier, setter) {
|
|
193823
|
-
if (
|
|
193828
|
+
if (import_core70.isTracingSuppressed(context8)) {
|
|
193824
193829
|
DEBUG_BUILD3 && debug32.log("[Tracing] Not injecting trace data for url because tracing is suppressed.");
|
|
193825
193830
|
return;
|
|
193826
193831
|
}
|
|
@@ -196669,12 +196674,12 @@ var init_http3 = __esm(() => {
|
|
|
196669
196674
|
// ../../node_modules/.bun/@sentry+node@10.52.0+1b9a589cee1ff949/node_modules/@sentry/node/build/esm/integrations/node-fetch/vendored/undici.js
|
|
196670
196675
|
import * as diagch2 from "diagnostics_channel";
|
|
196671
196676
|
import { URL as URL4 } from "url";
|
|
196672
|
-
var import_instrumentation5, import_api15,
|
|
196677
|
+
var import_instrumentation5, import_api15, import_core99, import_semantic_conventions3, PACKAGE_NAME = "@sentry/instrumentation-undici", UndiciInstrumentation;
|
|
196673
196678
|
var init_undici = __esm(() => {
|
|
196674
196679
|
init_esm();
|
|
196675
196680
|
import_instrumentation5 = __toESM(require_src8(), 1);
|
|
196676
196681
|
import_api15 = __toESM(require_src(), 1);
|
|
196677
|
-
|
|
196682
|
+
import_core99 = __toESM(require_src6(), 1);
|
|
196678
196683
|
import_semantic_conventions3 = __toESM(require_src5(), 1);
|
|
196679
196684
|
UndiciInstrumentation = class UndiciInstrumentation extends import_instrumentation5.InstrumentationBase {
|
|
196680
196685
|
__init() {
|
|
@@ -196773,7 +196778,7 @@ var init_undici = __esm(() => {
|
|
|
196773
196778
|
if (shouldIgnoreReq) {
|
|
196774
196779
|
return;
|
|
196775
196780
|
}
|
|
196776
|
-
const startTime =
|
|
196781
|
+
const startTime = import_core99.hrTime();
|
|
196777
196782
|
let requestUrl;
|
|
196778
196783
|
try {
|
|
196779
196784
|
requestUrl = new URL4(request2.path, request2.origin);
|
|
@@ -196946,7 +196951,7 @@ var init_undici = __esm(() => {
|
|
|
196946
196951
|
metricsAttributes[key] = attributes[key];
|
|
196947
196952
|
}
|
|
196948
196953
|
});
|
|
196949
|
-
const durationSeconds =
|
|
196954
|
+
const durationSeconds = import_core99.hrTimeToMilliseconds(import_core99.hrTimeDuration(startTime, import_core99.hrTime())) / 1000;
|
|
196950
196955
|
this._httpClientDurationHistogram.record(durationSeconds, metricsAttributes);
|
|
196951
196956
|
}
|
|
196952
196957
|
getRequestMethod(original) {
|
|
@@ -197491,7 +197496,7 @@ var init_debug_build3 = __esm(() => {
|
|
|
197491
197496
|
});
|
|
197492
197497
|
|
|
197493
197498
|
// ../../node_modules/.bun/@sentry+node@10.52.0+1b9a589cee1ff949/node_modules/@sentry/node/build/esm/integrations/tracing/express.js
|
|
197494
|
-
var import_instrumentation6, import_api16,
|
|
197499
|
+
var import_instrumentation6, import_api16, import_core102, INTEGRATION_NAME23 = "Express", SUPPORTED_VERSIONS, instrumentExpress, ExpressInstrumentation, _expressIntegration = (options) => {
|
|
197495
197500
|
return {
|
|
197496
197501
|
name: INTEGRATION_NAME23,
|
|
197497
197502
|
setupOnce() {
|
|
@@ -197505,7 +197510,7 @@ var init_express2 = __esm(() => {
|
|
|
197505
197510
|
init_debug_build3();
|
|
197506
197511
|
import_instrumentation6 = __toESM(require_src8(), 1);
|
|
197507
197512
|
import_api16 = __toESM(require_src(), 1);
|
|
197508
|
-
|
|
197513
|
+
import_core102 = __toESM(require_src6(), 1);
|
|
197509
197514
|
SUPPORTED_VERSIONS = [">=4.0.0 <6"];
|
|
197510
197515
|
instrumentExpress = generateInstrumentOnce(INTEGRATION_NAME23, (options) => new ExpressInstrumentation(options));
|
|
197511
197516
|
ExpressInstrumentation = class ExpressInstrumentation extends import_instrumentation6.InstrumentationBase {
|
|
@@ -197518,8 +197523,8 @@ var init_express2 = __esm(() => {
|
|
|
197518
197523
|
patchExpressModule(express, () => ({
|
|
197519
197524
|
...this.getConfig(),
|
|
197520
197525
|
onRouteResolved(route) {
|
|
197521
|
-
const rpcMetadata =
|
|
197522
|
-
if (route && rpcMetadata?.type ===
|
|
197526
|
+
const rpcMetadata = import_core102.getRPCMetadata(import_api16.context.active());
|
|
197527
|
+
if (route && rpcMetadata?.type === import_core102.RPCType.HTTP) {
|
|
197523
197528
|
rpcMetadata.route = route;
|
|
197524
197529
|
}
|
|
197525
197530
|
}
|
|
@@ -201415,13 +201420,13 @@ function addFastifyV3SpanAttributes(span) {
|
|
|
201415
201420
|
span.updateName(updatedName);
|
|
201416
201421
|
}
|
|
201417
201422
|
}
|
|
201418
|
-
var import_api18,
|
|
201423
|
+
var import_api18, import_core104, import_instrumentation7, import_semantic_conventions4, PACKAGE_VERSION = "0.1.0", PACKAGE_NAME2 = "@sentry/instrumentation-fastify-v3", ANONYMOUS_NAME = "anonymous", hooksNamesToWrap, FastifyInstrumentationV3;
|
|
201419
201424
|
var init_instrumentation = __esm(() => {
|
|
201420
201425
|
init_esm();
|
|
201421
201426
|
init_AttributeNames();
|
|
201422
201427
|
init_utils14();
|
|
201423
201428
|
import_api18 = __toESM(require_src(), 1);
|
|
201424
|
-
|
|
201429
|
+
import_core104 = __toESM(require_src6(), 1);
|
|
201425
201430
|
import_instrumentation7 = __toESM(require_src8(), 1);
|
|
201426
201431
|
import_semantic_conventions4 = __toESM(require_src5(), 1);
|
|
201427
201432
|
hooksNamesToWrap = new Set([
|
|
@@ -201454,9 +201459,9 @@ var init_instrumentation = __esm(() => {
|
|
|
201454
201459
|
}
|
|
201455
201460
|
instrumentation._wrap(reply, "send", instrumentation._patchSend());
|
|
201456
201461
|
const anyRequest = request2;
|
|
201457
|
-
const rpcMetadata =
|
|
201462
|
+
const rpcMetadata = import_core104.getRPCMetadata(import_api18.context.active());
|
|
201458
201463
|
const routeName = anyRequest.routeOptions ? anyRequest.routeOptions.url : request2.routerPath;
|
|
201459
|
-
if (routeName && rpcMetadata?.type ===
|
|
201464
|
+
if (routeName && rpcMetadata?.type === import_core104.RPCType.HTTP) {
|
|
201460
201465
|
rpcMetadata.route = routeName;
|
|
201461
201466
|
}
|
|
201462
201467
|
const method = request2.method || "GET";
|
|
@@ -242831,7 +242836,7 @@ var init_sentry_scrub = __esm(() => {
|
|
|
242831
242836
|
var require_package7 = __commonJS((exports, module) => {
|
|
242832
242837
|
module.exports = {
|
|
242833
242838
|
name: "@omni/api",
|
|
242834
|
-
version: "2.260804.
|
|
242839
|
+
version: "2.260804.3",
|
|
242835
242840
|
type: "module",
|
|
242836
242841
|
exports: {
|
|
242837
242842
|
".": {
|
|
@@ -382667,6 +382672,7 @@ var src_default2 = plugin3;
|
|
|
382667
382672
|
|
|
382668
382673
|
// ../channel-hermes/src/plugin.ts
|
|
382669
382674
|
init_src2();
|
|
382675
|
+
init_src();
|
|
382670
382676
|
|
|
382671
382677
|
// ../channel-hermes/src/capabilities.ts
|
|
382672
382678
|
init_src2();
|
|
@@ -383121,6 +383127,33 @@ async function sendTemplate(client, to, opts, replyTo) {
|
|
|
383121
383127
|
payload.context = { message_id: replyTo };
|
|
383122
383128
|
return client.sendMessage(payload);
|
|
383123
383129
|
}
|
|
383130
|
+
// ../channel-hermes/src/senders/interactive.ts
|
|
383131
|
+
async function sendPlannedInteractive(client, to, interactive, replyTo) {
|
|
383132
|
+
const payload = {
|
|
383133
|
+
to: toHermesPhone(to),
|
|
383134
|
+
recipient_type: "individual",
|
|
383135
|
+
type: "interactive",
|
|
383136
|
+
interactive
|
|
383137
|
+
};
|
|
383138
|
+
if (replyTo)
|
|
383139
|
+
payload.context = { message_id: replyTo };
|
|
383140
|
+
return client.sendMessage(payload);
|
|
383141
|
+
}
|
|
383142
|
+
async function sendLocationRequest(client, to, bodyText, replyTo) {
|
|
383143
|
+
const payload = {
|
|
383144
|
+
to: toHermesPhone(to),
|
|
383145
|
+
recipient_type: "individual",
|
|
383146
|
+
type: "interactive",
|
|
383147
|
+
interactive: {
|
|
383148
|
+
type: "location_request_message",
|
|
383149
|
+
body: { text: bodyText },
|
|
383150
|
+
action: { name: "send_location" }
|
|
383151
|
+
}
|
|
383152
|
+
};
|
|
383153
|
+
if (replyTo)
|
|
383154
|
+
payload.context = { message_id: replyTo };
|
|
383155
|
+
return client.sendMessage(payload);
|
|
383156
|
+
}
|
|
383124
383157
|
// ../channel-hermes/src/plugin.ts
|
|
383125
383158
|
var HERMES_MEDIA_TYPES = new Set(["image", "audio", "video", "document", "sticker"]);
|
|
383126
383159
|
var downloadGuard2 = createDownloadGuard();
|
|
@@ -383200,7 +383233,7 @@ class HermesPlugin extends BaseChannelPlugin {
|
|
|
383200
383233
|
if (correlationId)
|
|
383201
383234
|
this.captureT10(correlationId);
|
|
383202
383235
|
try {
|
|
383203
|
-
const dispatched = await dispatchOutbound(state, message2);
|
|
383236
|
+
const dispatched = await dispatchOutbound(state, message2, this.logger);
|
|
383204
383237
|
if (!dispatched.ok) {
|
|
383205
383238
|
return { success: false, error: dispatched.error, retryable: false, timestamp: Date.now() };
|
|
383206
383239
|
}
|
|
@@ -383445,11 +383478,14 @@ class HermesPlugin extends BaseChannelPlugin {
|
|
|
383445
383478
|
}
|
|
383446
383479
|
}
|
|
383447
383480
|
}
|
|
383448
|
-
async function dispatchOutbound(state, message2) {
|
|
383481
|
+
async function dispatchOutbound(state, message2, logger5) {
|
|
383449
383482
|
const { client } = state;
|
|
383450
383483
|
const { content, to, replyTo } = message2;
|
|
383451
383484
|
if (content.type === "text") {
|
|
383452
|
-
return
|
|
383485
|
+
return dispatchOutboundText(client, message2, logger5);
|
|
383486
|
+
}
|
|
383487
|
+
if (content.type === "location_request") {
|
|
383488
|
+
return { ok: true, response: await sendLocationRequest(client, to, resolveOutboundText(message2), replyTo) };
|
|
383453
383489
|
}
|
|
383454
383490
|
if (HERMES_MEDIA_TYPES.has(content.type)) {
|
|
383455
383491
|
return dispatchOutboundMedia(client, message2);
|
|
@@ -383476,6 +383512,30 @@ async function dispatchOutbound(state, message2) {
|
|
|
383476
383512
|
}
|
|
383477
383513
|
return { ok: false, error: `Unsupported content.type=${content.type} for hermes` };
|
|
383478
383514
|
}
|
|
383515
|
+
function resolveOutboundText(message2) {
|
|
383516
|
+
const formatMode = message2.metadata?.messageFormatMode ?? "convert";
|
|
383517
|
+
const text = message2.content.text ?? "";
|
|
383518
|
+
return formatMode === "passthrough" ? text : markdownToWhatsApp(text);
|
|
383519
|
+
}
|
|
383520
|
+
async function dispatchOutboundText(client, message2, logger5) {
|
|
383521
|
+
const { content, to, replyTo } = message2;
|
|
383522
|
+
const formatted = resolveOutboundText(message2);
|
|
383523
|
+
if (!content.buttons?.length) {
|
|
383524
|
+
return { ok: true, response: await sendText2(client, to, formatted, replyTo) };
|
|
383525
|
+
}
|
|
383526
|
+
const plan = planInteractive(formatted, content.buttons, content.list?.buttonLabel ?? "Options", {
|
|
383527
|
+
sectionTitle: content.list?.sectionTitle,
|
|
383528
|
+
forceList: content.list?.forceList
|
|
383529
|
+
});
|
|
383530
|
+
if (plan.droppedRows > 0) {
|
|
383531
|
+
logger5?.warn("[hermes] interactive list capped at 10 rows \u2014 extra buttons dropped", {
|
|
383532
|
+
to,
|
|
383533
|
+
droppedRows: plan.droppedRows
|
|
383534
|
+
});
|
|
383535
|
+
}
|
|
383536
|
+
const response = plan.interactive ? await sendPlannedInteractive(client, to, plan.interactive, replyTo) : await sendText2(client, to, plan.body, replyTo);
|
|
383537
|
+
return { ok: true, response };
|
|
383538
|
+
}
|
|
383479
383539
|
async function dispatchOutboundMedia(client, message2) {
|
|
383480
383540
|
const { content, to, replyTo } = message2;
|
|
383481
383541
|
const caption = content.caption ?? content.text;
|