@sentry/junior 0.117.0 → 0.119.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-5IK4LPLP.js → agent-hooks-NZSV4QQR.js} +9 -11
- package/dist/api/conversations/detail.d.ts +17 -0
- package/dist/api/conversations/event-list.d.ts +17 -0
- package/dist/api/schema/conversation.d.ts +68 -0
- package/dist/api/schema/stats.d.ts +22 -0
- package/dist/api/schema.d.ts +2 -0
- package/dist/api/schema.js +7 -3
- package/dist/api/stats.d.ts +16 -0
- package/dist/api/user-pages/routes.d.ts +4 -0
- package/dist/api.js +223 -20
- package/dist/app.js +43 -38
- package/dist/{catalog-runtime-MTUYW3AA.js → catalog-runtime-TAOYIZIZ.js} +5 -5
- package/dist/chat/agent/prompt.d.ts +4 -2
- package/dist/chat/plugins/user-pages.d.ts +15 -0
- package/dist/chat/plugins/viewer-actors.d.ts +6 -0
- package/dist/chat/prompt.d.ts +1 -2
- package/dist/chat/sandbox/paths.d.ts +2 -0
- package/dist/chat/sandbox/sandbox.d.ts +3 -1
- package/dist/chat/sandbox/workspace.d.ts +1 -0
- package/dist/chat/skills.d.ts +1 -2
- package/dist/chat/slack/tools/canvas/api.d.ts +2 -9
- package/dist/chat/slack/tools/canvas/markdown.d.ts +9 -0
- package/dist/chat/tools/index.d.ts +4 -1
- package/dist/chat/tools/sandbox/file-utils.d.ts +11 -0
- package/dist/chat/tools/sandbox/find-files.d.ts +2 -1
- package/dist/chat/tools/sandbox/grep.d.ts +2 -1
- package/dist/{chunk-6G45D3YG.js → chunk-4UIUDOOV.js} +16 -233
- package/dist/{chunk-LUMEBOWC.js → chunk-6ZR455DC.js} +2 -2
- package/dist/{chunk-STUI6NIL.js → chunk-BLQZACHV.js} +511 -14
- package/dist/{chunk-27KWTFP6.js → chunk-BNJEPYTC.js} +5 -14
- package/dist/{chunk-ZRQUQJUV.js → chunk-D3N4BPSL.js} +3 -3
- package/dist/{chunk-WKU7TY22.js → chunk-FIANEE7Z.js} +3 -1
- package/dist/{chunk-RXRQJF7Y.js → chunk-GCGJGSQL.js} +21 -0
- package/dist/{chunk-FAWBONPC.js → chunk-GKFDU3ZI.js} +5 -7
- package/dist/{chunk-FXOYURO4.js → chunk-HDFGNU5E.js} +1 -0
- package/dist/{chunk-3GE3F4LT.js → chunk-JLJLZS2N.js} +1 -1
- package/dist/{chunk-CU7HTGNI.js → chunk-JSTGI7TX.js} +1 -1
- package/dist/chunk-JXRAOOXQ.js +37 -0
- package/dist/{chunk-WUNPRM76.js → chunk-NUENIPQL.js} +1 -1
- package/dist/{chunk-BFIRIZPH.js → chunk-O2ULQJWR.js} +101 -2
- package/dist/{chunk-AKG4TZNH.js → chunk-QZ7XRJDB.js} +30 -9
- package/dist/{chunk-5O3JDQDG.js → chunk-R53UT2OI.js} +1 -1
- package/dist/{chunk-W5JEQQEA.js → chunk-TAGV4Z3J.js} +1 -1
- package/dist/{chunk-NHZEUHKH.js → chunk-TGIQN7QW.js} +388 -113
- package/dist/{chunk-KU6ALEJC.js → chunk-VJTWKJWQ.js} +30 -2
- package/dist/{chunk-DS27ZBSP.js → chunk-VLTWQQKH.js} +2 -2
- package/dist/{chunk-WEK3V5RI.js → chunk-YLYJIQRX.js} +226 -21
- package/dist/{chunk-LN765Y4N.js → chunk-ZFX4M743.js} +15 -9
- package/dist/{chunk-72Z3HNTQ.js → chunk-ZJ6IVZVO.js} +1 -1
- package/dist/cli/chat.js +24 -25
- package/dist/cli/check.js +6 -6
- package/dist/cli/init.js +2 -2
- package/dist/cli/plugins.js +13 -15
- package/dist/cli/snapshot-create.js +9 -10
- package/dist/cli/upgrade.js +8 -8
- package/dist/db/schema/stats.d.ts +93 -0
- package/dist/db/schema.d.ts +94 -1
- package/dist/{db-J2ITKS63.js → db-FWGP5CKY.js} +7 -7
- package/dist/instrumentation.js +3 -3
- package/dist/nitro.js +3 -3
- package/dist/{oauth-callback-server-NQYKBT24.js → oauth-callback-server-PM3QNXJQ.js} +16 -18
- package/dist/{plugins-IUJA4VBU.js → plugins-HW4VWW6G.js} +1 -1
- package/dist/{runner-53V5GIQM.js → runner-DV55N6ZB.js} +11 -13
- package/dist/{skills-BU3ZMLVB.js → skills-MANV5ZK6.js} +6 -6
- package/dist/stats.d.ts +18 -0
- package/dist/{validation-74EIKKE6.js → validation-QGB4INTI.js} +6 -6
- package/dist/version.js +1 -1
- package/migrations/0011_sour_golden_guardian.sql +8 -0
- package/migrations/meta/0011_snapshot.json +1195 -0
- package/migrations/meta/_journal.json +8 -1
- package/package.json +5 -5
- package/dist/chunk-4ZNGQH7C.js +0 -25
- package/dist/chunk-YRWJ3KEU.js +0 -517
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getChatConfig
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VLTWQQKH.js";
|
|
4
4
|
|
|
5
5
|
// src/chat/state/adapter.ts
|
|
6
6
|
import { createMemoryState } from "@chat-adapter/state-memory";
|
|
@@ -291,15 +291,43 @@ function sandboxSkillDir(skillName) {
|
|
|
291
291
|
function sandboxSkillFile(skillName) {
|
|
292
292
|
return `${sandboxSkillDir(skillName)}/SKILL.md`;
|
|
293
293
|
}
|
|
294
|
+
function sandboxSkillPathResolution(skillName) {
|
|
295
|
+
const skillDir = sandboxSkillDir(skillName);
|
|
296
|
+
return `Resolve relative paths in this skill against ${skillDir}. For bash commands from this skill, cd to ${skillDir} first or use absolute paths.`;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
// src/chat/sleep.ts
|
|
300
|
+
function sleep(ms, signal) {
|
|
301
|
+
if (!signal) {
|
|
302
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
303
|
+
}
|
|
304
|
+
return new Promise((resolve, reject) => {
|
|
305
|
+
if (signal.aborted) {
|
|
306
|
+
reject(signal.reason);
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
const timeoutId = setTimeout(() => {
|
|
310
|
+
signal.removeEventListener("abort", onAbort);
|
|
311
|
+
resolve();
|
|
312
|
+
}, ms);
|
|
313
|
+
const onAbort = () => {
|
|
314
|
+
clearTimeout(timeoutId);
|
|
315
|
+
reject(signal.reason);
|
|
316
|
+
};
|
|
317
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
318
|
+
});
|
|
319
|
+
}
|
|
294
320
|
|
|
295
321
|
export {
|
|
296
322
|
acquireActiveLock,
|
|
297
323
|
getDefaultRedisStateAdapterFor,
|
|
298
324
|
getStateAdapter,
|
|
299
325
|
disconnectStateAdapter,
|
|
326
|
+
sleep,
|
|
300
327
|
SANDBOX_WORKSPACE_ROOT,
|
|
301
328
|
SANDBOX_SKILLS_ROOT,
|
|
302
329
|
SANDBOX_DATA_ROOT,
|
|
303
330
|
sandboxSkillDir,
|
|
304
|
-
sandboxSkillFile
|
|
331
|
+
sandboxSkillFile,
|
|
332
|
+
sandboxSkillPathResolution
|
|
305
333
|
};
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
toCanonicalInputMessage,
|
|
5
5
|
toCanonicalOutputMessage,
|
|
6
6
|
toGenAiMessagesTraceAttributes
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-HDFGNU5E.js";
|
|
8
8
|
import {
|
|
9
9
|
extractGenAiUsageAttributes,
|
|
10
10
|
logException,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
normalizeGenAiFinishReason,
|
|
13
13
|
serializeGenAiAttribute,
|
|
14
14
|
withSpan
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-ZJ6IVZVO.js";
|
|
16
16
|
|
|
17
17
|
// src/chat/config.ts
|
|
18
18
|
import { getModel as getModel2 } from "@earendil-works/pi-ai/compat";
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
ConversationTurnLifecycleService,
|
|
6
6
|
buildDeliveredTurnStatePatch,
|
|
7
7
|
finalizeFailedTurnReplyWithEvent,
|
|
8
|
+
getInterruptionMarker,
|
|
8
9
|
getTurnUserMessage,
|
|
9
10
|
getTurnUserMessageId,
|
|
10
11
|
getTurnUserReplyAttachmentContext,
|
|
@@ -12,7 +13,7 @@ import {
|
|
|
12
13
|
persistAuthPauseTurnState,
|
|
13
14
|
requireTurnFailureEventId,
|
|
14
15
|
scheduleSessionCompletedPluginTasks
|
|
15
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-ZFX4M743.js";
|
|
16
17
|
import {
|
|
17
18
|
buildSentryConversationUrl
|
|
18
19
|
} from "./chunk-4CODA7P5.js";
|
|
@@ -31,15 +32,15 @@ import {
|
|
|
31
32
|
getMcpAuthSession,
|
|
32
33
|
getMcpProviderErrorAttributes,
|
|
33
34
|
getMcpStoredOAuthCredentials,
|
|
35
|
+
normalizeSlackReplyMarkdown,
|
|
34
36
|
normalizeSlackStatusText,
|
|
35
37
|
parseOAuthStatePayload,
|
|
36
38
|
postSlackMessage,
|
|
37
39
|
removeReactionFromMessage,
|
|
38
40
|
resolveBaseUrl,
|
|
39
41
|
resolvePluginOAuthAccount,
|
|
40
|
-
splitSlackReplyText,
|
|
41
42
|
truncateStatusText
|
|
42
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-4UIUDOOV.js";
|
|
43
44
|
import {
|
|
44
45
|
JUNIOR_THREAD_STATE_TTL_MS,
|
|
45
46
|
TurnSliceLimitExceededError,
|
|
@@ -69,30 +70,28 @@ import {
|
|
|
69
70
|
recordDeliveredAssistantMessage,
|
|
70
71
|
turnHasReply,
|
|
71
72
|
updateConversationStats
|
|
72
|
-
} from "./chunk-
|
|
73
|
-
import {
|
|
74
|
-
getDashboardConversationLink,
|
|
75
|
-
getPluginSlackConversationLink
|
|
76
|
-
} from "./chunk-STUI6NIL.js";
|
|
77
|
-
import {
|
|
78
|
-
acquireActiveLock,
|
|
79
|
-
getDefaultRedisStateAdapterFor,
|
|
80
|
-
getStateAdapter
|
|
81
|
-
} from "./chunk-KU6ALEJC.js";
|
|
73
|
+
} from "./chunk-BNJEPYTC.js";
|
|
82
74
|
import {
|
|
83
75
|
SlackActionError,
|
|
76
|
+
getDashboardConversationLink,
|
|
84
77
|
getHeaderString,
|
|
78
|
+
getPluginSlackConversationLink,
|
|
85
79
|
getSlackClient,
|
|
86
80
|
isDmChannel,
|
|
87
81
|
normalizeSlackConversationId
|
|
88
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-BLQZACHV.js";
|
|
89
83
|
import {
|
|
90
84
|
getConversationEventStore,
|
|
91
85
|
getConversationStore,
|
|
92
86
|
parseDestination,
|
|
93
87
|
requireSlackDestination,
|
|
94
88
|
sameDestination
|
|
95
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-D3N4BPSL.js";
|
|
90
|
+
import {
|
|
91
|
+
acquireActiveLock,
|
|
92
|
+
getDefaultRedisStateAdapterFor,
|
|
93
|
+
getStateAdapter
|
|
94
|
+
} from "./chunk-VJTWKJWQ.js";
|
|
96
95
|
import {
|
|
97
96
|
FUNCTION_TIMEOUT_BUFFER_SECONDS,
|
|
98
97
|
botConfig,
|
|
@@ -101,24 +100,24 @@ import {
|
|
|
101
100
|
getRuntimeMetadata,
|
|
102
101
|
normalizeSlackEmojiName,
|
|
103
102
|
standardModelId
|
|
104
|
-
} from "./chunk-
|
|
103
|
+
} from "./chunk-VLTWQQKH.js";
|
|
105
104
|
import {
|
|
106
105
|
parseSlackThreadId,
|
|
107
106
|
readSlackRawMessageContext,
|
|
108
107
|
resolveSlackChannelIdFromMessage,
|
|
109
108
|
resolveSlackChannelIdFromThreadId
|
|
110
|
-
} from "./chunk-
|
|
109
|
+
} from "./chunk-HDFGNU5E.js";
|
|
111
110
|
import {
|
|
112
111
|
discoverSkills
|
|
113
|
-
} from "./chunk-
|
|
112
|
+
} from "./chunk-QZ7XRJDB.js";
|
|
114
113
|
import {
|
|
115
114
|
pluginCatalogRuntime
|
|
116
|
-
} from "./chunk-
|
|
115
|
+
} from "./chunk-JSTGI7TX.js";
|
|
117
116
|
import {
|
|
118
117
|
buildOAuthTokenRequest,
|
|
119
118
|
hasRequiredOAuthScope,
|
|
120
119
|
parseOAuthTokenResponse
|
|
121
|
-
} from "./chunk-
|
|
120
|
+
} from "./chunk-R53UT2OI.js";
|
|
122
121
|
import {
|
|
123
122
|
createSlackResumeActor,
|
|
124
123
|
isUserActor,
|
|
@@ -129,7 +128,7 @@ import {
|
|
|
129
128
|
logException,
|
|
130
129
|
logInfo,
|
|
131
130
|
logWarn
|
|
132
|
-
} from "./chunk-
|
|
131
|
+
} from "./chunk-ZJ6IVZVO.js";
|
|
133
132
|
import {
|
|
134
133
|
isRecord,
|
|
135
134
|
toOptionalNumber,
|
|
@@ -547,6 +546,210 @@ function buildSlackReplyBlocks(text, footer) {
|
|
|
547
546
|
return blocks;
|
|
548
547
|
}
|
|
549
548
|
|
|
549
|
+
// src/chat/slack/output.ts
|
|
550
|
+
var MAX_INLINE_CHARS = 2200;
|
|
551
|
+
var MAX_INLINE_LINES = 45;
|
|
552
|
+
var CONTINUED_MARKER = "\n\n[Continued below]";
|
|
553
|
+
function countSlackLines(text) {
|
|
554
|
+
if (!text) {
|
|
555
|
+
return 0;
|
|
556
|
+
}
|
|
557
|
+
return text.split("\n").length;
|
|
558
|
+
}
|
|
559
|
+
function fitsInlineBudget(text, maxChars = MAX_INLINE_CHARS, maxLines = MAX_INLINE_LINES) {
|
|
560
|
+
return text.length <= maxChars && countSlackLines(text) <= maxLines;
|
|
561
|
+
}
|
|
562
|
+
function findSplitIndex(text, maxChars) {
|
|
563
|
+
if (text.length <= maxChars) {
|
|
564
|
+
return text.length;
|
|
565
|
+
}
|
|
566
|
+
const bounded = text.slice(0, maxChars);
|
|
567
|
+
const newlineIndex = bounded.lastIndexOf("\n");
|
|
568
|
+
if (newlineIndex > 0) {
|
|
569
|
+
return newlineIndex;
|
|
570
|
+
}
|
|
571
|
+
const spaceIndex = bounded.lastIndexOf(" ");
|
|
572
|
+
if (spaceIndex > 0) {
|
|
573
|
+
return spaceIndex;
|
|
574
|
+
}
|
|
575
|
+
return maxChars;
|
|
576
|
+
}
|
|
577
|
+
function splitByLineBudget(text, maxLines) {
|
|
578
|
+
if (maxLines <= 0) {
|
|
579
|
+
return "";
|
|
580
|
+
}
|
|
581
|
+
const lines = text.split("\n");
|
|
582
|
+
if (lines.length <= maxLines) {
|
|
583
|
+
return text;
|
|
584
|
+
}
|
|
585
|
+
return lines.slice(0, maxLines).join("\n");
|
|
586
|
+
}
|
|
587
|
+
function reserveInlineBudgetForSuffix(suffix, maxChars = MAX_INLINE_CHARS, maxLines = MAX_INLINE_LINES) {
|
|
588
|
+
return {
|
|
589
|
+
maxChars: Math.max(1, maxChars - suffix.length),
|
|
590
|
+
maxLines: Math.max(1, maxLines - Math.max(0, countSlackLines(suffix) - 1))
|
|
591
|
+
};
|
|
592
|
+
}
|
|
593
|
+
function forceSplitBudget(text, budget) {
|
|
594
|
+
const lineCount = countSlackLines(text);
|
|
595
|
+
return {
|
|
596
|
+
maxChars: text.length <= budget.maxChars ? Math.max(1, text.length - 1) : budget.maxChars,
|
|
597
|
+
maxLines: lineCount <= budget.maxLines ? Math.max(1, lineCount - 1) : budget.maxLines
|
|
598
|
+
};
|
|
599
|
+
}
|
|
600
|
+
function getFenceContinuation(text) {
|
|
601
|
+
let open;
|
|
602
|
+
for (const line of text.split("\n")) {
|
|
603
|
+
const trimmed = line.trimStart();
|
|
604
|
+
const openerMatch = trimmed.match(/^(`{3,}|~{3,})(.*)$/);
|
|
605
|
+
if (!openerMatch) {
|
|
606
|
+
continue;
|
|
607
|
+
}
|
|
608
|
+
if (!open) {
|
|
609
|
+
open = {
|
|
610
|
+
fence: openerMatch[1],
|
|
611
|
+
openerLine: trimmed
|
|
612
|
+
};
|
|
613
|
+
continue;
|
|
614
|
+
}
|
|
615
|
+
if (new RegExp(`^${open.fence}\\s*$`).test(trimmed)) {
|
|
616
|
+
open = void 0;
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
if (!open) {
|
|
620
|
+
return null;
|
|
621
|
+
}
|
|
622
|
+
return {
|
|
623
|
+
closeSuffix: text.endsWith("\n") ? open.fence : `
|
|
624
|
+
${open.fence}`,
|
|
625
|
+
reopenPrefix: `${open.openerLine}
|
|
626
|
+
`
|
|
627
|
+
};
|
|
628
|
+
}
|
|
629
|
+
function appendSlackSuffix(text, marker) {
|
|
630
|
+
const carryover = getFenceContinuation(text);
|
|
631
|
+
return `${text}${carryover?.closeSuffix ?? ""}${marker}`;
|
|
632
|
+
}
|
|
633
|
+
function stripTrailingContinuationMarker(text) {
|
|
634
|
+
return text.endsWith(CONTINUED_MARKER) ? text.slice(0, -CONTINUED_MARKER.length) : text;
|
|
635
|
+
}
|
|
636
|
+
function takeSlackContinuationChunk(text, budget) {
|
|
637
|
+
let { prefix, rest } = takeSlackInlinePrefix(text, budget);
|
|
638
|
+
if (!rest) {
|
|
639
|
+
({ prefix, rest } = takeSlackInlinePrefix(
|
|
640
|
+
text,
|
|
641
|
+
forceSplitBudget(text, budget)
|
|
642
|
+
));
|
|
643
|
+
}
|
|
644
|
+
let carryover = rest ? getFenceContinuation(prefix) : null;
|
|
645
|
+
if (!carryover) {
|
|
646
|
+
return { prefix, rest };
|
|
647
|
+
}
|
|
648
|
+
const carryoverBudget = reserveInlineBudgetForSuffix(
|
|
649
|
+
`${carryover.closeSuffix}${CONTINUED_MARKER}`
|
|
650
|
+
);
|
|
651
|
+
({ prefix, rest } = takeSlackInlinePrefix(text, carryoverBudget));
|
|
652
|
+
if (!rest) {
|
|
653
|
+
({ prefix, rest } = takeSlackInlinePrefix(
|
|
654
|
+
text,
|
|
655
|
+
forceSplitBudget(text, carryoverBudget)
|
|
656
|
+
));
|
|
657
|
+
}
|
|
658
|
+
carryover = rest ? getFenceContinuation(prefix) : null;
|
|
659
|
+
if (!carryover) {
|
|
660
|
+
return { prefix, rest };
|
|
661
|
+
}
|
|
662
|
+
return {
|
|
663
|
+
prefix,
|
|
664
|
+
rest: `${carryover.reopenPrefix}${rest}`
|
|
665
|
+
};
|
|
666
|
+
}
|
|
667
|
+
function takeSlackContinuationPrefix(text, options) {
|
|
668
|
+
const budget = {
|
|
669
|
+
maxChars: options?.maxChars ?? getSlackContinuationBudget().maxChars,
|
|
670
|
+
maxLines: options?.maxLines ?? getSlackContinuationBudget().maxLines
|
|
671
|
+
};
|
|
672
|
+
const { prefix, rest } = (() => {
|
|
673
|
+
if (options?.forceSplit) {
|
|
674
|
+
return takeSlackContinuationChunk(text, budget);
|
|
675
|
+
}
|
|
676
|
+
const initial = takeSlackInlinePrefix(text, budget);
|
|
677
|
+
return initial.rest ? takeSlackContinuationChunk(text, budget) : initial;
|
|
678
|
+
})();
|
|
679
|
+
return {
|
|
680
|
+
prefix,
|
|
681
|
+
renderedPrefix: rest ? appendSlackSuffix(prefix, CONTINUED_MARKER) : prefix,
|
|
682
|
+
rest
|
|
683
|
+
};
|
|
684
|
+
}
|
|
685
|
+
function takeSlackInlinePrefix(text, options) {
|
|
686
|
+
const maxChars = options?.maxChars ?? MAX_INLINE_CHARS;
|
|
687
|
+
const maxLines = options?.maxLines ?? MAX_INLINE_LINES;
|
|
688
|
+
const normalized = text.replace(/\r\n?/g, "\n");
|
|
689
|
+
if (!normalized) {
|
|
690
|
+
return { prefix: "", rest: "" };
|
|
691
|
+
}
|
|
692
|
+
if (fitsInlineBudget(normalized, maxChars, maxLines)) {
|
|
693
|
+
return { prefix: normalized, rest: "" };
|
|
694
|
+
}
|
|
695
|
+
const lineBounded = splitByLineBudget(normalized, maxLines);
|
|
696
|
+
const cutIndex = findSplitIndex(lineBounded, maxChars);
|
|
697
|
+
const prefix = lineBounded.slice(0, cutIndex).trimEnd();
|
|
698
|
+
if (prefix) {
|
|
699
|
+
return {
|
|
700
|
+
prefix,
|
|
701
|
+
rest: normalized.slice(prefix.length).trimStart()
|
|
702
|
+
};
|
|
703
|
+
}
|
|
704
|
+
const hardPrefix = normalized.slice(0, Math.max(1, maxChars)).trimEnd();
|
|
705
|
+
return {
|
|
706
|
+
prefix: hardPrefix || normalized.slice(0, Math.max(1, maxChars)),
|
|
707
|
+
rest: normalized.slice(hardPrefix.length || Math.max(1, maxChars)).trimStart()
|
|
708
|
+
};
|
|
709
|
+
}
|
|
710
|
+
function splitSlackReplyText(text, options) {
|
|
711
|
+
const normalized = normalizeSlackReplyMarkdown(text);
|
|
712
|
+
if (!normalized) {
|
|
713
|
+
return [];
|
|
714
|
+
}
|
|
715
|
+
const chunks = [];
|
|
716
|
+
const continuationBudget = reserveInlineBudgetForSuffix(CONTINUED_MARKER);
|
|
717
|
+
let remaining = normalized;
|
|
718
|
+
while (remaining) {
|
|
719
|
+
const fitsFinalChunk = options?.interrupted ? fitsInlineBudget(appendSlackSuffix(remaining, getInterruptionMarker())) : fitsInlineBudget(remaining);
|
|
720
|
+
if (fitsFinalChunk) {
|
|
721
|
+
chunks.push(
|
|
722
|
+
options?.interrupted ? appendSlackSuffix(remaining, getInterruptionMarker()) : remaining
|
|
723
|
+
);
|
|
724
|
+
break;
|
|
725
|
+
}
|
|
726
|
+
const { renderedPrefix, rest } = takeSlackContinuationPrefix(remaining, {
|
|
727
|
+
...continuationBudget,
|
|
728
|
+
forceSplit: true
|
|
729
|
+
});
|
|
730
|
+
chunks.push(renderedPrefix);
|
|
731
|
+
remaining = rest;
|
|
732
|
+
}
|
|
733
|
+
if (chunks.length === 2) {
|
|
734
|
+
chunks[0] = stripTrailingContinuationMarker(chunks[0] ?? "");
|
|
735
|
+
}
|
|
736
|
+
return chunks;
|
|
737
|
+
}
|
|
738
|
+
function getSlackContinuationBudget() {
|
|
739
|
+
return reserveInlineBudgetForSuffix(CONTINUED_MARKER);
|
|
740
|
+
}
|
|
741
|
+
function buildSlackOutputMessage(text) {
|
|
742
|
+
const normalized = normalizeSlackReplyMarkdown(text);
|
|
743
|
+
if (!normalized) {
|
|
744
|
+
throw new Error(
|
|
745
|
+
`Slack output normalized to empty content: original_length=${text.length} parsed_length=${normalized.length}`
|
|
746
|
+
);
|
|
747
|
+
}
|
|
748
|
+
return {
|
|
749
|
+
markdown: normalized
|
|
750
|
+
};
|
|
751
|
+
}
|
|
752
|
+
|
|
550
753
|
// src/chat/slack/reply.ts
|
|
551
754
|
async function sendSlackReply(args) {
|
|
552
755
|
const chunks = splitSlackReplyText(args.text);
|
|
@@ -4330,6 +4533,8 @@ export {
|
|
|
4330
4533
|
removeActiveConversation2 as removeActiveConversation,
|
|
4331
4534
|
listActiveConversationIds2 as listActiveConversationIds,
|
|
4332
4535
|
createSlackAdapterAssistantStatusSession,
|
|
4536
|
+
splitSlackReplyText,
|
|
4537
|
+
buildSlackOutputMessage,
|
|
4333
4538
|
sendSlackReply,
|
|
4334
4539
|
getSlackApiErrorCode,
|
|
4335
4540
|
getSlackErrorObservabilityAttributes,
|
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
clearPendingAuth,
|
|
9
9
|
coerceThreadConversationState,
|
|
10
10
|
getAgentTurnSessionRecord,
|
|
11
|
-
getInterruptionMarker,
|
|
12
11
|
getPersistedThreadState,
|
|
13
12
|
getPiMessageRole,
|
|
14
13
|
hydrateConversationMessages,
|
|
@@ -23,28 +22,28 @@ import {
|
|
|
23
22
|
persistThreadStateById,
|
|
24
23
|
stripRuntimeTurnContext,
|
|
25
24
|
updateConversationStats
|
|
26
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-BNJEPYTC.js";
|
|
27
26
|
import {
|
|
28
27
|
createPluginEmbedder,
|
|
29
28
|
createPluginLogger,
|
|
30
29
|
createPluginModel,
|
|
31
30
|
createPluginState,
|
|
32
31
|
getPlugins
|
|
33
|
-
} from "./chunk-
|
|
34
|
-
import {
|
|
35
|
-
getStateAdapter
|
|
36
|
-
} from "./chunk-KU6ALEJC.js";
|
|
32
|
+
} from "./chunk-BLQZACHV.js";
|
|
37
33
|
import {
|
|
38
34
|
getDb
|
|
39
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-D3N4BPSL.js";
|
|
36
|
+
import {
|
|
37
|
+
getStateAdapter
|
|
38
|
+
} from "./chunk-VJTWKJWQ.js";
|
|
40
39
|
import {
|
|
41
40
|
ProviderError,
|
|
42
41
|
getProviderErrorAttributes,
|
|
43
42
|
getProviderErrorUserMessage
|
|
44
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-VLTWQQKH.js";
|
|
45
44
|
import {
|
|
46
45
|
buildTurnFailureResponse
|
|
47
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-ZJ6IVZVO.js";
|
|
48
47
|
import {
|
|
49
48
|
parseSlackMessageTs
|
|
50
49
|
} from "./chunk-F3B2YJ76.js";
|
|
@@ -385,6 +384,12 @@ async function processPluginTask(message, options = {}) {
|
|
|
385
384
|
});
|
|
386
385
|
}
|
|
387
386
|
|
|
387
|
+
// src/chat/interruption-marker.ts
|
|
388
|
+
var INTERRUPTED_MARKER = "\n\n[Response interrupted before completion]";
|
|
389
|
+
function getInterruptionMarker() {
|
|
390
|
+
return INTERRUPTED_MARKER;
|
|
391
|
+
}
|
|
392
|
+
|
|
388
393
|
// src/chat/services/turn-failure-response.ts
|
|
389
394
|
function requireTurnFailureEventId(eventId, eventName) {
|
|
390
395
|
if (!eventId) {
|
|
@@ -594,6 +599,7 @@ export {
|
|
|
594
599
|
getTurnUserReplyAttachmentContext,
|
|
595
600
|
scheduleSessionCompletedPluginTasks,
|
|
596
601
|
processPluginTask,
|
|
602
|
+
getInterruptionMarker,
|
|
597
603
|
requireTurnFailureEventId,
|
|
598
604
|
getAgentTurnDiagnosticsAttributes,
|
|
599
605
|
finalizeFailedTurnReplyWithEvent,
|
package/dist/cli/chat.js
CHANGED
|
@@ -1,40 +1,39 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAgentRunner,
|
|
3
3
|
executeAgentRun
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-TGIQN7QW.js";
|
|
5
5
|
import "../chunk-DIB4GX3G.js";
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-4UIUDOOV.js";
|
|
7
|
+
import "../chunk-BNJEPYTC.js";
|
|
8
8
|
import "../chunk-HDSDCEPK.js";
|
|
9
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-GKFDU3ZI.js";
|
|
10
|
+
import "../chunk-JXRAOOXQ.js";
|
|
10
11
|
import "../chunk-MU6HHZEN.js";
|
|
11
12
|
import "../chunk-PDO5BLNM.js";
|
|
12
13
|
import "../chunk-UIE3R5XU.js";
|
|
13
14
|
import {
|
|
14
15
|
loadAppPluginSet
|
|
15
16
|
} from "../chunk-Y2CM7HXH.js";
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
20
|
-
import "../chunk-
|
|
21
|
-
import "../chunk-4ZNGQH7C.js";
|
|
22
|
-
import "../chunk-DS27ZBSP.js";
|
|
17
|
+
import "../chunk-BLQZACHV.js";
|
|
18
|
+
import "../chunk-D3N4BPSL.js";
|
|
19
|
+
import "../chunk-GCGJGSQL.js";
|
|
20
|
+
import "../chunk-VJTWKJWQ.js";
|
|
21
|
+
import "../chunk-VLTWQQKH.js";
|
|
23
22
|
import "../chunk-VFUK3X5B.js";
|
|
24
|
-
import "../chunk-
|
|
25
|
-
import "../chunk-
|
|
26
|
-
import "../chunk-
|
|
27
|
-
import "../chunk-
|
|
23
|
+
import "../chunk-HDFGNU5E.js";
|
|
24
|
+
import "../chunk-QZ7XRJDB.js";
|
|
25
|
+
import "../chunk-JSTGI7TX.js";
|
|
26
|
+
import "../chunk-R53UT2OI.js";
|
|
28
27
|
import "../chunk-W3U3YQYI.js";
|
|
29
28
|
import "../chunk-HZF5P5UN.js";
|
|
30
|
-
import "../chunk-
|
|
29
|
+
import "../chunk-ZJ6IVZVO.js";
|
|
31
30
|
import "../chunk-OB42YVAE.js";
|
|
32
31
|
import "../chunk-F3B2YJ76.js";
|
|
33
32
|
import "../chunk-6GWA276C.js";
|
|
34
33
|
import "../chunk-B3IT5END.js";
|
|
35
34
|
import "../chunk-3V7OFJZC.js";
|
|
36
|
-
import "../chunk-
|
|
37
|
-
import "../chunk-
|
|
35
|
+
import "../chunk-NUENIPQL.js";
|
|
36
|
+
import "../chunk-JLJLZS2N.js";
|
|
38
37
|
import "../chunk-MLKGABMK.js";
|
|
39
38
|
|
|
40
39
|
// src/cli/chat.ts
|
|
@@ -156,11 +155,11 @@ async function configureLocalChatPlugins(pluginSet) {
|
|
|
156
155
|
validationModule,
|
|
157
156
|
databaseModule
|
|
158
157
|
] = await Promise.all([
|
|
159
|
-
import("../plugins-
|
|
160
|
-
import("../agent-hooks-
|
|
161
|
-
import("../catalog-runtime-
|
|
162
|
-
import("../validation-
|
|
163
|
-
import("../db-
|
|
158
|
+
import("../plugins-HW4VWW6G.js"),
|
|
159
|
+
import("../agent-hooks-NZSV4QQR.js"),
|
|
160
|
+
import("../catalog-runtime-TAOYIZIZ.js"),
|
|
161
|
+
import("../validation-QGB4INTI.js"),
|
|
162
|
+
import("../db-FWGP5CKY.js")
|
|
164
163
|
]);
|
|
165
164
|
const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
|
|
166
165
|
const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
|
|
@@ -224,8 +223,8 @@ function localDevServerUrl() {
|
|
|
224
223
|
async function prepareLocalChatRun(io, pluginSet) {
|
|
225
224
|
defaultStateAdapterForLocalChat();
|
|
226
225
|
await configureLocalChatPlugins(pluginSet);
|
|
227
|
-
const { runLocalAgentTurn } = await import("../runner-
|
|
228
|
-
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-
|
|
226
|
+
const { runLocalAgentTurn } = await import("../runner-DV55N6ZB.js");
|
|
227
|
+
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-PM3QNXJQ.js");
|
|
229
228
|
const { createLocalOAuthState } = await import("../oauth-relay-3ZU72UGL.js");
|
|
230
229
|
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-CDFAP67O.js");
|
|
231
230
|
const agentRunner = createAgentRunner(executeAgentRun);
|
package/dist/cli/check.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseSkillFile
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-QZ7XRJDB.js";
|
|
4
|
+
import "../chunk-JSTGI7TX.js";
|
|
5
5
|
import {
|
|
6
6
|
parseInlinePluginManifest,
|
|
7
7
|
parsePluginManifest
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-R53UT2OI.js";
|
|
9
9
|
import "../chunk-W3U3YQYI.js";
|
|
10
10
|
import "../chunk-HZF5P5UN.js";
|
|
11
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-ZJ6IVZVO.js";
|
|
12
12
|
import "../chunk-OB42YVAE.js";
|
|
13
13
|
import "../chunk-F3B2YJ76.js";
|
|
14
14
|
import "../chunk-6GWA276C.js";
|
|
@@ -18,8 +18,8 @@ import {
|
|
|
18
18
|
JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE,
|
|
19
19
|
JUNIOR_HEARTBEAT_ROUTE,
|
|
20
20
|
LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION
|
|
21
|
-
} from "../chunk-
|
|
22
|
-
import "../chunk-
|
|
21
|
+
} from "../chunk-NUENIPQL.js";
|
|
22
|
+
import "../chunk-JLJLZS2N.js";
|
|
23
23
|
import "../chunk-MLKGABMK.js";
|
|
24
24
|
|
|
25
25
|
// src/cli/check.ts
|
package/dist/cli/init.js
CHANGED
|
@@ -27,10 +27,10 @@ function writePluginsFile(targetDir) {
|
|
|
27
27
|
fs.writeFileSync(
|
|
28
28
|
path.join(targetDir, "plugins.ts"),
|
|
29
29
|
`import { defineJuniorPlugins } from "@sentry/junior";
|
|
30
|
-
import {
|
|
30
|
+
import { memoryPlugin } from "@sentry/junior-memory";
|
|
31
31
|
|
|
32
32
|
export const plugins = defineJuniorPlugins([
|
|
33
|
-
|
|
33
|
+
memoryPlugin(),
|
|
34
34
|
"@sentry/junior-maintenance",
|
|
35
35
|
]);
|
|
36
36
|
`
|
package/dist/cli/plugins.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
validatePluginEgressCredentialHooks,
|
|
3
3
|
validatePluginRegistrations
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-TAGV4Z3J.js";
|
|
5
5
|
import {
|
|
6
6
|
pluginCatalogConfigFromPluginSet,
|
|
7
7
|
pluginCliRegistrationsFromPluginSet,
|
|
8
8
|
pluginRuntimeRegistrationsFromPluginSet
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-FIANEE7Z.js";
|
|
10
10
|
import {
|
|
11
11
|
loadAppPluginSet
|
|
12
12
|
} from "../chunk-Y2CM7HXH.js";
|
|
@@ -14,31 +14,29 @@ import {
|
|
|
14
14
|
createPluginLogger,
|
|
15
15
|
setPlugins,
|
|
16
16
|
validatePlugins
|
|
17
|
-
} from "../chunk-
|
|
18
|
-
import "../chunk-KU6ALEJC.js";
|
|
19
|
-
import "../chunk-YRWJ3KEU.js";
|
|
17
|
+
} from "../chunk-BLQZACHV.js";
|
|
20
18
|
import {
|
|
21
19
|
getDb
|
|
22
|
-
} from "../chunk-
|
|
23
|
-
import "../chunk-
|
|
24
|
-
import "../chunk-
|
|
25
|
-
import "../chunk-
|
|
20
|
+
} from "../chunk-D3N4BPSL.js";
|
|
21
|
+
import "../chunk-GCGJGSQL.js";
|
|
22
|
+
import "../chunk-VJTWKJWQ.js";
|
|
23
|
+
import "../chunk-VLTWQQKH.js";
|
|
26
24
|
import "../chunk-VFUK3X5B.js";
|
|
27
|
-
import "../chunk-
|
|
25
|
+
import "../chunk-HDFGNU5E.js";
|
|
28
26
|
import {
|
|
29
27
|
pluginCatalogRuntime
|
|
30
|
-
} from "../chunk-
|
|
31
|
-
import "../chunk-
|
|
28
|
+
} from "../chunk-JSTGI7TX.js";
|
|
29
|
+
import "../chunk-R53UT2OI.js";
|
|
32
30
|
import "../chunk-W3U3YQYI.js";
|
|
33
31
|
import "../chunk-HZF5P5UN.js";
|
|
34
|
-
import "../chunk-
|
|
32
|
+
import "../chunk-ZJ6IVZVO.js";
|
|
35
33
|
import "../chunk-OB42YVAE.js";
|
|
36
34
|
import "../chunk-F3B2YJ76.js";
|
|
37
35
|
import "../chunk-6GWA276C.js";
|
|
38
36
|
import "../chunk-B3IT5END.js";
|
|
39
37
|
import "../chunk-3V7OFJZC.js";
|
|
40
|
-
import "../chunk-
|
|
41
|
-
import "../chunk-
|
|
38
|
+
import "../chunk-NUENIPQL.js";
|
|
39
|
+
import "../chunk-JLJLZS2N.js";
|
|
42
40
|
import "../chunk-MLKGABMK.js";
|
|
43
41
|
|
|
44
42
|
// src/cli/plugins.ts
|