@sentry/junior 0.235.0 → 0.237.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-DS7k0ZWY.js → agent-hooks-otHGbhBx.js} +20 -9
- package/dist/{agent-runner-BlDI1zV2.js → agent-runner-DMAsnPb9.js} +456 -120
- package/dist/api/schema.d.ts +223 -2
- package/dist/api/schema.js +5 -4
- package/dist/api.d.ts +8 -2
- package/dist/api.js +404 -47
- package/dist/{app-pGsR__aT.d.ts → app-MEd7wbF0.d.ts} +82 -48
- package/dist/app.d.ts +3 -3
- package/dist/app.js +162 -119
- package/dist/{types-Du-HbEun.js → automation-CrQGQ2MT.js} +306 -34
- package/dist/{briefs-C3jhszOz.js → briefs-DDA1ugXk.js} +4 -4
- package/dist/{catalog-runtime-B9u_3-GW.js → catalog-runtime-DlXuhrmk.js} +1 -1
- package/dist/{checkpoint-DLcJ5mKL.js → checkpoint-BlIIiHG5.js} +16 -9
- package/dist/cli/chat.d.ts +1 -1
- package/dist/cli/chat.js +14 -14
- package/dist/cli/check.js +4 -4
- package/dist/cli/main.js +1 -1
- package/dist/cli/plugins.d.ts +1 -1
- package/dist/cli/plugins.js +4 -4
- package/dist/cli/snapshot-create.js +3 -3
- package/dist/cli/upgrade.d.ts +1 -1
- package/dist/cli/upgrade.js +5 -5
- package/dist/{client-BSnNHO0R.js → client-CPMbTmJU.js} +2 -2
- package/dist/{config-Bmw4xTPK.js → config-CxpPG6nR.js} +57 -17
- package/dist/{conversation-C_aYrISI.js → conversation-9Fxa1Zbq.js} +13 -1
- package/dist/{conversation-privacy-BV2dtba2.js → conversation-privacy-Dbkdvozu.js} +1 -1
- package/dist/{credential-sync-CukzQJ1x.js → credential-sync-D9yGg3q5.js} +14 -14
- package/dist/{executor-B9ksWZCv.js → executor-BNxfDS1V.js} +39 -6
- package/dist/{images-CEXcQ0Id.js → images-D6Y3FJDQ.js} +3 -3
- package/dist/instrumentation.js +2 -2
- package/dist/{job-queue-CY1L2YRn.js → job-queue-Dq5_zt_l.js} +1 -1
- package/dist/{logging-F--48Q7Q.js → logging-rB_ngE_R.js} +1 -1
- package/dist/nitro.d.ts +2 -2
- package/dist/nitro.js +5 -5
- package/dist/{oauth-authorization-LasSG3Qc.js → oauth-authorization-5T1S1v_1.js} +1 -1
- package/dist/{oauth-callback-server-D07ZzVMs.js → oauth-callback-server-Csw7RssK.js} +2 -2
- package/dist/{pending-auth-DrG9Mkje.js → pending-auth-moCA2mTc.js} +1 -1
- package/dist/{plugins-BT2l4We3.d.ts → plugins-CjfUP5gJ.d.ts} +1 -0
- package/dist/{profile-DZ2DUdd1.js → profile-D6apIG2N.js} +4 -4
- package/dist/{prompt-BM_5mAU3.js → prompt-Ctwy6hSI.js} +1 -1
- package/dist/queue-B5SnqRln.d.ts +25 -0
- package/dist/{registry-_JLY0x7b.js → registry-zfTzTHe6.js} +38 -2
- package/dist/{resolve-Cuoj3MML.js → resolve-sJtTzuBO.js} +2 -2
- package/dist/{runner-BfelmbMv.js → runner-DkCk8cbc.js} +9 -9
- package/dist/{sandbox-egress-signals-D5QUIO7Z.js → sandbox-egress-signals-tSQ8OEcw.js} +1 -1
- package/dist/{schema-CrdDxGbx.js → schema-C5bgOpRg.js} +3 -2
- package/dist/{skills-DAegjk5Y.js → skills-BVpr_Gnv.js} +3 -3
- package/dist/{spawn-DCfV7zGK.js → spawn-CJhmyE4E.js} +2 -2
- package/dist/{task-queue-GcuFtzor.js → task-queue-BAiZ7_CF.js} +16 -10
- package/dist/{task-runner-B0-P_3aq.js → task-runner-Bh8XONXT.js} +9 -9
- package/dist/{thread-state-TezcEhuH.js → thread-state-BnQln4jO.js} +5 -5
- package/dist/{turn-failure-response-Drhj_-t4.js → turn-failure-response-Ba7_kItn.js} +8 -8
- package/dist/{turn-lifecycle-BpIW3zOx.js → turn-lifecycle-D6CTbkb9.js} +1 -1
- package/dist/{turn-session-routing-Dg8GDgyc.js → turn-session-routing-DNevs9H7.js} +1 -1
- package/dist/{validation-DAkYeKDT.js → validation-BNPhuAvt.js} +2 -3
- package/dist/{version-9CB4Z-J4.js → version-EQ4MWuUJ.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{web-authorization-Cu33voNg.js → web-authorization-DDt4FZld.js} +6 -6
- package/dist/{web-input-B3k0J7WB.js → web-input-C56ivZuH.js} +86 -102
- package/dist/web-message-id-xPI_EFSC.js +239 -0
- package/dist/{work-PmkvcY9l.js → work-DJ7hb9Ul.js} +7 -7
- package/dist/{worker-COcaq2J6.js → worker-DiiV8Lba.js} +5 -5
- package/migrations/0045_conversation_forks.sql +3 -0
- package/migrations/0046_automation_versions.sql +71 -0
- package/migrations/0047_user_timezone.sql +1 -0
- package/migrations/meta/0045_snapshot.json +3503 -0
- package/migrations/meta/0046_snapshot.json +3707 -0
- package/migrations/meta/0047_snapshot.json +3713 -0
- package/migrations/meta/_journal.json +22 -1
- package/package.json +4 -4
- package/dist/web-message-id-CVVCTWUb.js +0 -464
- package/dist/{package-discovery-7a9YqLhE.js → package-discovery-BVvSnQBB.js} +1 -1
- package/dist/{plugin-module-BKGOXca2.js → plugin-module-CVvEUSMH.js} +1 -1
|
@@ -316,6 +316,27 @@
|
|
|
316
316
|
"when": 1790115429065,
|
|
317
317
|
"tag": "0044_event_automation_channel_destinations",
|
|
318
318
|
"breakpoints": true
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
"idx": 45,
|
|
322
|
+
"version": "7",
|
|
323
|
+
"when": 1790854495309,
|
|
324
|
+
"tag": "0045_conversation_forks",
|
|
325
|
+
"breakpoints": true
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
"idx": 46,
|
|
329
|
+
"version": "7",
|
|
330
|
+
"when": 1791217124543,
|
|
331
|
+
"tag": "0046_automation_versions",
|
|
332
|
+
"breakpoints": true
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
"idx": 47,
|
|
336
|
+
"version": "7",
|
|
337
|
+
"when": 1791300043473,
|
|
338
|
+
"tag": "0047_user_timezone",
|
|
339
|
+
"breakpoints": true
|
|
319
340
|
}
|
|
320
341
|
]
|
|
321
|
-
}
|
|
342
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/junior",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.237.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"pg": "^8.16.3",
|
|
88
88
|
"yaml": "^2.9.0",
|
|
89
89
|
"zod": "^4.5.4",
|
|
90
|
-
"@sentry/junior-plugin-api": "0.
|
|
90
|
+
"@sentry/junior-plugin-api": "0.237.0"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
93
|
"@emnapi/core": "^1.10.0",
|
|
@@ -106,8 +106,8 @@
|
|
|
106
106
|
"typescript": "^6.0.3",
|
|
107
107
|
"vercel": "^54.4.0",
|
|
108
108
|
"vitest": "^4.1.7",
|
|
109
|
-
"@sentry/junior-github": "0.
|
|
110
|
-
"@sentry/junior-memory": "0.
|
|
109
|
+
"@sentry/junior-github": "0.237.0",
|
|
110
|
+
"@sentry/junior-memory": "0.237.0",
|
|
111
111
|
"@sentry/junior-testing": "0.0.0"
|
|
112
112
|
},
|
|
113
113
|
"scripts": {
|
|
@@ -1,464 +0,0 @@
|
|
|
1
|
-
import { h as eventAutomationTriggerSchema, n as scheduledAutomationSchema, o as eventAutomationEditSchema, s as scheduledAutomationEditSchema, u as scheduleIntentSchema } from "./types-Du-HbEun.js";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import { eventMatchSchema, pluginEventTypeSchema, taskOutcomeSchema } from "@sentry/junior-plugin-api";
|
|
4
|
-
//#region src/reporting-schema.ts
|
|
5
|
-
const healthReportSchema = z.object({
|
|
6
|
-
status: z.literal("ok"),
|
|
7
|
-
service: z.string(),
|
|
8
|
-
timestamp: z.string()
|
|
9
|
-
}).strict();
|
|
10
|
-
const pluginSchema = z.object({
|
|
11
|
-
configKeys: z.array(z.string()),
|
|
12
|
-
description: z.string(),
|
|
13
|
-
displayName: z.string(),
|
|
14
|
-
name: z.string()
|
|
15
|
-
}).strict();
|
|
16
|
-
const pluginsSchema = z.array(pluginSchema);
|
|
17
|
-
const skillReportSchema = z.object({
|
|
18
|
-
name: z.string(),
|
|
19
|
-
pluginProvider: z.string().optional()
|
|
20
|
-
}).strict();
|
|
21
|
-
const skillReportsSchema = z.array(skillReportSchema);
|
|
22
|
-
const pluginPackageContentItemReportSchema = z.object({
|
|
23
|
-
dir: z.string(),
|
|
24
|
-
hasMigrationsDir: z.boolean(),
|
|
25
|
-
hasSkillsDir: z.boolean(),
|
|
26
|
-
packageName: z.string()
|
|
27
|
-
}).strict();
|
|
28
|
-
const pluginPackageContentReportSchema = z.object({
|
|
29
|
-
packageNames: z.array(z.string()),
|
|
30
|
-
packages: z.array(pluginPackageContentItemReportSchema),
|
|
31
|
-
manifestRoots: z.array(z.string()),
|
|
32
|
-
skillRoots: z.array(z.string()),
|
|
33
|
-
tracingIncludes: z.array(z.string())
|
|
34
|
-
}).strict();
|
|
35
|
-
const runtimeInfoReportSchema = z.object({
|
|
36
|
-
cwd: z.string(),
|
|
37
|
-
homeDir: z.string(),
|
|
38
|
-
descriptionText: z.string().optional(),
|
|
39
|
-
providers: z.array(z.string()),
|
|
40
|
-
skills: z.array(skillReportSchema),
|
|
41
|
-
packagedContent: pluginPackageContentReportSchema
|
|
42
|
-
}).strict();
|
|
43
|
-
const pluginOperationalToneSchema = z.enum([
|
|
44
|
-
"danger",
|
|
45
|
-
"good",
|
|
46
|
-
"neutral",
|
|
47
|
-
"warning"
|
|
48
|
-
]);
|
|
49
|
-
const pluginOperationalMetricSchema = z.object({
|
|
50
|
-
label: z.string(),
|
|
51
|
-
tone: pluginOperationalToneSchema.optional(),
|
|
52
|
-
value: z.string()
|
|
53
|
-
}).strict();
|
|
54
|
-
const pluginOperationalFieldSchema = z.object({
|
|
55
|
-
key: z.string(),
|
|
56
|
-
label: z.string()
|
|
57
|
-
}).strict();
|
|
58
|
-
const pluginOperationalRecordSchema = z.object({
|
|
59
|
-
id: z.string(),
|
|
60
|
-
tone: pluginOperationalToneSchema.optional(),
|
|
61
|
-
values: z.record(z.string(), z.string())
|
|
62
|
-
}).strict();
|
|
63
|
-
const pluginOperationalRecordSetSchema = z.object({
|
|
64
|
-
fields: z.array(pluginOperationalFieldSchema).optional(),
|
|
65
|
-
emptyText: z.string().optional(),
|
|
66
|
-
records: z.array(pluginOperationalRecordSchema).optional(),
|
|
67
|
-
title: z.string()
|
|
68
|
-
}).strict();
|
|
69
|
-
const pluginOperationalBarChartWidgetSchema = z.object({
|
|
70
|
-
categories: z.array(z.object({
|
|
71
|
-
id: z.string().min(1),
|
|
72
|
-
label: z.string().min(1),
|
|
73
|
-
values: z.record(z.string(), z.number().finite())
|
|
74
|
-
}).strict()).max(100),
|
|
75
|
-
description: z.string().optional(),
|
|
76
|
-
emptyText: z.string().optional(),
|
|
77
|
-
id: z.string().min(1),
|
|
78
|
-
series: z.array(z.object({
|
|
79
|
-
format: z.literal("usd").optional(),
|
|
80
|
-
key: z.string().min(1),
|
|
81
|
-
label: z.string().min(1),
|
|
82
|
-
tone: pluginOperationalToneSchema.optional()
|
|
83
|
-
}).strict()).min(1).max(8),
|
|
84
|
-
timeRangeDays: z.array(z.union([
|
|
85
|
-
z.literal(1),
|
|
86
|
-
z.literal(7),
|
|
87
|
-
z.literal(30),
|
|
88
|
-
z.literal(90)
|
|
89
|
-
])).min(1).max(4).optional(),
|
|
90
|
-
title: z.string().min(1),
|
|
91
|
-
type: z.literal("bar_chart")
|
|
92
|
-
}).strict();
|
|
93
|
-
const pluginOperationalReportSchema = z.object({
|
|
94
|
-
generatedAt: z.string().optional(),
|
|
95
|
-
metrics: z.array(pluginOperationalMetricSchema).optional(),
|
|
96
|
-
recordSets: z.array(pluginOperationalRecordSetSchema).optional(),
|
|
97
|
-
title: z.string().optional(),
|
|
98
|
-
pluginName: z.string(),
|
|
99
|
-
widgets: z.array(pluginOperationalBarChartWidgetSchema).max(12).optional()
|
|
100
|
-
}).strict();
|
|
101
|
-
const pluginOperationalReportFeedSchema = z.object({
|
|
102
|
-
generatedAt: z.string(),
|
|
103
|
-
reports: z.array(pluginOperationalReportSchema),
|
|
104
|
-
source: z.literal("plugins")
|
|
105
|
-
}).strict();
|
|
106
|
-
//#endregion
|
|
107
|
-
//#region src/api/schema/automation.ts
|
|
108
|
-
const automationDestinationSchema = z.object({
|
|
109
|
-
channelId: z.string().min(1),
|
|
110
|
-
label: z.string().min(1),
|
|
111
|
-
teamId: z.string().min(1),
|
|
112
|
-
visibility: z.enum(["private", "public"])
|
|
113
|
-
}).strict();
|
|
114
|
-
/** Automation run counts for the dashboard range control (24h/7d/30d/90d). */
|
|
115
|
-
const automationRunWindowsSchema = z.object({
|
|
116
|
-
1: z.number().int().nonnegative(),
|
|
117
|
-
7: z.number().int().nonnegative(),
|
|
118
|
-
30: z.number().int().nonnegative(),
|
|
119
|
-
90: z.number().int().nonnegative()
|
|
120
|
-
}).strict();
|
|
121
|
-
const automationSummaryBaseSchema = z.object({
|
|
122
|
-
credentialMode: z.enum(["creator", "system"]),
|
|
123
|
-
createdAt: z.string().datetime(),
|
|
124
|
-
createdBy: z.string().min(1),
|
|
125
|
-
createdByAvatarUrl: z.string().url().optional(),
|
|
126
|
-
createdByEmail: z.string().trim().email().optional(),
|
|
127
|
-
destination: automationDestinationSchema,
|
|
128
|
-
id: z.string().min(1),
|
|
129
|
-
instruction: z.string().min(1),
|
|
130
|
-
lastConversationId: z.string().min(1).optional(),
|
|
131
|
-
lastRunAt: z.string().datetime().optional(),
|
|
132
|
-
lastRunStatus: z.enum([
|
|
133
|
-
"blocked",
|
|
134
|
-
"completed",
|
|
135
|
-
"failed"
|
|
136
|
-
]).optional(),
|
|
137
|
-
ownedByViewer: z.boolean(),
|
|
138
|
-
runs: automationRunWindowsSchema,
|
|
139
|
-
outcomes: z.array(taskOutcomeSchema).max(5),
|
|
140
|
-
/** Short display title; falls back from instruction when unset. */
|
|
141
|
-
title: z.string().min(1),
|
|
142
|
-
totalRuns: z.number().int().nonnegative()
|
|
143
|
-
});
|
|
144
|
-
const scheduledAutomationSummarySchema = automationSummaryBaseSchema.extend({
|
|
145
|
-
kind: z.literal("scheduled"),
|
|
146
|
-
nextRunAt: z.string().datetime().optional(),
|
|
147
|
-
schedule: z.string().min(1),
|
|
148
|
-
timezone: z.string().min(1),
|
|
149
|
-
statusReason: z.string().optional(),
|
|
150
|
-
status: z.enum([
|
|
151
|
-
"active",
|
|
152
|
-
"blocked",
|
|
153
|
-
"paused",
|
|
154
|
-
"completed"
|
|
155
|
-
])
|
|
156
|
-
}).strict();
|
|
157
|
-
const eventAutomationSummarySchema = automationSummaryBaseSchema.extend({
|
|
158
|
-
events: z.array(z.string().min(1)).min(1),
|
|
159
|
-
match: eventMatchSchema.optional(),
|
|
160
|
-
kind: z.literal("event"),
|
|
161
|
-
resource: z.string().min(1),
|
|
162
|
-
source: z.string().min(1),
|
|
163
|
-
triggerAvailable: z.boolean(),
|
|
164
|
-
status: z.enum(["active", "paused"])
|
|
165
|
-
}).strict();
|
|
166
|
-
const automationSummarySchema = z.discriminatedUnion("kind", [scheduledAutomationSummarySchema, eventAutomationSummarySchema]);
|
|
167
|
-
/** UTC day (`YYYY-MM-DD`) or hour (`YYYY-MM-DDTHH`) execution bucket key. */
|
|
168
|
-
const automationMetricBucketSchema = z.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/);
|
|
169
|
-
/** One UTC day/hour of completed automation executions stacked by automation type. */
|
|
170
|
-
const automationExecutionDaySchema = z.object({
|
|
171
|
-
/** Linked conversation spend for executions in this bucket. */
|
|
172
|
-
costUsd: z.number().finite().nonnegative(),
|
|
173
|
-
date: automationMetricBucketSchema,
|
|
174
|
-
event: z.number().int().nonnegative(),
|
|
175
|
-
scheduled: z.number().int().nonnegative()
|
|
176
|
-
}).strict();
|
|
177
|
-
const automationListQuerySchema = z.object({
|
|
178
|
-
q: z.string().trim().max(200).optional(),
|
|
179
|
-
scope: z.enum([
|
|
180
|
-
"all",
|
|
181
|
-
"mine",
|
|
182
|
-
"public",
|
|
183
|
-
"attention"
|
|
184
|
-
]).default("all"),
|
|
185
|
-
type: z.enum([
|
|
186
|
-
"all",
|
|
187
|
-
"scheduled",
|
|
188
|
-
"event"
|
|
189
|
-
]).default("all"),
|
|
190
|
-
state: z.enum([
|
|
191
|
-
"all",
|
|
192
|
-
"active",
|
|
193
|
-
"blocked",
|
|
194
|
-
"paused",
|
|
195
|
-
"completed",
|
|
196
|
-
"unavailable"
|
|
197
|
-
]).default("all"),
|
|
198
|
-
creator: z.string().max(300).optional(),
|
|
199
|
-
destination: z.string().max(300).optional(),
|
|
200
|
-
sort: z.enum([
|
|
201
|
-
"newest",
|
|
202
|
-
"oldest",
|
|
203
|
-
"title"
|
|
204
|
-
]).default("newest"),
|
|
205
|
-
page: z.coerce.number().int().min(1).max(1e6).default(1),
|
|
206
|
-
pageSize: z.coerce.number().int().min(1).max(100).default(25)
|
|
207
|
-
}).strict();
|
|
208
|
-
const automationFilterOptionSchema = z.object({
|
|
209
|
-
value: z.string(),
|
|
210
|
-
label: z.string()
|
|
211
|
-
}).strict();
|
|
212
|
-
const automationListSchema = z.object({
|
|
213
|
-
executionDays: z.array(automationExecutionDaySchema),
|
|
214
|
-
executionHours: z.array(automationExecutionDaySchema).optional(),
|
|
215
|
-
executionSixHours: z.array(automationExecutionDaySchema).optional(),
|
|
216
|
-
automations: z.array(automationSummarySchema),
|
|
217
|
-
total: z.number().int().nonnegative(),
|
|
218
|
-
page: z.number().int().positive(),
|
|
219
|
-
pageSize: z.number().int().positive(),
|
|
220
|
-
counts: z.object({
|
|
221
|
-
all: z.number().int().nonnegative(),
|
|
222
|
-
mine: z.number().int().nonnegative(),
|
|
223
|
-
public: z.number().int().nonnegative(),
|
|
224
|
-
private: z.number().int().nonnegative()
|
|
225
|
-
}).strict(),
|
|
226
|
-
creators: z.array(automationFilterOptionSchema),
|
|
227
|
-
destinations: z.array(automationFilterOptionSchema)
|
|
228
|
-
}).strict();
|
|
229
|
-
const automationParamsSchema = z.object({
|
|
230
|
-
id: z.string().min(1),
|
|
231
|
-
kind: z.enum(["scheduled", "event"])
|
|
232
|
-
}).strict();
|
|
233
|
-
const automationExecutionStatusSchema = z.enum([
|
|
234
|
-
"blocked",
|
|
235
|
-
"completed",
|
|
236
|
-
"failed"
|
|
237
|
-
]);
|
|
238
|
-
const automationExecutionSchema = z.object({
|
|
239
|
-
conversationId: z.string().min(1).optional(),
|
|
240
|
-
/** Estimated model cost for the linked conversation, when known. */
|
|
241
|
-
costUsd: z.number().finite().nonnegative().optional(),
|
|
242
|
-
/** Cumulative conversation runtime in milliseconds, when known. */
|
|
243
|
-
durationMs: z.number().finite().nonnegative().optional(),
|
|
244
|
-
executedAt: z.string().datetime(),
|
|
245
|
-
executionId: z.string().min(1),
|
|
246
|
-
status: automationExecutionStatusSchema,
|
|
247
|
-
title: z.string().min(1).optional(),
|
|
248
|
-
/** Cumulative conversation token total, when known. */
|
|
249
|
-
totalTokens: z.number().int().nonnegative().optional()
|
|
250
|
-
}).strict();
|
|
251
|
-
/** One UTC day/hour of terminal executions for a single automation, stacked by status. */
|
|
252
|
-
const automationExecutionStatusDaySchema = z.object({
|
|
253
|
-
blocked: z.number().int().nonnegative(),
|
|
254
|
-
completed: z.number().int().nonnegative(),
|
|
255
|
-
date: automationMetricBucketSchema,
|
|
256
|
-
failed: z.number().int().nonnegative()
|
|
257
|
-
}).strict();
|
|
258
|
-
const automationExecutionListSchema = z.object({
|
|
259
|
-
executionDays: z.array(automationExecutionStatusDaySchema),
|
|
260
|
-
executionHours: z.array(automationExecutionStatusDaySchema).optional(),
|
|
261
|
-
executionSixHours: z.array(automationExecutionStatusDaySchema).optional(),
|
|
262
|
-
executions: z.array(automationExecutionSchema),
|
|
263
|
-
automation: automationSummarySchema,
|
|
264
|
-
truncated: z.boolean()
|
|
265
|
-
}).strict();
|
|
266
|
-
const automationRunSchema = automationExecutionSchema.extend({
|
|
267
|
-
kind: z.enum(["scheduled", "event"]),
|
|
268
|
-
automationId: z.string().min(1),
|
|
269
|
-
automationTitle: z.string().min(1)
|
|
270
|
-
}).strict();
|
|
271
|
-
const automationRunListSchema = z.object({
|
|
272
|
-
runs: z.array(automationRunSchema),
|
|
273
|
-
truncated: z.boolean()
|
|
274
|
-
}).strict();
|
|
275
|
-
const automationRevisionSchema = z.string().regex(/^[a-f0-9]{64}$/);
|
|
276
|
-
/** Pause and resume do not start work. */
|
|
277
|
-
const automationLifecycleSchema = z.object({
|
|
278
|
-
action: z.enum(["pause", "resume"]),
|
|
279
|
-
revision: automationRevisionSchema
|
|
280
|
-
}).strict();
|
|
281
|
-
const automationEditBaseSchema = scheduledAutomationSchema.pick({
|
|
282
|
-
destination: true,
|
|
283
|
-
createdBy: true
|
|
284
|
-
}).extend({
|
|
285
|
-
id: z.string().min(1),
|
|
286
|
-
revision: automationRevisionSchema,
|
|
287
|
-
title: z.string().nullable(),
|
|
288
|
-
instruction: z.string(),
|
|
289
|
-
credentialMode: z.enum(["system", "creator"]),
|
|
290
|
-
outcomes: z.array(taskOutcomeSchema).max(5)
|
|
291
|
-
});
|
|
292
|
-
/** Creator-only edit values. Read schemas also retain legacy values. */
|
|
293
|
-
const automationEditSchema = z.discriminatedUnion("kind", [automationEditBaseSchema.merge(scheduledAutomationSchema.pick({ schedule: true })).extend({
|
|
294
|
-
kind: z.literal("scheduled"),
|
|
295
|
-
nextRunAtMs: z.number().optional(),
|
|
296
|
-
status: z.enum([
|
|
297
|
-
"active",
|
|
298
|
-
"blocked",
|
|
299
|
-
"paused",
|
|
300
|
-
"completed"
|
|
301
|
-
])
|
|
302
|
-
}).strict(), automationEditBaseSchema.extend({
|
|
303
|
-
kind: z.literal("event"),
|
|
304
|
-
trigger: eventAutomationTriggerSchema,
|
|
305
|
-
triggerAvailable: z.boolean(),
|
|
306
|
-
status: z.enum(["active", "paused"])
|
|
307
|
-
}).strict()]);
|
|
308
|
-
/** Partial edits require the revision returned by the edit read. */
|
|
309
|
-
const automationUpdateSchema = z.discriminatedUnion("kind", [scheduledAutomationEditSchema.omit({ status: true }).extend({
|
|
310
|
-
kind: z.literal("scheduled"),
|
|
311
|
-
revision: automationRevisionSchema
|
|
312
|
-
}).strict(), eventAutomationEditSchema.extend({
|
|
313
|
-
kind: z.literal("event"),
|
|
314
|
-
revision: automationRevisionSchema
|
|
315
|
-
}).strict()]);
|
|
316
|
-
const automationEditErrorSchema = z.object({
|
|
317
|
-
error: z.string(),
|
|
318
|
-
code: z.enum([
|
|
319
|
-
"invalid_edit",
|
|
320
|
-
"conflict",
|
|
321
|
-
"not_found"
|
|
322
|
-
]),
|
|
323
|
-
fields: z.record(z.string(), z.array(z.string())).optional()
|
|
324
|
-
}).strict();
|
|
325
|
-
/** Catalog metadata only; callbacks and provider connections stay on the server. */
|
|
326
|
-
const automationEventCatalogSchema = z.array(pluginEventTypeSchema.safeExtend({ namespace: z.string() }));
|
|
327
|
-
const automationScheduleIntentSchema = scheduleIntentSchema;
|
|
328
|
-
const automationSchedulePreviewSchema = scheduledAutomationSchema.pick({ schedule: true }).extend({ nextRunAtMs: z.number() }).strict();
|
|
329
|
-
//#endregion
|
|
330
|
-
//#region src/api/reporting-window.ts
|
|
331
|
-
/** Shared UTC day/hour/six-hour windows for dashboard activity series. */
|
|
332
|
-
const HOUR_MS = 36e5;
|
|
333
|
-
const SIX_HOUR_MS = 6 * HOUR_MS;
|
|
334
|
-
const DAY_MS = 24 * HOUR_MS;
|
|
335
|
-
/** Start of the UTC calendar day containing `valueMs`. */
|
|
336
|
-
function startOfUtcDay(valueMs) {
|
|
337
|
-
const date = new Date(valueMs);
|
|
338
|
-
date.setUTCHours(0, 0, 0, 0);
|
|
339
|
-
return date;
|
|
340
|
-
}
|
|
341
|
-
/** Start of the UTC hour containing `valueMs`. */
|
|
342
|
-
function startOfUtcHour(valueMs) {
|
|
343
|
-
const date = new Date(valueMs);
|
|
344
|
-
date.setUTCMinutes(0, 0, 0);
|
|
345
|
-
return date;
|
|
346
|
-
}
|
|
347
|
-
/** Start of the UTC 6-hour bucket containing `valueMs` (00/06/12/18). */
|
|
348
|
-
function startOfUtcSixHour(valueMs) {
|
|
349
|
-
const date = startOfUtcHour(valueMs);
|
|
350
|
-
date.setUTCHours(Math.floor(date.getUTCHours() / 6) * 6, 0, 0, 0);
|
|
351
|
-
return date;
|
|
352
|
-
}
|
|
353
|
-
/** UTC day key `YYYY-MM-DD`. */
|
|
354
|
-
function utcDayKey(value) {
|
|
355
|
-
return (typeof value === "number" ? new Date(value) : value).toISOString().slice(0, 10);
|
|
356
|
-
}
|
|
357
|
-
/** UTC hour key `YYYY-MM-DDTHH`. */
|
|
358
|
-
function utcHourKey(value) {
|
|
359
|
-
return (typeof value === "number" ? new Date(value) : value).toISOString().slice(0, 13);
|
|
360
|
-
}
|
|
361
|
-
/** UTC 6-hour bucket key `YYYY-MM-DDTHH` at 00/06/12/18. */
|
|
362
|
-
function utcSixHourKey(value) {
|
|
363
|
-
return utcHourKey(startOfUtcSixHour(typeof value === "number" ? value : value.getTime()));
|
|
364
|
-
}
|
|
365
|
-
/** Inclusive trailing UTC day window ending on today's UTC day. */
|
|
366
|
-
function trailingUtcDayWindow(nowMs, dayCount) {
|
|
367
|
-
const end = startOfUtcDay(nowMs);
|
|
368
|
-
const start = new Date(end);
|
|
369
|
-
start.setUTCDate(start.getUTCDate() - (dayCount - 1));
|
|
370
|
-
return {
|
|
371
|
-
end,
|
|
372
|
-
start
|
|
373
|
-
};
|
|
374
|
-
}
|
|
375
|
-
/** Inclusive trailing UTC hour window ending on the current UTC hour. */
|
|
376
|
-
function trailingUtcHourWindow(nowMs, hourCount = 24) {
|
|
377
|
-
const end = startOfUtcHour(nowMs);
|
|
378
|
-
return {
|
|
379
|
-
end,
|
|
380
|
-
start: /* @__PURE__ */ new Date(end.getTime() - (hourCount - 1) * HOUR_MS)
|
|
381
|
-
};
|
|
382
|
-
}
|
|
383
|
-
/** Inclusive trailing UTC 6-hour window ending on the current 6h bucket. */
|
|
384
|
-
function trailingUtcSixHourWindow(nowMs, bucketCount = 28) {
|
|
385
|
-
const end = startOfUtcSixHour(nowMs);
|
|
386
|
-
return {
|
|
387
|
-
end,
|
|
388
|
-
start: /* @__PURE__ */ new Date(end.getTime() - (bucketCount - 1) * SIX_HOUR_MS)
|
|
389
|
-
};
|
|
390
|
-
}
|
|
391
|
-
/** Fill a fixed UTC day window from a sparse map. */
|
|
392
|
-
function fillUtcDays(args) {
|
|
393
|
-
const { end, start } = trailingUtcDayWindow(args.nowMs, args.count);
|
|
394
|
-
const items = [];
|
|
395
|
-
for (const cursor = new Date(start); cursor.getTime() <= end.getTime(); cursor.setUTCDate(cursor.getUTCDate() + 1)) {
|
|
396
|
-
const date = utcDayKey(cursor);
|
|
397
|
-
items.push(args.rows.get(date) ?? args.empty(date));
|
|
398
|
-
}
|
|
399
|
-
return items;
|
|
400
|
-
}
|
|
401
|
-
/** Fill a fixed UTC hour window from a sparse map. */
|
|
402
|
-
function fillUtcHours(args) {
|
|
403
|
-
const hourCount = args.count ?? 24;
|
|
404
|
-
const { end, start } = trailingUtcHourWindow(args.nowMs, hourCount);
|
|
405
|
-
const items = [];
|
|
406
|
-
for (const cursor = new Date(start); cursor.getTime() <= end.getTime(); cursor.setTime(cursor.getTime() + HOUR_MS)) {
|
|
407
|
-
const date = utcHourKey(cursor);
|
|
408
|
-
items.push(args.rows.get(date) ?? args.empty(date));
|
|
409
|
-
}
|
|
410
|
-
return items;
|
|
411
|
-
}
|
|
412
|
-
/** Fill a fixed UTC 6-hour window from a map of known rows. */
|
|
413
|
-
function fillUtcSixHours(args) {
|
|
414
|
-
const bucketCount = args.count ?? 28;
|
|
415
|
-
const { end, start } = trailingUtcSixHourWindow(args.nowMs, bucketCount);
|
|
416
|
-
const items = [];
|
|
417
|
-
for (const cursor = new Date(start); cursor.getTime() <= end.getTime(); cursor.setTime(cursor.getTime() + SIX_HOUR_MS)) {
|
|
418
|
-
const date = utcSixHourKey(cursor);
|
|
419
|
-
items.push(args.rows.get(date) ?? args.empty(date));
|
|
420
|
-
}
|
|
421
|
-
return items;
|
|
422
|
-
}
|
|
423
|
-
/**
|
|
424
|
-
* Sum hour rows into trailing 6-hour buckets.
|
|
425
|
-
* Adds number fields. Keeps other fields from the first row in the bucket.
|
|
426
|
-
* Sets `date` to the 6-hour bucket key.
|
|
427
|
-
*/
|
|
428
|
-
function sumUtcHoursIntoSixHours(args) {
|
|
429
|
-
const bucketCount = args.count ?? 28;
|
|
430
|
-
const bySix = /* @__PURE__ */ new Map();
|
|
431
|
-
for (const hour of args.hours) {
|
|
432
|
-
const key = utcSixHourKey(Date.parse(`${hour.date}:00:00.000Z`));
|
|
433
|
-
const next = {
|
|
434
|
-
...bySix.get(key) ?? args.empty(key),
|
|
435
|
-
date: key
|
|
436
|
-
};
|
|
437
|
-
for (const [field, value] of Object.entries(hour)) {
|
|
438
|
-
if (field === "date") continue;
|
|
439
|
-
if (typeof value === "number") {
|
|
440
|
-
const prior = next[field];
|
|
441
|
-
next[field] = (typeof prior === "number" ? prior : 0) + value;
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
bySix.set(key, next);
|
|
445
|
-
}
|
|
446
|
-
return fillUtcSixHours({
|
|
447
|
-
count: bucketCount,
|
|
448
|
-
empty: args.empty,
|
|
449
|
-
nowMs: args.nowMs,
|
|
450
|
-
rows: bySix
|
|
451
|
-
});
|
|
452
|
-
}
|
|
453
|
-
//#endregion
|
|
454
|
-
//#region src/chat/conversations/web-message-id.ts
|
|
455
|
-
/**
|
|
456
|
-
* Build the retry-stable Message id shared by web ingress and browser sends.
|
|
457
|
-
* Keep the existing hash and prefix so retries still address stored Messages.
|
|
458
|
-
*/
|
|
459
|
-
async function webMessageId(args) {
|
|
460
|
-
const digest = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(`${args.conversationId}\u0000${args.idempotencyKey}`));
|
|
461
|
-
return `api-msg:${Array.from(new Uint8Array(digest), (byte) => byte.toString(16).padStart(2, "0")).join("").slice(0, 24)}`;
|
|
462
|
-
}
|
|
463
|
-
//#endregion
|
|
464
|
-
export { automationSummarySchema as A, pluginsSchema as B, automationListSchema as C, automationRunWindowsSchema as D, automationRunSchema as E, pluginOperationalReportFeedSchema as F, skillReportSchema as H, pluginOperationalReportSchema as I, pluginPackageContentItemReportSchema as L, eventAutomationSummarySchema as M, scheduledAutomationSummarySchema as N, automationScheduleIntentSchema as O, healthReportSchema as P, pluginPackageContentReportSchema as R, automationListQuerySchema as S, automationRunListSchema as T, skillReportsSchema as U, runtimeInfoReportSchema as V, automationExecutionListSchema as _, fillUtcHours as a, automationExecutionStatusSchema as b, sumUtcHoursIntoSixHours as c, trailingUtcSixHourWindow as d, utcDayKey as f, automationEventCatalogSchema as g, automationEditSchema as h, fillUtcDays as i, automationUpdateSchema as j, automationSchedulePreviewSchema as k, trailingUtcDayWindow as l, automationEditErrorSchema as m, DAY_MS as n, fillUtcSixHours as o, utcHourKey as p, HOUR_MS as r, startOfUtcHour as s, webMessageId as t, trailingUtcHourWindow as u, automationExecutionSchema as v, automationParamsSchema as w, automationLifecycleSchema as x, automationExecutionStatusDaySchema as y, pluginSchema as z };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
3
|
import path from "node:path";
|
|
5
4
|
import fs, { statSync } from "node:fs";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
6
|
//#region src/package-resolution.ts
|
|
7
7
|
function isDirectory$1(targetPath) {
|
|
8
8
|
try {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
|
-
import { pathToFileURL } from "node:url";
|
|
3
2
|
import path from "node:path";
|
|
4
3
|
import { statSync } from "node:fs";
|
|
4
|
+
import { pathToFileURL } from "node:url";
|
|
5
5
|
//#region src/plugin-module.ts
|
|
6
6
|
const PLUGIN_MODULE_EXTENSIONS = [
|
|
7
7
|
"",
|