@sentry/junior 0.267.0 → 0.269.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/README.md +2 -9
- package/dist/{actor-DZSokpwj.js → actor-CP9K2Idu.js} +2 -1
- package/dist/{adapter-BybMEezj.js → adapter-2-CG25be.js} +3 -51
- package/dist/{admin-DOs1_EiW.js → admin-DSs8S5Uy.js} +1 -1
- package/dist/{agent-invocations-CxKldAeB.js → agent-invocations-C1RNOCs8.js} +2 -0
- package/dist/{agent-runner-DgNATN4D.js → agent-runner-CrDrPUtY.js} +3411 -1640
- package/dist/api/schema.d.ts +2 -5630
- package/dist/api/schema.js +7 -7
- package/dist/api.d.ts +3 -1
- package/dist/api.js +268 -287
- package/dist/{app-DAB3fzyp.d.ts → app-BrMMzjYm.d.ts} +10 -3
- package/dist/app.d.ts +1 -1
- package/dist/app.js +371 -223
- package/dist/{automation-CmeFBSEh.js → automation-p87hg_AV.js} +74 -74
- package/dist/{briefs-CWKjka7v.js → briefs-PtODdLNu.js} +4 -4
- package/dist/{catalog-runtime-cMlAI5LY.js → catalog-runtime-BsoSmTM0.js} +1 -1
- package/dist/cli/chat.js +16 -26
- package/dist/cli/check.js +3 -3
- package/dist/cli/main.js +5 -3
- package/dist/cli/plugins.js +4 -4
- package/dist/cli/snapshot-create.js +4 -4
- package/dist/cli/upgrade.d.ts +1 -1
- package/dist/cli/upgrade.js +3 -3
- package/dist/{client-BjgbMawj.js → client-Cqf4TboL.js} +20 -15
- package/dist/{config-CdB6yJj5.js → config-CPsE4T5L.js} +2 -2
- package/dist/{connections-RE_65jzK.js → connections-upFXLmhG.js} +10 -11
- package/dist/{conversation-DSo310Ps.js → conversation-CTpD_PGk.js} +7 -84
- package/dist/{conversation-privacy-BzgJC5k0.js → conversation-privacy-D6zJc8ff.js} +1 -1
- package/dist/{credential-sync-DhEGEpgq.js → credential-sync-CS_6IC-f.js} +30 -34
- package/dist/{credentialed-CIGwoLU2.js → credentialed-BU-OW7HP.js} +577 -74
- package/dist/{store-B8CABbmR.d.ts → db-BzOCzVb1.d.ts} +17 -7
- package/dist/{executor-VYrx_K4w.js → executor-CNS7ONt-.js} +78 -4
- package/dist/instrumentation.js +2 -2
- package/dist/{assistant-reply-CT7VcXQe.js → interruption-marker-g6Xup3Fk.js} +8 -2
- package/dist/{job-queue-C0BZSa7r.js → job-queue-DI-k-Bbk.js} +2 -2
- package/dist/{list-1XQP-o6K.js → list-CGoQdXTp.js} +429 -1401
- package/dist/locks-D-0h111u.js +48 -0
- package/dist/{logging-DuZ1A4ab.js → logging-n7knse-O.js} +1 -1
- package/dist/{history-C84mlAwO.js → media-85PDJxO_.js} +83 -1
- package/dist/{message-NKSbbnA6.js → message-BpaWd8TT.js} +4 -4
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-callback-server-qAHLPtml.js → oauth-callback-server-CpGmEw_i.js} +2 -2
- package/dist/{prompt-BW9jFsqZ.js → prompt-BlQB0QQt.js} +1 -1
- package/dist/{registry-FQutO926.js → registry-By36_xsm.js} +2 -2
- package/dist/reporting-schema-CZREhYc-.js +104 -0
- package/dist/reporting-window-CVarfId9.js +255 -0
- package/dist/{resolve-Bk4yeuHy.js → resolve-CUIBcdPd.js} +3 -3
- package/dist/{result-B9e9ATOU.js → result-BemsOMOO.js} +31 -12
- package/dist/{runner-C3S2ObH-.js → runner-BVok7PAA.js} +12 -11
- package/dist/{sandbox-egress-signals-DqpGzzMB.js → sandbox-egress-signals-BSUWQI95.js} +1 -1
- package/dist/{schema-X7Fj4fv1.js → schema-ChnFo5f2.js} +98 -6
- package/dist/schema-jK4-1u_H.d.ts +5927 -0
- package/dist/{service-account-Do30HUNv.js → service-account-DHvlLnZw.js} +4 -3
- package/dist/{service-account-BQasl-qq.js → service-account-hMmESDcr.js} +3 -3
- package/dist/{session-stop-DkOjt46_.js → session-stop-BQW_iFcd.js} +499 -23
- package/dist/{skills-CQHrwfOa.js → skills-DmJJIuLF.js} +2 -2
- package/dist/{spawn-BHuqN14f.js → spawn-ChCm46i-.js} +2 -2
- package/dist/{store-6EetVP-m.js → store-1DVhoKOL.js} +4 -4
- package/dist/{store-DvNZIsCr.js → store-DCo2n5iJ.js} +3 -3
- package/dist/{task-queue-B0DLgd2P.js → task-queue-HMC4QjFm.js} +3 -3
- package/dist/task-runner-cA6yjn_E.js +269 -0
- package/dist/{thread-state-DRmdJ2QN.js → thread-state-CHy8LS0C.js} +8 -18
- package/dist/{turn-failure-response-G11cs2gE.js → turn-failure-response-Dr7erLWs.js} +11 -16
- package/dist/{turn-lifecycle-OzLIwvi1.js → turn-lifecycle-bf2fIYi_.js} +1 -1
- package/dist/{tasks-0ilmuCux.js → turn-session-routing-BqO0qXLk.js} +959 -44
- package/dist/{validation-CxEmt1id.js → validation-DHR1ivfh.js} +1 -1
- package/dist/{version-Bapedn4A.js → version-CXCHLgWm.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-DrN3oC2X.js → viewer-DSbD6DF6.js} +503 -241
- package/dist/{work-DUQoNcqP.js → work-BE_qTYGi.js} +17 -36
- package/dist/{worker-D1l4Ugk0.js → worker-Cm9_sWXg.js} +15 -7
- package/migrations/0065_user_customization.sql +1 -0
- package/migrations/0066_review_items.sql +53 -0
- package/migrations/0067_review_item_dedupe_tenant.sql +2 -0
- package/migrations/0068_review_item_slack_cards.sql +10 -0
- package/migrations/0069_system_identity.sql +25 -0
- package/migrations/0070_review_item_foreign_keys.sql +5 -0
- package/migrations/AGENTS.md +17 -0
- package/migrations/meta/0065_snapshot.json +3511 -0
- package/migrations/meta/0066_snapshot.json +4099 -0
- package/migrations/meta/0067_snapshot.json +3921 -0
- package/migrations/meta/0068_snapshot.json +4176 -0
- package/migrations/meta/0069_snapshot.json +3979 -0
- package/migrations/meta/0070_snapshot.json +3997 -0
- package/migrations/meta/_journal.json +42 -0
- package/package.json +5 -5
- package/dist/db-Bg-zC3r5.d.ts +0 -5
- package/dist/history-BgI33Kie.d.ts +0 -78
- package/dist/images-CecjXAAz.js +0 -64
- package/dist/task-runner-B-PD_JOj.js +0 -1074
- package/dist/turn-session-routing-Dyut9l7Y.js +0 -76
- package/dist/user-input-request-BDFBdF8r.js +0 -116
- package/dist/web-message-id-CJSUiksE.js +0 -236
- package/migrations/README.md +0 -30
package/README.md
CHANGED
|
@@ -34,15 +34,8 @@ const app = await createApp({
|
|
|
34
34
|
export default app;
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
Run `junior init my-bot` to scaffold a complete project including `vercel.json` for Vercel deployment.
|
|
40
|
-
|
|
41
|
-
Use `defineJuniorPlugins([...])` in a runtime-safe plugin module, then point
|
|
42
|
-
`juniorNitro({ plugins: "./plugins" })` at that module and pass the same set to
|
|
43
|
-
`createApp({ plugins })`. Manifest-only packages use package-name strings;
|
|
44
|
-
factories such as `githubPlugin()` register their manifest and in-process hooks
|
|
45
|
-
together.
|
|
37
|
+
Run `junior init my-bot` to scaffold a complete project, including
|
|
38
|
+
`vercel.json` for Vercel deployment.
|
|
46
39
|
|
|
47
40
|
## Full docs
|
|
48
41
|
|
|
@@ -89,6 +89,7 @@ function clean(value) {
|
|
|
89
89
|
function isSyntheticActorUserId(value) {
|
|
90
90
|
return value.toLowerCase() === "unknown";
|
|
91
91
|
}
|
|
92
|
+
/** Return whether a value has the shape of a Slack user id. */
|
|
92
93
|
function isSlackUserId(value) {
|
|
93
94
|
return SLACK_USER_ID_DISPLAY_PATTERN.test(value);
|
|
94
95
|
}
|
|
@@ -204,4 +205,4 @@ function createSlackResumeActor(args) {
|
|
|
204
205
|
if (!actor || actor.platform !== "slack") throw new Error("Slack actor requires team and user ids");
|
|
205
206
|
return actor;
|
|
206
207
|
}
|
|
207
|
-
export {
|
|
208
|
+
export { isSlackUserId as a, parseStoredSlackActor as c, parseSlackChannelReferenceId as d, parseSlackTeamId as f, slackMessageTsSchema as g, slackMessageTsFromMs as h, isActorUserId as i, toStoredSlackActor as l, parseSlackMessageTs as m, createSlackActor as n, isUserActor as o, parseSlackUserId as p, createSlackResumeActor as r, parseActorUserId as s, createActor as t, parseSlackChannelId as u };
|
|
@@ -1,55 +1,7 @@
|
|
|
1
|
-
import { i as getChatConfig } from "./config-
|
|
2
|
-
import {
|
|
1
|
+
import { i as getChatConfig } from "./config-CPsE4T5L.js";
|
|
2
|
+
import { t as ACTIVE_LOCK_TTL_MS } from "./locks-D-0h111u.js";
|
|
3
3
|
import { createMemoryState } from "@chat-adapter/state-memory";
|
|
4
4
|
import { createRedisState } from "@chat-adapter/state-redis";
|
|
5
|
-
// src/chat/state/locks.ts
|
|
6
|
-
const ACTIVE_LOCK_TTL_MS = 9e4;
|
|
7
|
-
const MUTATION_LOCK_TTL_MS = 1e4;
|
|
8
|
-
/**
|
|
9
|
-
* Acquire a lock for long-running work that the queued state adapter should
|
|
10
|
-
* keep alive while the owning invocation is still making progress.
|
|
11
|
-
*/
|
|
12
|
-
async function acquireActiveLock(state, threadId) {
|
|
13
|
-
return await state.acquireLock(threadId, ACTIVE_LOCK_TTL_MS);
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Run work under one lock, optionally waiting for the current owner.
|
|
17
|
-
* `keepAlive` is for multi-store mutations that must retain ownership until all
|
|
18
|
-
* side effects finish; callers should still fence each blind write.
|
|
19
|
-
*/
|
|
20
|
-
async function withLock(state, key, run, options = {}) {
|
|
21
|
-
const startedAtMs = Date.now();
|
|
22
|
-
let lock;
|
|
23
|
-
while (true) {
|
|
24
|
-
lock = await state.acquireLock(key, options.ttlMs ?? 9e4);
|
|
25
|
-
if (lock) break;
|
|
26
|
-
if (Date.now() - startedAtMs >= (options.waitMs ?? 0)) return { acquired: false };
|
|
27
|
-
await setTimeout(options.retryMs ?? 25, void 0, { ref: false });
|
|
28
|
-
}
|
|
29
|
-
const ttlMs = options.ttlMs ?? 9e4;
|
|
30
|
-
const heartbeat = options.keepAlive ? setInterval(() => {
|
|
31
|
-
state.extendLock(lock, ttlMs);
|
|
32
|
-
}, Math.max(1, Math.floor(ttlMs / 3))) : void 0;
|
|
33
|
-
heartbeat?.unref();
|
|
34
|
-
try {
|
|
35
|
-
return {
|
|
36
|
-
acquired: true,
|
|
37
|
-
value: await run(lock)
|
|
38
|
-
};
|
|
39
|
-
} finally {
|
|
40
|
-
if (heartbeat) clearInterval(heartbeat);
|
|
41
|
-
await state.releaseLock(lock);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Prove lock ownership immediately before a blind write.
|
|
46
|
-
*
|
|
47
|
-
* Whole-record mutations must stop if their lock expired rather than overwrite
|
|
48
|
-
* state committed by a newer owner.
|
|
49
|
-
*/
|
|
50
|
-
async function fenceLock(state, lock, ttlMs = MUTATION_LOCK_TTL_MS) {
|
|
51
|
-
if (!await state.extendLock(lock, ttlMs)) throw new Error(`Lock ownership was lost before write for ${lock.threadId}`);
|
|
52
|
-
}
|
|
53
5
|
// src/chat/state/adapter.ts
|
|
54
6
|
const ACTIVE_LOCK_HEARTBEAT_MS = 3e4;
|
|
55
7
|
let stateAdapter;
|
|
@@ -267,4 +219,4 @@ async function disconnectStateAdapter() {
|
|
|
267
219
|
redisStateAdapter = void 0;
|
|
268
220
|
}
|
|
269
221
|
}
|
|
270
|
-
export {
|
|
222
|
+
export { getDefaultRedisStateAdapterFor as n, getStateAdapter as r, disconnectStateAdapter as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { S as getDb, r as listAdminUsersFromSql, u as setUserAdminFromSql } from "./viewer-DSbD6DF6.js";
|
|
2
2
|
import { CLI_USAGE } from "./cli/run.js";
|
|
3
3
|
// src/cli/admin.ts
|
|
4
4
|
/**
|
|
@@ -32,6 +32,8 @@ const juniorUsers = pgTable("junior_users", {
|
|
|
32
32
|
primaryEmailNormalized: text("primary_email_normalized").notNull(),
|
|
33
33
|
displayName: text("display_name"),
|
|
34
34
|
timezone: text("timezone"),
|
|
35
|
+
/** Text the user saved to change how Junior replies to them. */
|
|
36
|
+
customization: text("customization"),
|
|
35
37
|
/** Junior-wide admin role. Only the `junior admin` CLI changes it. */
|
|
36
38
|
isAdmin: boolean("is_admin").notNull().default(false),
|
|
37
39
|
createdAt: timestamptz("created_at").notNull(),
|