@sentry/junior 0.237.0 → 0.238.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/{context-0Et9iVSB.js → actor-BTtLaeWy.js} +1 -96
- package/dist/admin-ZGlZ8lY6.js +33 -0
- package/dist/{agent-hooks-otHGbhBx.js → agent-hooks-CxdSqU2u.js} +1423 -2973
- package/dist/{agent-runner-DMAsnPb9.js → agent-runner-ZS1LHtSR.js} +171 -139
- package/dist/api/schema.d.ts +4 -0
- package/dist/api/schema.js +3 -2
- package/dist/api.d.ts +1 -1
- package/dist/api.js +31 -24
- package/dist/{app-MEd7wbF0.d.ts → app-FB2hmHpZ.d.ts} +1 -1
- package/dist/app.d.ts +1 -1
- package/dist/app.js +26 -22
- package/dist/{briefs-DDA1ugXk.js → briefs-B6IhUAgK.js} +4 -4
- package/dist/{catalog-runtime-DlXuhrmk.js → catalog-runtime-BzNg07bb.js} +1 -1
- package/dist/{checkpoint-BlIIiHG5.js → checkpoint-DWGyJg4c.js} +19 -10
- package/dist/cli/chat.js +13 -13
- package/dist/cli/check.js +3 -3
- package/dist/cli/main.js +6 -2
- package/dist/cli/plugins.js +5 -3
- package/dist/cli/run.d.ts +2 -1
- package/dist/cli/run.js +2 -1
- package/dist/cli/snapshot-create.js +3 -3
- package/dist/cli/upgrade.d.ts +1 -1
- package/dist/cli/upgrade.js +3 -3
- package/dist/{client-CPMbTmJU.js → client-CKs0rj3A.js} +2 -2
- package/dist/{config-CxpPG6nR.js → config-DRw358bB.js} +2 -2
- package/dist/{conversation-9Fxa1Zbq.js → conversation-DwD-vquD.js} +3 -517
- package/dist/{conversation-privacy-Dbkdvozu.js → conversation-privacy-DAYxHp74.js} +1 -1
- package/dist/{credential-sync-D9yGg3q5.js → credential-sync-DmRbuyE4.js} +15 -14
- package/dist/{db-Ca9Nt5ci.d.ts → db-CWZP77Ex.d.ts} +1 -1
- package/dist/{executor-BNxfDS1V.js → executor-DgPk8Lsx.js} +4 -2
- package/dist/experimental-Qn9rKLgx.js +50 -0
- package/dist/history-BLTUgFYO.js +518 -0
- package/dist/{images-D6Y3FJDQ.js → images-puyEuXoY.js} +3 -3
- package/dist/instrumentation.js +2 -2
- package/dist/{job-queue-Dq5_zt_l.js → job-queue-BL9stv_E.js} +1 -1
- package/dist/{logging-rB_ngE_R.js → logging-BNi_jyHb.js} +1 -1
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-authorization-5T1S1v_1.js → oauth-authorization-Zv1oLB1J.js} +1 -1
- package/dist/{oauth-callback-server-Csw7RssK.js → oauth-callback-server-BHtVbKvO.js} +2 -2
- package/dist/pending-auth-DulDjfwL.js +433 -0
- package/dist/{profile-D6apIG2N.js → profile-C2TScny6.js} +5 -7
- package/dist/{prompt-Ctwy6hSI.js → prompt-CMU-B4FA.js} +1 -1
- package/dist/{registry-zfTzTHe6.js → registry-D1RsbgDb.js} +111 -3
- package/dist/{resolve-sJtTzuBO.js → resolve-CuY3dhxy.js} +2 -2
- package/dist/{runner-DkCk8cbc.js → runner-BUkReLln.js} +10 -10
- package/dist/{sandbox-egress-signals-tSQ8OEcw.js → sandbox-egress-signals-etjG6qQX.js} +1 -1
- package/dist/{schema-C5bgOpRg.js → schema-CxWAN2zq.js} +1 -1
- package/dist/{skills-BVpr_Gnv.js → skills-BGhThSGR.js} +2 -2
- package/dist/{spawn-CJhmyE4E.js → spawn-PtyOnoXt.js} +2 -2
- package/dist/{store-DoewL5mG.d.ts → store-BxxbxBlm.d.ts} +7 -0
- package/dist/{task-queue-BAiZ7_CF.js → task-queue-Bi2uNATu.js} +3 -3
- package/dist/{task-runner-Bh8XONXT.js → task-runner-CDoZCo8g.js} +20 -10
- package/dist/{thread-state-BnQln4jO.js → thread-state-B-t88gH0.js} +6 -5
- package/dist/{turn-failure-response-Ba7_kItn.js → turn-failure-response-di4Jx90o.js} +10 -9
- package/dist/{turn-lifecycle-D6CTbkb9.js → turn-lifecycle-ByhUHYjD.js} +1 -1
- package/dist/{turn-session-routing-DNevs9H7.js → turn-session-routing-QjNvsevm.js} +1 -1
- package/dist/{validation-BNPhuAvt.js → validation-D3li76Ti.js} +1 -1
- package/dist/{version-EQ4MWuUJ.js → version-Chc6bVG5.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/viewer-DsyM9kb9.js +1636 -0
- package/dist/{web-authorization-DDt4FZld.js → web-authorization-Enb5lVYt.js} +6 -6
- package/dist/{web-input-C56ivZuH.js → web-input-efQlcCis.js} +63 -433
- package/dist/{work-DJ7hb9Ul.js → work-CeiA_ZxD.js} +9 -10
- package/dist/{worker-DiiV8Lba.js → worker-BJb2hsUB.js} +5 -5
- package/migrations/0048_user_admin.sql +1 -0
- package/migrations/meta/0048_snapshot.json +3720 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +4 -4
- package/dist/pending-auth-moCA2mTc.js +0 -59
|
@@ -200,99 +200,4 @@ function createSlackResumeActor(args) {
|
|
|
200
200
|
return actor;
|
|
201
201
|
}
|
|
202
202
|
//#endregion
|
|
203
|
-
|
|
204
|
-
const exactActorIdSchema = z.string().refine((value) => parseActorUserId(value) === value);
|
|
205
|
-
const exactNonBlankStringSchema = z.string().min(1).refine((value) => value === value.trim());
|
|
206
|
-
const slackDirectCredentialSubjectBindingSchema = z.object({
|
|
207
|
-
type: z.literal("slack-direct-conversation"),
|
|
208
|
-
teamId: z.string().min(1),
|
|
209
|
-
channelId: z.string().min(1),
|
|
210
|
-
signature: z.string().min(1)
|
|
211
|
-
}).strict();
|
|
212
|
-
const scheduledAutomationCredentialSubjectBindingSchema = z.object({
|
|
213
|
-
type: z.literal("scheduled-automation"),
|
|
214
|
-
plugin: z.string().min(1),
|
|
215
|
-
taskId: exactNonBlankStringSchema,
|
|
216
|
-
signature: z.string().min(1)
|
|
217
|
-
}).strict();
|
|
218
|
-
const eventAutomationCredentialSubjectBindingSchema = z.object({
|
|
219
|
-
type: z.literal("event-automation"),
|
|
220
|
-
plugin: z.string().min(1),
|
|
221
|
-
taskId: exactNonBlankStringSchema,
|
|
222
|
-
signature: z.string().min(1)
|
|
223
|
-
}).strict();
|
|
224
|
-
z.discriminatedUnion("type", [
|
|
225
|
-
slackDirectCredentialSubjectBindingSchema,
|
|
226
|
-
scheduledAutomationCredentialSubjectBindingSchema,
|
|
227
|
-
eventAutomationCredentialSubjectBindingSchema
|
|
228
|
-
]);
|
|
229
|
-
const credentialUserActorSchema = z.object({
|
|
230
|
-
type: z.literal("user"),
|
|
231
|
-
userId: exactActorIdSchema
|
|
232
|
-
}).strict();
|
|
233
|
-
const credentialSystemActorSchema = z.object({
|
|
234
|
-
platform: z.literal("system"),
|
|
235
|
-
name: exactActorIdSchema
|
|
236
|
-
}).strict();
|
|
237
|
-
const credentialSubjectSchema = z.discriminatedUnion("allowedWhen", [
|
|
238
|
-
z.object({
|
|
239
|
-
type: z.literal("user"),
|
|
240
|
-
userId: exactActorIdSchema,
|
|
241
|
-
allowedWhen: z.literal("private-direct-conversation"),
|
|
242
|
-
binding: slackDirectCredentialSubjectBindingSchema
|
|
243
|
-
}).strict(),
|
|
244
|
-
z.object({
|
|
245
|
-
type: z.literal("user"),
|
|
246
|
-
userId: exactActorIdSchema,
|
|
247
|
-
allowedWhen: z.literal("scheduled-automation"),
|
|
248
|
-
taskId: exactNonBlankStringSchema,
|
|
249
|
-
binding: scheduledAutomationCredentialSubjectBindingSchema
|
|
250
|
-
}).strict().refine((subject) => subject.binding.taskId === subject.taskId, {
|
|
251
|
-
message: "Scheduled automation credential subject requires task binding",
|
|
252
|
-
path: ["binding"]
|
|
253
|
-
}),
|
|
254
|
-
z.object({
|
|
255
|
-
type: z.literal("user"),
|
|
256
|
-
userId: exactActorIdSchema,
|
|
257
|
-
allowedWhen: z.literal("event-automation"),
|
|
258
|
-
taskId: exactNonBlankStringSchema,
|
|
259
|
-
binding: eventAutomationCredentialSubjectBindingSchema
|
|
260
|
-
}).strict().refine((subject) => subject.binding.taskId === subject.taskId, {
|
|
261
|
-
message: "Event automation credential subject requires task binding",
|
|
262
|
-
path: ["binding"]
|
|
263
|
-
})
|
|
264
|
-
]);
|
|
265
|
-
const credentialContextSchema = z.union([z.object({ actor: credentialUserActorSchema }).strict(), z.object({
|
|
266
|
-
actor: credentialSystemActorSchema,
|
|
267
|
-
subject: credentialSubjectSchema.optional()
|
|
268
|
-
}).strict()]);
|
|
269
|
-
/**
|
|
270
|
-
* Build credential authority from the run actor.
|
|
271
|
-
*
|
|
272
|
-
* `actor` is the rich execution principal. This projects the credential stub
|
|
273
|
-
* tools/auth need from it:
|
|
274
|
-
* - user actor → `{ actor: { type: "user", userId } }`
|
|
275
|
-
* - system actor → `{ actor: systemActor, subject? }`
|
|
276
|
-
*
|
|
277
|
-
* They only diverge when a system run carries an explicit delegated `subject`
|
|
278
|
-
* (scheduled/event-automation creator credentials). Callers should set `actor` first,
|
|
279
|
-
* then derive this — do not hand-build parallel shapes.
|
|
280
|
-
*/
|
|
281
|
-
function credentialContextForActor(actor, subject) {
|
|
282
|
-
if (actor.platform === "system") return subject ? {
|
|
283
|
-
actor,
|
|
284
|
-
subject
|
|
285
|
-
} : { actor };
|
|
286
|
-
if (subject) throw new TypeError("Delegated credential subjects require a system actor");
|
|
287
|
-
return { actor: {
|
|
288
|
-
type: "user",
|
|
289
|
-
userId: actor.userId
|
|
290
|
-
} };
|
|
291
|
-
}
|
|
292
|
-
/** Return the user whose OAuth token may satisfy this credential request. */
|
|
293
|
-
function credentialUserSubjectId(context) {
|
|
294
|
-
if ("type" in context.actor) return context.actor.userId;
|
|
295
|
-
return "subject" in context ? context.subject?.userId : void 0;
|
|
296
|
-
}
|
|
297
|
-
//#endregion
|
|
298
|
-
export { slackChannelIdSchema as _, createActor as a, parseSlackMessageTs as b, isActorUserId as c, parseStoredSlackActor as d, toStoredSlackActor as f, parseSlackUserId as g, parseSlackTeamId as h, credentialUserSubjectId as i, isUserActor as l, parseSlackChannelReferenceId as m, credentialContextSchema as n, createSlackActor as o, parseSlackChannelId as p, credentialSubjectSchema as r, createSlackResumeActor as s, credentialContextForActor as t, parseActorUserId as u, slackTeamIdSchema as v, slackMessageTsSchema as x, slackUserIdSchema as y };
|
|
203
|
+
export { slackMessageTsSchema as _, isUserActor as a, toStoredSlackActor as c, parseSlackTeamId as d, parseSlackUserId as f, parseSlackMessageTs as g, slackUserIdSchema as h, isActorUserId as i, parseSlackChannelId as l, slackTeamIdSchema as m, createSlackActor as n, parseActorUserId as o, slackChannelIdSchema as p, createSlackResumeActor as r, parseStoredSlackActor as s, createActor as t, parseSlackChannelReferenceId as u };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { a as setUserAdminFromSql, d as getDb, n as listAdminUsersFromSql } from "./viewer-DsyM9kb9.js";
|
|
2
|
+
import { CLI_USAGE } from "./cli/run.js";
|
|
3
|
+
//#region src/cli/admin.ts
|
|
4
|
+
/**
|
|
5
|
+
* Operator CLI for the Junior-wide admin role.
|
|
6
|
+
*
|
|
7
|
+
* Admin changes happen only here, out of band. The dashboard and Slack can
|
|
8
|
+
* read the role but cannot change it, so no one can make themselves admin.
|
|
9
|
+
*/
|
|
10
|
+
/** Run `junior admin list`, `grant <email>`, or `revoke <email>`. */
|
|
11
|
+
async function runAdmin(argv) {
|
|
12
|
+
const [subcommand, email, ...rest] = argv;
|
|
13
|
+
if (subcommand === "list" && email === void 0) {
|
|
14
|
+
const admins = await listAdminUsersFromSql(getDb());
|
|
15
|
+
if (admins.length === 0) console.log("No Junior admins.");
|
|
16
|
+
for (const admin of admins) console.log(admin.email);
|
|
17
|
+
return 0;
|
|
18
|
+
}
|
|
19
|
+
if ((subcommand === "grant" || subcommand === "revoke") && email?.trim() && rest.length === 0) {
|
|
20
|
+
const isAdmin = subcommand === "grant";
|
|
21
|
+
const user = await setUserAdminFromSql(getDb(), email, isAdmin);
|
|
22
|
+
if (!user) {
|
|
23
|
+
console.error(isAdmin ? `Could not grant admin: "${email}" is not a valid email.` : `No Junior user has the email "${email}".`);
|
|
24
|
+
return 1;
|
|
25
|
+
}
|
|
26
|
+
console.log(isAdmin ? `${user.email} is now a Junior admin.` : `${user.email} is no longer a Junior admin.`);
|
|
27
|
+
return 0;
|
|
28
|
+
}
|
|
29
|
+
console.error(CLI_USAGE);
|
|
30
|
+
return 1;
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { runAdmin };
|