@sentry/junior 0.148.0 → 0.150.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.
Files changed (84) hide show
  1. package/dist/{agent-hooks-VAUYT6PD.js → agent-hooks-SEOGOGKX.js} +10 -10
  2. package/dist/api/conversations/aggregate.d.ts +2 -0
  3. package/dist/api/conversations/create.d.ts +1 -1
  4. package/dist/api/conversations/pending-messages.d.ts +15 -0
  5. package/dist/api/people/shared.d.ts +2 -0
  6. package/dist/api/schema/conversation.d.ts +78 -4
  7. package/dist/api/schema.d.ts +2 -2
  8. package/dist/api/schema.js +7 -1
  9. package/dist/api.d.ts +1 -1
  10. package/dist/api.js +186 -35
  11. package/dist/app.js +152 -186
  12. package/dist/{catalog-runtime-WADOZVTB.js → catalog-runtime-HA7RIWYT.js} +5 -5
  13. package/dist/chat/agent/index.d.ts +5 -4
  14. package/dist/chat/agent/prompt.d.ts +8 -5
  15. package/dist/chat/agent/resume.d.ts +2 -2
  16. package/dist/chat/agent/tools.d.ts +4 -7
  17. package/dist/chat/agent/{request.d.ts → types.d.ts} +138 -129
  18. package/dist/chat/agent-dispatch/types.d.ts +2 -2
  19. package/dist/chat/agent-invocations/spawn.d.ts +2 -2
  20. package/dist/chat/api-turns/work.d.ts +6 -1
  21. package/dist/chat/app/services.d.ts +1 -1
  22. package/dist/chat/plugins/viewer.d.ts +4 -0
  23. package/dist/chat/runtime/agent-runner.d.ts +7 -5
  24. package/dist/chat/runtime/reply-executor.d.ts +0 -2
  25. package/dist/chat/runtime/slack-resume.d.ts +3 -3
  26. package/dist/chat/services/conversation-memory.d.ts +2 -2
  27. package/dist/chat/services/conversation-title.d.ts +20 -0
  28. package/dist/chat/slack/assistant-thread/title.d.ts +10 -27
  29. package/dist/chat/state/conversation.d.ts +1 -0
  30. package/dist/chat/task-execution/paused-turn.d.ts +2 -2
  31. package/dist/chat/tools/types.d.ts +1 -1
  32. package/dist/{chunk-QOWHHM3F.js → chunk-3GL327SC.js} +1 -1
  33. package/dist/{chunk-45LOR4PU.js → chunk-3JVUWLR7.js} +45 -1
  34. package/dist/{chunk-4GXJUYJV.js → chunk-3ZMKDHCT.js} +2 -2
  35. package/dist/{chunk-DUY5CDAM.js → chunk-4KAYAIBV.js} +1 -1
  36. package/dist/{chunk-ULAU5ZGU.js → chunk-4VH7KLGC.js} +106 -113
  37. package/dist/{chunk-V2FXMOEA.js → chunk-64K7GKRW.js} +2 -2
  38. package/dist/{chunk-2B3PT3V2.js → chunk-6PFDWAK2.js} +1 -1
  39. package/dist/{chunk-LNVEIJ2L.js → chunk-7D4GNUV2.js} +5 -5
  40. package/dist/{chunk-ZPL2RR7F.js → chunk-7GOP6VFJ.js} +40 -36
  41. package/dist/{chunk-HWQGBIH7.js → chunk-7NLW2NF5.js} +1 -1
  42. package/dist/{chunk-55F4QU2V.js → chunk-7QB2CKCW.js} +1 -1
  43. package/dist/{chunk-WCN4YSH7.js → chunk-DWETNV66.js} +6 -6
  44. package/dist/{chunk-D3WPMGEX.js → chunk-F5NMSEBL.js} +1 -1
  45. package/dist/{chunk-IL4EDBMV.js → chunk-FEFEIA3Z.js} +5 -5
  46. package/dist/{chunk-WOONT5ZP.js → chunk-H2RLIJ7G.js} +1 -1
  47. package/dist/{chunk-VRHTNBA6.js → chunk-ILYL6YFD.js} +3 -3
  48. package/dist/{chunk-VCYSOXON.js → chunk-IPGNWXA3.js} +545 -7
  49. package/dist/{chunk-LAZGHEYU.js → chunk-IZRSLANA.js} +1 -1
  50. package/dist/{chunk-EAI67NTM.js → chunk-JQXJ2E53.js} +1 -1
  51. package/dist/{chunk-HLPLT3NY.js → chunk-M5OZSVJI.js} +8 -4
  52. package/dist/{chunk-XJ42NBP5.js → chunk-MCNP7A7T.js} +8 -8
  53. package/dist/{chunk-OJCP3C3J.js → chunk-NCGVQXX5.js} +22 -26
  54. package/dist/{chunk-4AQZYNHM.js → chunk-NNOCRVQO.js} +2 -2
  55. package/dist/{chunk-GXYDVZKM.js → chunk-P43QM7JY.js} +5 -5
  56. package/dist/{chunk-EINWQFXI.js → chunk-QPIPYVGE.js} +5 -5
  57. package/dist/{chunk-GDFF3BQG.js → chunk-RF6J3DIO.js} +34 -36
  58. package/dist/{chunk-D6YX4NNN.js → chunk-SH6ZKJFZ.js} +4 -4
  59. package/dist/{chunk-LE5H7LMT.js → chunk-SHDREBGC.js} +1 -1
  60. package/dist/{chunk-VMNRXKAH.js → chunk-TZLYAO2J.js} +191 -134
  61. package/dist/{chunk-RRJV5UR5.js → chunk-UIMBNY6O.js} +11 -337
  62. package/dist/{chunk-ZCHIC2GM.js → chunk-UOFQEVR5.js} +15 -6
  63. package/dist/{chunk-7OEIXFC3.js → chunk-Y2VZ54CQ.js} +12 -12
  64. package/dist/{chunk-VY6W3T43.js → chunk-ZBOGYZ53.js} +4 -4
  65. package/dist/{chunk-POSZWRGL.js → chunk-ZUQT35YC.js} +1 -1
  66. package/dist/cli/chat.js +31 -32
  67. package/dist/cli/check.js +6 -6
  68. package/dist/cli/plugins.js +13 -13
  69. package/dist/cli/snapshot-create.js +9 -9
  70. package/dist/cli/upgrade.js +7 -7
  71. package/dist/{db-XUKZRFFK.js → db-HUW75QG7.js} +7 -7
  72. package/dist/instrumentation.js +4 -4
  73. package/dist/nitro.js +2 -2
  74. package/dist/{oauth-callback-server-LPZMMGFI.js → oauth-callback-server-DP7NIZPQ.js} +24 -25
  75. package/dist/{runner-DGKUTMPX.js → runner-AINV7K3M.js} +47 -45
  76. package/dist/{skills-P7YUFSXM.js → skills-PKS37E6B.js} +6 -6
  77. package/dist/spawn-NJCDEPPL.js +38 -0
  78. package/dist/{validation-S7U5M5NR.js → validation-PDC3MVMM.js} +6 -6
  79. package/dist/version.js +1 -1
  80. package/dist/{work-GAA7TVAD.js → work-KJLJRPXS.js} +17 -17
  81. package/dist/{worker-JXPJH3QB.js → worker-TYQ7YVIR.js} +11 -11
  82. package/package.json +5 -5
  83. package/dist/chunk-4EA2SFK2.js +0 -137
  84. package/dist/spawn-DSK3ZEVD.js +0 -38
@@ -1,137 +0,0 @@
1
- import {
2
- botConfig,
3
- resolveGatewayModel
4
- } from "./chunk-4GXJUYJV.js";
5
- import {
6
- logWarn
7
- } from "./chunk-EAI67NTM.js";
8
-
9
- // src/chat/services/short-title.ts
10
- var SHORT_TITLE_MAX_LENGTH = 60;
11
- var TITLE_PROMPTS = {
12
- conversation: [
13
- "Generate a concise 5-8 word Slack conversation title from the first user message below.",
14
- "Capture the user's main request.",
15
- "Reply with ONLY the title, with no quotes or trailing punctuation."
16
- ],
17
- task: [
18
- "Generate a concise 5-8 word task title from the task instruction below.",
19
- "Capture the task's main purpose.",
20
- "Reply with ONLY the title, with no quotes or trailing punctuation."
21
- ]
22
- };
23
- function normalizeShortTitle(value) {
24
- return value.replace(/\s+/g, " ").trim().slice(0, SHORT_TITLE_MAX_LENGTH);
25
- }
26
- function fallbackShortTitle(sourceText, fallback = "Untitled") {
27
- const firstLine = sourceText.split(/\r?\n/).map((line) => line.trim()).find((line) => line.length > 0) ?? "";
28
- return normalizeShortTitle(firstLine) || fallback;
29
- }
30
- async function generateShortTitle(args) {
31
- const sourceText = args.sourceText.trim();
32
- if (!sourceText) return void 0;
33
- try {
34
- const result = await args.completeText({
35
- modelId: botConfig.fastModelId,
36
- temperature: 0,
37
- promptName: `junior.${args.kind}_title`,
38
- messages: [
39
- {
40
- role: "user",
41
- content: [
42
- ...TITLE_PROMPTS[args.kind],
43
- "",
44
- args.kind === "conversation" ? `First user message: ${sourceText.slice(0, 500)}` : `Task instruction: ${sourceText.slice(0, 500)}`
45
- ].join("\n"),
46
- timestamp: Date.now()
47
- }
48
- ],
49
- metadata: {
50
- modelId: botConfig.fastModelId
51
- }
52
- });
53
- const title = normalizeShortTitle(result.text);
54
- return title || void 0;
55
- } catch (error) {
56
- logWarn(`${args.kind}.title.generation.failed`, {
57
- "exception.message": error instanceof Error ? error.message : String(error)
58
- });
59
- return void 0;
60
- }
61
- }
62
- async function resolveTaskTitle(args) {
63
- const explicit = normalizeShortTitle(args.title ?? "");
64
- if (explicit) return explicit;
65
- return generateShortTitle({
66
- completeText: args.completeText,
67
- kind: "task",
68
- sourceText: args.instruction
69
- });
70
- }
71
-
72
- // src/chat/services/context-budget.ts
73
- var COMPACTION_TRIGGER_RATIO = 0.9;
74
- var CONTEXT_INPUT_LIMIT_RATIO = 0.95;
75
- var COMPACTION_TARGET_RATIO = 0.8;
76
- var FALLBACK_CONTEXT_WINDOW_TOKENS = 4e5;
77
- function positiveInteger(value, fallback) {
78
- return Number.isFinite(value) && value > 0 ? Math.floor(value) : fallback;
79
- }
80
- function estimateTextTokens(text) {
81
- return Math.ceil(text.length / 4);
82
- }
83
- function calculateContextCompactionTriggerTokens(model) {
84
- const contextWindow = positiveInteger(
85
- model.contextWindow,
86
- FALLBACK_CONTEXT_WINDOW_TOKENS
87
- );
88
- return Math.max(1, Math.floor(contextWindow * COMPACTION_TRIGGER_RATIO));
89
- }
90
- function calculateContextInputLimitTokens(model) {
91
- const contextWindow = positiveInteger(
92
- model.contextWindow,
93
- FALLBACK_CONTEXT_WINDOW_TOKENS
94
- );
95
- return Math.max(1, Math.floor(contextWindow * CONTEXT_INPUT_LIMIT_RATIO));
96
- }
97
- function calculateContextCompactionTargetTokens(triggerTokens) {
98
- return Math.max(1, Math.floor(triggerTokens * COMPACTION_TARGET_RATIO));
99
- }
100
- function getModelContextBudget(modelId) {
101
- const model = resolveGatewayModel(modelId);
102
- const advertisedContextWindow = positiveInteger(
103
- model.contextWindow,
104
- FALLBACK_CONTEXT_WINDOW_TOKENS
105
- );
106
- return {
107
- contextWindow: Math.min(
108
- botConfig.contextWindowTokens,
109
- advertisedContextWindow
110
- )
111
- };
112
- }
113
- function getAgentContextCompactionTriggerTokens(modelId) {
114
- return calculateContextCompactionTriggerTokens(
115
- getModelContextBudget(modelId)
116
- );
117
- }
118
- function getAgentContextInputLimitTokens(modelId) {
119
- return calculateContextInputLimitTokens(getModelContextBudget(modelId));
120
- }
121
- function getConversationContextCompactionTriggerTokens() {
122
- return calculateContextCompactionTriggerTokens(
123
- getModelContextBudget(botConfig.fastModelId)
124
- );
125
- }
126
-
127
- export {
128
- SHORT_TITLE_MAX_LENGTH,
129
- fallbackShortTitle,
130
- generateShortTitle,
131
- resolveTaskTitle,
132
- estimateTextTokens,
133
- calculateContextCompactionTargetTokens,
134
- getAgentContextCompactionTriggerTokens,
135
- getAgentContextInputLimitTokens,
136
- getConversationContextCompactionTriggerTokens
137
- };
@@ -1,38 +0,0 @@
1
- import {
2
- bindSpawnAgent
3
- } from "./chunk-7OEIXFC3.js";
4
- import "./chunk-OJCP3C3J.js";
5
- import "./chunk-HLPLT3NY.js";
6
- import "./chunk-IL4EDBMV.js";
7
- import "./chunk-JAL3CH4G.js";
8
- import "./chunk-EINWQFXI.js";
9
- import "./chunk-DIB4GX3G.js";
10
- import "./chunk-GDFF3BQG.js";
11
- import "./chunk-WCN4YSH7.js";
12
- import "./chunk-HUO3UTAQ.js";
13
- import "./chunk-VCYSOXON.js";
14
- import "./chunk-3Y47VMHV.js";
15
- import "./chunk-PDO5BLNM.js";
16
- import "./chunk-V2FXMOEA.js";
17
- import "./chunk-VRHTNBA6.js";
18
- import "./chunk-D3WPMGEX.js";
19
- import "./chunk-EM225ITJ.js";
20
- import "./chunk-2B3PT3V2.js";
21
- import "./chunk-4GXJUYJV.js";
22
- import "./chunk-VFUK3X5B.js";
23
- import "./chunk-LE5H7LMT.js";
24
- import "./chunk-HWQGBIH7.js";
25
- import "./chunk-POSZWRGL.js";
26
- import "./chunk-RUIXF3YQ.js";
27
- import "./chunk-HZF5P5UN.js";
28
- import "./chunk-F3B2YJ76.js";
29
- import "./chunk-EAI67NTM.js";
30
- import "./chunk-6GWA276C.js";
31
- import "./chunk-OOUNJNMR.js";
32
- import "./chunk-H4HBKISO.js";
33
- import "./chunk-LAZGHEYU.js";
34
- import "./chunk-55F4QU2V.js";
35
- import "./chunk-MLKGABMK.js";
36
- export {
37
- bindSpawnAgent
38
- };