@sentry/junior 0.268.0 → 0.270.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 (83) hide show
  1. package/README.md +2 -9
  2. package/dist/{adapter-04AcD2SO.js → adapter-BQNTKVTF.js} +3 -49
  3. package/dist/{admin-DIU1QyG3.js → admin-CKVEoXa4.js} +1 -1
  4. package/dist/{agent-runner-CAYfFmU7.js → agent-runner-MSQSMFkq.js} +4538 -3251
  5. package/dist/api/schema.d.ts +2 -3
  6. package/dist/api/schema.js +7 -7
  7. package/dist/api.d.ts +3 -1
  8. package/dist/api.js +190 -301
  9. package/dist/{app-z6Uuyq3j.d.ts → app-Bz8t4P8p.d.ts} +9 -3
  10. package/dist/app.d.ts +1 -1
  11. package/dist/app.js +129 -209
  12. package/dist/{automation-CmeFBSEh.js → automation-Dwh_xcqM.js} +74 -74
  13. package/dist/{briefs-DQbV2jNr.js → briefs-DNFzFFVx.js} +5 -5
  14. package/dist/{catalog-runtime-BD9GSpc6.js → catalog-runtime-Bdym_wKy.js} +1 -1
  15. package/dist/cli/chat.js +16 -26
  16. package/dist/cli/check.js +3 -3
  17. package/dist/cli/main.js +5 -3
  18. package/dist/cli/plugins.js +4 -4
  19. package/dist/cli/snapshot-create.js +4 -4
  20. package/dist/cli/upgrade.d.ts +1 -1
  21. package/dist/cli/upgrade.js +3 -3
  22. package/dist/{client-C1yDYjoS.js → client-B2MjENki.js} +31 -16
  23. package/dist/{config-DrTeF80T.js → config-Dm3pWRqY.js} +3 -3
  24. package/dist/{connections-D46f8vvi.js → connections-0BBhiD-p.js} +10 -10
  25. package/dist/{conversation-DSo310Ps.js → conversation-AhOVzN_k.js} +11 -86
  26. package/dist/{conversation-privacy-CxlOCiUo.js → conversation-privacy-C1pJ89rs.js} +1 -1
  27. package/dist/{credential-sync-sm9fegLY.js → credential-sync-BRiWYs6_.js} +15 -14
  28. package/dist/{credentialed-lukuD-cc.js → credentialed-BeBaJMZ_.js} +565 -83
  29. package/dist/{store-xMuuXRE0.d.ts → db-BYOuu6v2.d.ts} +4 -0
  30. package/dist/{executor-4vhvsMZJ.js → executor-BB6eJkD4.js} +6 -6
  31. package/dist/instrumentation.js +2 -2
  32. package/dist/{interruption-marker-CkncDT8d.js → interruption-marker-CdblrIQK.js} +1 -1
  33. package/dist/{job-queue-In9QKz-I.js → job-queue-DiaXoSDg.js} +2 -2
  34. package/dist/{list-BkgnXEEB.js → list-BTDRxkOg.js} +331 -662
  35. package/dist/locks-D-0h111u.js +48 -0
  36. package/dist/{logging-DLSpkSSr.js → logging-C6EdT6PP.js} +1 -1
  37. package/dist/{history-C84mlAwO.js → media-U6Tuz6Mi.js} +84 -2
  38. package/dist/{message-BObyg59s.js → message-DsjiWRVg.js} +4 -4
  39. package/dist/{model-profile-Bg8EoCKD.js → model-profile-B998sjVd.js} +9 -2
  40. package/dist/nitro.d.ts +1 -1
  41. package/dist/nitro.js +5 -3
  42. package/dist/{oauth-callback-server-B-WbSdoH.js → oauth-callback-server-CjFFVGqa.js} +2 -2
  43. package/dist/{prompt-BW9jFsqZ.js → prompt-BPSdXYXV.js} +1 -1
  44. package/dist/{registry-BgecKva0.js → registry-CndmkP2P.js} +1 -1
  45. package/dist/reporting-schema-CZREhYc-.js +104 -0
  46. package/dist/{web-message-id-DlHNANtd.js → reporting-window-DRCi1Ls_.js} +139 -7
  47. package/dist/{resolve-Cpa4Bu1O.js → resolve-BkAA1wH7.js} +3 -3
  48. package/dist/{result-D3TSmZZ8.js → result-9TJTpuYP.js} +30 -11
  49. package/dist/{runner-DS5OKhEp.js → runner-BmKLSyJm.js} +12 -11
  50. package/dist/{sandbox-egress-signals-CnDjY5rx.js → sandbox-egress-signals-CjLaogMo.js} +1 -1
  51. package/dist/{schema-0050HFnB.js → schema-DNLJ_MzW.js} +36 -20
  52. package/dist/{schema-ZngqcOWM.d.ts → schema-WayPSHFu.d.ts} +149 -12
  53. package/dist/{service-account-CKV2WTY7.js → service-account-D6e9cVmH.js} +4 -3
  54. package/dist/{service-account-DGjnDw9y.js → service-account-DlhYl-Mu.js} +3 -3
  55. package/dist/{session-stop-Dam1EI7B.js → session-stop-MZRgYqYH.js} +24 -16
  56. package/dist/{skills-CfAnfImD.js → skills-BggTR_ue.js} +2 -2
  57. package/dist/{spawn-cmq9p4Ly.js → spawn-DmtlcAT_.js} +2 -2
  58. package/dist/{store-zPEoJPBB.js → store-BeWGgaMA.js} +3 -3
  59. package/dist/{store-C5PN02QO.js → store-Byarin7b.js} +4 -4
  60. package/dist/{task-queue-_mf28dSu.js → task-queue-Dt1_ZoI_.js} +3 -3
  61. package/dist/task-runner-DyKqAPpm.js +269 -0
  62. package/dist/{thread-state-BbbPh0Sn.js → thread-state-BHBLMvgb.js} +5 -5
  63. package/dist/{turn-failure-response-BKKmnMB5.js → turn-failure-response-DWXy_0oJ.js} +9 -9
  64. package/dist/{turn-lifecycle-oP0kVeGz.js → turn-lifecycle-AiXkVqCB.js} +1 -1
  65. package/dist/{tasks-SB9z-VTU.js → turn-session-routing-B9KLBhaT.js} +939 -120
  66. package/dist/{validation--JsAGLwc.js → validation-BW60Vtx_.js} +1 -1
  67. package/dist/{version-jHwJp4hC.js → version-CivPYmkH.js} +1 -1
  68. package/dist/version.js +1 -1
  69. package/dist/{viewer-CpXTGlep.js → viewer-BTgAfdUg.js} +216 -27
  70. package/dist/{work-3N-GHY9m.js → work-Bjm52fHo.js} +17 -36
  71. package/dist/{worker-CCdbcItd.js → worker-CMbgtHLu.js} +15 -7
  72. package/migrations/0069_system_identity.sql +25 -0
  73. package/migrations/0070_review_item_foreign_keys.sql +5 -0
  74. package/migrations/AGENTS.md +17 -0
  75. package/migrations/meta/0069_snapshot.json +3979 -0
  76. package/migrations/meta/0070_snapshot.json +3997 -0
  77. package/migrations/meta/_journal.json +15 -1
  78. package/package.json +5 -4
  79. package/dist/db-BU4LQD8s.d.ts +0 -6
  80. package/dist/history-BgI33Kie.d.ts +0 -78
  81. package/dist/reporting-window-DVCD_10C.js +0 -227
  82. package/dist/task-runner-DMI2prDO.js +0 -1073
  83. package/migrations/README.md +0 -30
@@ -484,6 +484,20 @@
484
484
  "when": 1793414566801,
485
485
  "tag": "0068_review_item_slack_cards",
486
486
  "breakpoints": true
487
+ },
488
+ {
489
+ "idx": 69,
490
+ "version": "7",
491
+ "when": 1793461988634,
492
+ "tag": "0069_system_identity",
493
+ "breakpoints": true
494
+ },
495
+ {
496
+ "idx": 70,
497
+ "version": "7",
498
+ "when": 1793561992655,
499
+ "tag": "0070_review_item_foreign_keys",
500
+ "breakpoints": true
487
501
  }
488
502
  ]
489
- }
503
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/junior",
3
- "version": "0.268.0",
3
+ "version": "0.270.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -59,6 +59,7 @@
59
59
  "@chat-adapter/state-redis": "4.29.0",
60
60
  "@earendil-works/pi-agent-core": "0.84.1",
61
61
  "@earendil-works/pi-ai": "0.85.1",
62
+ "@earendil-works/pi-codemode": "1.4.0",
62
63
  "@hono/zod-validator": "^0.9.0",
63
64
  "@logtape/logtape": "^2.1.1",
64
65
  "@modelcontextprotocol/sdk": "1.32.0",
@@ -90,7 +91,7 @@
90
91
  "sharp": "^0.35.3",
91
92
  "yaml": "^2.9.0",
92
93
  "zod": "^4.5.4",
93
- "@sentry/junior-plugin-api": "0.268.0"
94
+ "@sentry/junior-plugin-api": "0.270.0"
94
95
  },
95
96
  "peerDependencies": {
96
97
  "bullmq": "^6.5.0",
@@ -125,9 +126,9 @@
125
126
  "typescript": "^7.0.2",
126
127
  "vercel": "^54.4.0",
127
128
  "vitest": "^4.1.12",
128
- "@sentry/junior-github": "0.268.0",
129
+ "@sentry/junior-github": "0.270.0",
129
130
  "@sentry/junior-testing": "0.0.0",
130
- "@sentry/junior-memory": "0.268.0"
131
+ "@sentry/junior-memory": "0.270.0"
131
132
  },
132
133
  "scripts": {
133
134
  "build": "tsdown",
@@ -1,6 +0,0 @@
1
- import "./store-xMuuXRE0.js";
2
- import "./schema-ZngqcOWM.js";
3
- import { z } from "zod";
4
- import "drizzle-orm/pg-core";
5
- import "drizzle-orm/migrator";
6
- import "drizzle-orm/pg-core/session";
@@ -1,78 +0,0 @@
1
- import { z } from "zod";
2
- import { ConversationAnnotation, OwnedObjectAnnotation } from "@sentry/junior-plugin-api";
3
- /** Bound JSON image input below the hosting platform's request size limit. */
4
- declare const MAX_INPUT_IMAGE_BYTES: number;
5
- declare const MAX_INPUT_IMAGES = 3;
6
- /** Image bytes accepted with a web message, never stored in its mailbox row. */
7
- declare const inputImageSchema: z.ZodObject<{
8
- filename: z.ZodString;
9
- contentType: z.ZodEnum<{
10
- "image/gif": "image/gif";
11
- "image/jpeg": "image/jpeg";
12
- "image/png": "image/png";
13
- "image/webp": "image/webp";
14
- }>;
15
- data: z.ZodString;
16
- }, z.core.$strict>;
17
- type InputImage = z.output<typeof inputImageSchema>;
18
- /** Safe attachment facts shared by mailbox input and transcript messages. */
19
- declare const messageAttachmentSchema: z.ZodObject<{
20
- id: z.ZodString;
21
- filename: z.ZodString;
22
- contentType: z.ZodString;
23
- bytes: z.ZodNumber;
24
- }, z.core.$strict>;
25
- type MessageAttachment = z.output<typeof messageAttachmentSchema>;
26
- /** Saved automation facts shown with a Message, not a live status view. */
27
- declare const automationCardSchema: z.ZodObject<{
28
- kind: z.ZodLiteral<"automation">;
29
- id: z.ZodString;
30
- title: z.ZodString;
31
- url: z.ZodNullable<z.ZodString>;
32
- instruction: z.ZodString;
33
- trigger: z.ZodString;
34
- warning: z.ZodNullable<z.ZodString>;
35
- }, z.core.$strict>;
36
- type AutomationCard = z.output<typeof automationCardSchema>;
37
- /** Facts for delivery and display. Messages store only references. */
38
- type MessageCard = OwnedObjectAnnotation | AutomationCard;
39
- /** Render each built-in card with its own text format. */
40
- declare function messageCardText(card: MessageCard): string;
41
- /** Store only the annotation identity with a Message. */
42
- declare const messageCardRefSchema: z.ZodObject<{
43
- plugin: z.ZodString;
44
- key: z.ZodString;
45
- kind: z.ZodLiteral<"object">;
46
- }, z.core.$strict>;
47
- type MessageCardRef = z.output<typeof messageCardRefSchema>;
48
- /** Resolve current saved facts without fetching providers or changing history. */
49
- declare function resolveMessageCards(refs: readonly MessageCardRef[], annotations: readonly ConversationAnnotation[]): OwnedObjectAnnotation[];
50
- /** Where a failed turn stopped. */
51
- declare const conversationTurnFailureCodeSchema: z.ZodEnum<{
52
- agent_run_failed: "agent_run_failed";
53
- delivery_failed: "delivery_failed";
54
- model_execution_failed: "model_execution_failed";
55
- persistence_failed: "persistence_failed";
56
- }>;
57
- /**
58
- * Why a failed turn stopped.
59
- * Values are fixed labels only. Do not store raw exception text.
60
- */
61
- declare const conversationTurnFailureReasonSchema: z.ZodEnum<{
62
- auth: "auth";
63
- capacity: "capacity";
64
- content_policy: "content_policy";
65
- empty_output: "empty_output";
66
- invalid_request: "invalid_request";
67
- invalid_response: "invalid_response";
68
- network: "network";
69
- permission: "permission";
70
- quota: "quota";
71
- rate_limit: "rate_limit";
72
- server: "server";
73
- suppressed_output: "suppressed_output";
74
- timeout: "timeout";
75
- tool_errors: "tool_errors";
76
- unknown: "unknown";
77
- }>;
78
- export { resolveMessageCards as a, MAX_INPUT_IMAGES as c, messageCardText as i, MAX_INPUT_IMAGE_BYTES as l, conversationTurnFailureReasonSchema as n, AutomationCard as o, MessageCard as r, InputImage as s, conversationTurnFailureCodeSchema as t, MessageAttachment as u };
@@ -1,227 +0,0 @@
1
- import { z } from "zod";
2
- // src/reporting-schema.ts
3
- const healthReportSchema = z.object({
4
- status: z.literal("ok"),
5
- service: z.string(),
6
- timestamp: z.string()
7
- }).strict();
8
- const pluginSchema = z.object({
9
- configKeys: z.array(z.string()),
10
- description: z.string(),
11
- displayName: z.string(),
12
- name: z.string()
13
- }).strict();
14
- const pluginsSchema = z.array(pluginSchema);
15
- const skillReportSchema = z.object({
16
- name: z.string(),
17
- pluginProvider: z.string().optional()
18
- }).strict();
19
- const skillReportsSchema = z.array(skillReportSchema);
20
- const pluginPackageContentItemReportSchema = z.object({
21
- dir: z.string(),
22
- hasMigrationsDir: z.boolean(),
23
- hasSkillsDir: z.boolean(),
24
- packageName: z.string()
25
- }).strict();
26
- const pluginPackageContentReportSchema = z.object({
27
- packageNames: z.array(z.string()),
28
- packages: z.array(pluginPackageContentItemReportSchema),
29
- manifestRoots: z.array(z.string()),
30
- skillRoots: z.array(z.string()),
31
- tracingIncludes: z.array(z.string())
32
- }).strict();
33
- const runtimeInfoReportSchema = z.object({
34
- cwd: z.string(),
35
- homeDir: z.string(),
36
- descriptionText: z.string().optional(),
37
- providers: z.array(z.string()),
38
- skills: z.array(skillReportSchema),
39
- packagedContent: pluginPackageContentReportSchema
40
- }).strict();
41
- const pluginOperationalToneSchema = z.enum([
42
- "danger",
43
- "good",
44
- "neutral",
45
- "warning"
46
- ]);
47
- const pluginOperationalMetricSchema = z.object({
48
- label: z.string(),
49
- tone: pluginOperationalToneSchema.optional(),
50
- value: z.string()
51
- }).strict();
52
- const pluginOperationalFieldSchema = z.object({
53
- key: z.string(),
54
- label: z.string()
55
- }).strict();
56
- const pluginOperationalRecordSchema = z.object({
57
- id: z.string(),
58
- tone: pluginOperationalToneSchema.optional(),
59
- values: z.record(z.string(), z.string())
60
- }).strict();
61
- const pluginOperationalRecordSetSchema = z.object({
62
- fields: z.array(pluginOperationalFieldSchema).optional(),
63
- emptyText: z.string().optional(),
64
- records: z.array(pluginOperationalRecordSchema).optional(),
65
- title: z.string()
66
- }).strict();
67
- const pluginOperationalBarChartWidgetSchema = z.object({
68
- categories: z.array(z.object({
69
- id: z.string().min(1),
70
- label: z.string().min(1),
71
- values: z.record(z.string(), z.number().finite())
72
- }).strict()).max(100),
73
- description: z.string().optional(),
74
- emptyText: z.string().optional(),
75
- id: z.string().min(1),
76
- series: z.array(z.object({
77
- format: z.literal("usd").optional(),
78
- key: z.string().min(1),
79
- label: z.string().min(1),
80
- tone: pluginOperationalToneSchema.optional()
81
- }).strict()).min(1).max(8),
82
- timeRangeDays: z.array(z.union([
83
- z.literal(1),
84
- z.literal(7),
85
- z.literal(30),
86
- z.literal(90)
87
- ])).min(1).max(4).optional(),
88
- title: z.string().min(1),
89
- type: z.literal("bar_chart")
90
- }).strict();
91
- const pluginOperationalReportSchema = z.object({
92
- generatedAt: z.string().optional(),
93
- metrics: z.array(pluginOperationalMetricSchema).optional(),
94
- recordSets: z.array(pluginOperationalRecordSetSchema).optional(),
95
- title: z.string().optional(),
96
- pluginName: z.string(),
97
- widgets: z.array(pluginOperationalBarChartWidgetSchema).max(12).optional()
98
- }).strict();
99
- const pluginOperationalReportFeedSchema = z.object({
100
- generatedAt: z.string(),
101
- reports: z.array(pluginOperationalReportSchema),
102
- source: z.literal("plugins")
103
- }).strict();
104
- // src/api/reporting-window.ts
105
- /** Shared UTC day/hour/six-hour windows for dashboard activity series. */
106
- const HOUR_MS = 36e5;
107
- const SIX_HOUR_MS = 6 * HOUR_MS;
108
- const DAY_MS = 24 * HOUR_MS;
109
- /** Start of the UTC calendar day containing `valueMs`. */
110
- function startOfUtcDay(valueMs) {
111
- const date = new Date(valueMs);
112
- date.setUTCHours(0, 0, 0, 0);
113
- return date;
114
- }
115
- /** Start of the UTC hour containing `valueMs`. */
116
- function startOfUtcHour(valueMs) {
117
- const date = new Date(valueMs);
118
- date.setUTCMinutes(0, 0, 0);
119
- return date;
120
- }
121
- /** Start of the UTC 6-hour bucket containing `valueMs` (00/06/12/18). */
122
- function startOfUtcSixHour(valueMs) {
123
- const date = startOfUtcHour(valueMs);
124
- date.setUTCHours(Math.floor(date.getUTCHours() / 6) * 6, 0, 0, 0);
125
- return date;
126
- }
127
- /** UTC day key `YYYY-MM-DD`. */
128
- function utcDayKey(value) {
129
- return (typeof value === "number" ? new Date(value) : value).toISOString().slice(0, 10);
130
- }
131
- /** UTC hour key `YYYY-MM-DDTHH`. */
132
- function utcHourKey(value) {
133
- return (typeof value === "number" ? new Date(value) : value).toISOString().slice(0, 13);
134
- }
135
- /** UTC 6-hour bucket key `YYYY-MM-DDTHH` at 00/06/12/18. */
136
- function utcSixHourKey(value) {
137
- return utcHourKey(startOfUtcSixHour(typeof value === "number" ? value : value.getTime()));
138
- }
139
- /** Inclusive trailing UTC day window ending on today's UTC day. */
140
- function trailingUtcDayWindow(nowMs, dayCount) {
141
- const end = startOfUtcDay(nowMs);
142
- const start = new Date(end);
143
- start.setUTCDate(start.getUTCDate() - (dayCount - 1));
144
- return {
145
- end,
146
- start
147
- };
148
- }
149
- /** Inclusive trailing UTC hour window ending on the current UTC hour. */
150
- function trailingUtcHourWindow(nowMs, hourCount = 24) {
151
- const end = startOfUtcHour(nowMs);
152
- return {
153
- end,
154
- start: /* @__PURE__ */ new Date(end.getTime() - (hourCount - 1) * HOUR_MS)
155
- };
156
- }
157
- /** Inclusive trailing UTC 6-hour window ending on the current 6h bucket. */
158
- function trailingUtcSixHourWindow(nowMs, bucketCount = 28) {
159
- const end = startOfUtcSixHour(nowMs);
160
- return {
161
- end,
162
- start: /* @__PURE__ */ new Date(end.getTime() - (bucketCount - 1) * SIX_HOUR_MS)
163
- };
164
- }
165
- /** Fill a fixed UTC day window from a sparse map. */
166
- function fillUtcDays(args) {
167
- const { end, start } = trailingUtcDayWindow(args.nowMs, args.count);
168
- const items = [];
169
- for (const cursor = new Date(start); cursor.getTime() <= end.getTime(); cursor.setUTCDate(cursor.getUTCDate() + 1)) {
170
- const date = utcDayKey(cursor);
171
- items.push(args.rows.get(date) ?? args.empty(date));
172
- }
173
- return items;
174
- }
175
- /** Fill a fixed UTC hour window from a sparse map. */
176
- function fillUtcHours(args) {
177
- const hourCount = args.count ?? 24;
178
- const { end, start } = trailingUtcHourWindow(args.nowMs, hourCount);
179
- const items = [];
180
- for (const cursor = new Date(start); cursor.getTime() <= end.getTime(); cursor.setTime(cursor.getTime() + HOUR_MS)) {
181
- const date = utcHourKey(cursor);
182
- items.push(args.rows.get(date) ?? args.empty(date));
183
- }
184
- return items;
185
- }
186
- /** Fill a fixed UTC 6-hour window from a map of known rows. */
187
- function fillUtcSixHours(args) {
188
- const bucketCount = args.count ?? 28;
189
- const { end, start } = trailingUtcSixHourWindow(args.nowMs, bucketCount);
190
- const items = [];
191
- for (const cursor = new Date(start); cursor.getTime() <= end.getTime(); cursor.setTime(cursor.getTime() + SIX_HOUR_MS)) {
192
- const date = utcSixHourKey(cursor);
193
- items.push(args.rows.get(date) ?? args.empty(date));
194
- }
195
- return items;
196
- }
197
- /**
198
- * Sum hour rows into trailing 6-hour buckets.
199
- * Adds number fields. Keeps other fields from the first row in the bucket.
200
- * Sets `date` to the 6-hour bucket key.
201
- */
202
- function sumUtcHoursIntoSixHours(args) {
203
- const bucketCount = args.count ?? 28;
204
- const bySix = /* @__PURE__ */ new Map();
205
- for (const hour of args.hours) {
206
- const key = utcSixHourKey(Date.parse(`${hour.date}:00:00.000Z`));
207
- const next = {
208
- ...bySix.get(key) ?? args.empty(key),
209
- date: key
210
- };
211
- for (const [field, value] of Object.entries(hour)) {
212
- if (field === "date") continue;
213
- if (typeof value === "number") {
214
- const prior = next[field];
215
- next[field] = (typeof prior === "number" ? prior : 0) + value;
216
- }
217
- }
218
- bySix.set(key, next);
219
- }
220
- return fillUtcSixHours({
221
- count: bucketCount,
222
- empty: args.empty,
223
- nowMs: args.nowMs,
224
- rows: bySix
225
- });
226
- }
227
- export { skillReportsSchema as S, pluginPackageContentReportSchema as _, fillUtcSixHours as a, runtimeInfoReportSchema as b, trailingUtcDayWindow as c, utcDayKey as d, utcHourKey as f, pluginPackageContentItemReportSchema as g, pluginOperationalReportSchema as h, fillUtcHours as i, trailingUtcHourWindow as l, pluginOperationalReportFeedSchema as m, HOUR_MS as n, startOfUtcHour as o, healthReportSchema as p, fillUtcDays as r, sumUtcHoursIntoSixHours as s, DAY_MS as t, trailingUtcSixHourWindow as u, pluginSchema as v, skillReportSchema as x, pluginsSchema as y };