@sentry/junior 0.315.0 → 0.317.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/{admin-5jUYY46p.js → admin-CAugg87B.js} +1 -1
- package/dist/{agent-runner-C7GNLRB6.js → agent-runner-AjrEV6Qe.js} +13532 -12811
- package/dist/{reporting-window-C4dbzDiR.js → agent-status-BA5x3Xtp.js} +33 -1
- package/dist/{agent-update-delivery-BNEYQsAf.js → agent-update-delivery-B_YIZcgf.js} +10 -37
- package/dist/api/schema.d.ts +609 -104
- package/dist/api/schema.js +6 -6
- package/dist/api.js +373 -469
- package/dist/{app-D_bAXRDe.d.ts → app-MoNAsVV5.d.ts} +52 -28
- package/dist/app.d.ts +1 -1
- package/dist/app.js +177 -132
- package/dist/catalog-runtime-DfSpJZdY.js +6 -0
- package/dist/{change-record-Bqsa5ZXE.d.ts → change-record-BzJgLsv7.d.ts} +60 -1
- package/dist/{adapter-context-BlSGE44V.js → channel-access-j-YAVYK4.js} +2 -42
- package/dist/{chat-core-engine-CxkwRpn9.js → chat-core-engine-aH85nEHv.js} +4 -3
- package/dist/{child-message--2G3Ft26.js → child-message-DHjQLEd1.js} +1 -1
- package/dist/cli/chat.js +23 -23
- package/dist/cli/check.js +5 -5
- package/dist/cli/main.js +2 -2
- package/dist/cli/plugins.js +5 -4
- package/dist/cli/snapshot-create.js +5 -2
- package/dist/cli/upgrade.js +27 -5
- package/dist/config-CHQ8X251.js +2422 -0
- package/dist/{continue-in-slack-BGKjIdFp.js → continue-in-slack-D-FZ8Fin.js} +2 -3
- package/dist/{conversation-feed-Sl8lKKmR.js → conversation-feed--9S0_PXL.js} +9 -4
- package/dist/{proxy-path-Dc-0jXGi.js → conversation-privacy-B1uXn5sf.js} +2 -16
- package/dist/{conversation-turn-BoLK9i6g.js → conversation-turn-BUE_7xaN.js} +102 -172
- package/dist/{create-BOycVH9h.js → create-DoDIYgtZ.js} +12 -10
- package/dist/{credential-sync-Mn4OdkEh.js → credential-sync-BJOqGnjV.js} +17 -12
- package/dist/{db-DXTOYRzR.js → db-BFmyYZtJ.js} +20276 -27398
- package/dist/{deployment-CG3TchWh.js → deployment-DXq9ZLU4.js} +17 -15
- package/dist/{engine-context-dyWlfNdD.js → engine-context-CgQ7mlHt.js} +264 -50
- package/dist/{html-CfXEwl_h.js → html-B3VKTGbJ.js} +6 -2
- package/dist/instrumentation.js +15 -7
- package/dist/{job-runner-CySgpi9v.js → job-runner-A1lCkybD.js} +397 -22
- package/dist/{lineage-tRTOcrsL.js → lineage-Bktb0UcV.js} +1 -1
- package/dist/{list-DXBz8SYL.js → list-Bxvg5wXf.js} +260 -698
- package/dist/{logging-czs0nqLC.js → logging--smS7XRK.js} +2 -2
- package/dist/{mailbox-turn-79Nv1JXv.js → mailbox-turn-uSXhUFc9.js} +648 -2957
- package/dist/{message-BTox2Cmb.js → message-BNenhsmB.js} +12 -22
- package/dist/{model-input-IRGa98V7.js → model-input-BReSnwHp.js} +3 -3
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +20 -6
- package/dist/{oauth-callback-server-NXK7AlBp.js → oauth-callback-server-CE4soEIY.js} +2 -2
- package/dist/{oauth-relay-6NBPSpFE.js → oauth-relay-C36gX1gH.js} +2 -2
- package/dist/{package-discovery-BI6T_RkD.js → package-discovery-DD9vencX.js} +1 -50
- package/dist/{parent-result-Dg6P6roR.js → parent-result-Ck1rFYRQ.js} +93 -106
- package/dist/{plugins-BXMdNdyA.js → plugins-D_Ru4CWc.js} +1 -1
- package/dist/profile-BQ-iBDsZ.js +4657 -0
- package/dist/{transcript-BHhJVY0P.js → prompt-Dv7gkpD6.js} +97 -103
- package/dist/proxy-path-BHYoKZdq.js +15 -0
- package/dist/registry-iXMT5Jmh.js +3279 -0
- package/dist/reports-WKHfGTsU.js +195 -0
- package/dist/{resolve-BUFkmxkT.js → resolve-tony4ibz.js} +9 -29
- package/dist/{result-DfATzX77.js → result-Bta_dlWa.js} +42 -117
- package/dist/run-conversation-DL6ru7iW.js +336 -0
- package/dist/{runner-CmKP3inb.js → runner-BstDRbD9.js} +7 -7
- package/dist/{sandbox-egress-signals-DYo5BsM7.js → sandbox-egress-signals-oSJMJOnn.js} +1 -1
- package/dist/{schema-DrBMdPmv.js → schema-DfqrHACA.js} +67 -84
- package/dist/sender-actors-CPglLd5R.js +83 -0
- package/dist/{service-account-CxTX7nnR.js → service-account-CTV_jaNu.js} +3 -1
- package/dist/{skills-BlHUDj7k.js → skills-BCEU41zM.js} +4 -4
- package/dist/{slack-conversation-unfurl-Dhe3lB1U.js → slack-conversation-unfurl-DxVmhbGP.js} +7 -6
- package/dist/{spawn-CfvlFdfz.js → spawn-frczVPIr.js} +11 -8
- package/dist/{system-prompt-table-CDCYVwqN.js → system-prompt-table-CiXy0eNR.js} +91 -70
- package/dist/{task-runner-DcdQJd9e.js → task-runner-C9Yc2_ae.js} +35 -49
- package/dist/{thread-context-DF5uDcWN.js → thread-context-CqZDKErp.js} +6 -6
- package/dist/topics-SRN7IVX-.js +24 -0
- package/dist/turn-membership-CENFf3kI.js +856 -0
- package/dist/{turn-wake-um5Ubd4m.js → turn-wake-BhloiI2h.js} +4 -5
- package/dist/{media-Cr9pGkzr.js → types-C4iC-IMC.js} +819 -777
- package/dist/user-customization-CvfuY9Eo.js +93 -0
- package/dist/users-ByG5RCEJ.js +181 -0
- package/dist/{validation-CJyuOPD2.js → validation-8gjfR91V.js} +1 -1
- package/dist/{version-Bhe7RPIe.js → version-BeZhWWBE.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{worker-D8PRgUqr.js → worker-BqMQQNRk.js} +5 -4
- package/migrations/20261125171254_conversation_visibility/migration.sql +4 -0
- package/migrations/20261125171254_conversation_visibility/snapshot.json +67 -0
- package/migrations/20261125171257_conversation_visibility_backfill/migration.sql +25 -0
- package/migrations/20261125171257_conversation_visibility_backfill/snapshot.json +9 -0
- package/migrations/20261125213232_drop_versions_notify/migration.sql +19 -0
- package/migrations/20261125213232_drop_versions_notify/snapshot.json +9 -0
- package/migrations/20261125225138_conversation_kind_root_thread/migration.sql +23 -0
- package/migrations/20261125225138_conversation_kind_root_thread/snapshot.json +55 -0
- package/migrations/20261125225142_conversation_kind_root_thread_backfill/migration.sql +7 -0
- package/migrations/20261125225142_conversation_kind_root_thread_backfill/snapshot.json +9 -0
- package/migrations/20261126000151_conversation_event_message_role_seq_index/migration.sql +1 -0
- package/migrations/20261126000151_conversation_event_message_role_seq_index/snapshot.json +69 -0
- package/migrations/20261126012917_merge_leaves/migration.sql +2 -0
- package/migrations/20261126012917_merge_leaves/snapshot.json +12 -0
- package/migrations/20261126025226_drop_agent_invocations/migration.sql +6 -0
- package/migrations/20261126025226_drop_agent_invocations/snapshot.json +9 -0
- package/migrations/20261126033000_space_conversations_lead_children/migration.sql +155 -0
- package/migrations/20261126033000_space_conversations_lead_children/snapshot.json +9 -0
- package/migrations/20261126144620_drop_user_message_time_index/migration.sql +1 -0
- package/migrations/20261126144620_drop_user_message_time_index/snapshot.json +38 -0
- package/migrations/20261126153100_inbox_item_subjects/migration.sql +140 -0
- package/migrations/20261126153100_inbox_item_subjects/snapshot.json +9 -0
- package/migrations/20261126153103_inbox_item_subjects_not_null/migration.sql +12 -0
- package/migrations/20261126153103_inbox_item_subjects_not_null/snapshot.json +9 -0
- package/migrations/20261126153105_inbox_item_subject_indexes/migration.sql +1 -0
- package/migrations/20261126153105_inbox_item_subject_indexes/snapshot.json +9 -0
- package/migrations/20261126153108_automation_run_conversation_index/migration.sql +1 -0
- package/migrations/20261126153108_automation_run_conversation_index/snapshot.json +9 -0
- package/migrations/20261126153159_inbox_item_subjects_schema/migration.sql +4 -0
- package/migrations/20261126153159_inbox_item_subjects_schema/snapshot.json +437 -0
- package/migrations/20261126153259_inbox_questions/migration.sql +76 -0
- package/migrations/20261126153259_inbox_questions/snapshot.json +9 -0
- package/migrations/20261126153301_inbox_questions_valid/migration.sql +3 -0
- package/migrations/20261126153301_inbox_questions_valid/snapshot.json +9 -0
- package/migrations/20261126153343_inbox_questions_schema/migration.sql +5 -0
- package/migrations/20261126153343_inbox_questions_schema/snapshot.json +407 -0
- package/migrations/20261126154025_inbox_item_owners/migration.sql +74 -0
- package/migrations/20261126154025_inbox_item_owners/snapshot.json +9 -0
- package/migrations/20261126154048_inbox_item_open_subject_key_index/migration.sql +1 -0
- package/migrations/20261126154048_inbox_item_open_subject_key_index/snapshot.json +9 -0
- package/migrations/20261126154051_drop_inbox_item_owner_indexes/migration.sql +7 -0
- package/migrations/20261126154051_drop_inbox_item_owner_indexes/snapshot.json +9 -0
- package/migrations/20261126154121_inbox_item_owners_schema/migration.sql +8 -0
- package/migrations/20261126154121_inbox_item_owners_schema/snapshot.json +311 -0
- package/migrations/20261126175601_conversation_event_turn/migration.sql +5 -0
- package/migrations/20261126175601_conversation_event_turn/snapshot.json +103 -0
- package/migrations/20261126175614_conversation_event_turn_index/migration.sql +1 -0
- package/migrations/20261126175614_conversation_event_turn_index/snapshot.json +62 -0
- package/migrations/20261126230028_merge_leaves/migration.sql +2 -0
- package/migrations/20261126230028_merge_leaves/snapshot.json +12 -0
- package/migrations/20261126231932_space_lead_holds_name/migration.sql +46 -0
- package/migrations/20261126231932_space_lead_holds_name/snapshot.json +58 -0
- package/migrations/20261127001022_merge_leaves/migration.sql +2 -0
- package/migrations/20261127001022_merge_leaves/snapshot.json +12 -0
- package/package.json +5 -5
- package/skills/jr-rpc/SKILL.md +3 -5
- package/dist/direct-url-BYgYfuIy.js +0 -22
- package/dist/markers-CE0HMXWT.js +0 -67
- package/dist/people-Cegp1Iwq.js +0 -81
- package/dist/start-conversation-Uh8Sk1EF.js +0 -162
- package/dist/turn-session-routing-GtetHsdO.js +0 -1309
- package/dist/user-customization-B27StpVQ.js +0 -9
- package/dist/web-message-id-C6P83ans.js +0 -10
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
|
+
import { t as createPluginCatalogRuntime } from "./registry-iXMT5Jmh.js";
|
|
3
|
+
// src/chat/plugins/catalog-runtime.ts
|
|
4
|
+
var catalog_runtime_exports = /* @__PURE__ */ __exportAll({ pluginCatalogRuntime: () => pluginCatalogRuntime });
|
|
5
|
+
const pluginCatalogRuntime = createPluginCatalogRuntime();
|
|
6
|
+
export { pluginCatalogRuntime as n, catalog_runtime_exports as t };
|
|
@@ -98,6 +98,65 @@ declare function normalizeUserInputAnswer(request: UserInputRequest, answer: Use
|
|
|
98
98
|
declare function answeredChoices(request: UserInputRequest, answer: UserInputAnswer): string[];
|
|
99
99
|
/** Return true when an answer has no value and no free text. */
|
|
100
100
|
declare function isEmptyUserInputAnswer(answer: UserInputAnswer): boolean;
|
|
101
|
+
/**
|
|
102
|
+
* The question of an Inbox item with its related links. The links are part
|
|
103
|
+
* of the question, so they are stored with it in `request`.
|
|
104
|
+
*/
|
|
105
|
+
declare const inboxItemRequestSchema: z.ZodObject<{
|
|
106
|
+
question: z.ZodString;
|
|
107
|
+
fields: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
108
|
+
id: z.ZodString;
|
|
109
|
+
label: z.ZodString;
|
|
110
|
+
description: z.ZodOptional<z.ZodString>;
|
|
111
|
+
kind: z.ZodLiteral<"choice">;
|
|
112
|
+
options: z.ZodArray<z.ZodObject<{
|
|
113
|
+
label: z.ZodString;
|
|
114
|
+
description: z.ZodOptional<z.ZodString>;
|
|
115
|
+
recommended: z.ZodOptional<z.ZodBoolean>;
|
|
116
|
+
}, z.core.$strip>>;
|
|
117
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
118
|
+
id: z.ZodString;
|
|
119
|
+
label: z.ZodString;
|
|
120
|
+
description: z.ZodOptional<z.ZodString>;
|
|
121
|
+
kind: z.ZodLiteral<"multi_choice">;
|
|
122
|
+
options: z.ZodArray<z.ZodObject<{
|
|
123
|
+
label: z.ZodString;
|
|
124
|
+
description: z.ZodOptional<z.ZodString>;
|
|
125
|
+
recommended: z.ZodOptional<z.ZodBoolean>;
|
|
126
|
+
}, z.core.$strip>>;
|
|
127
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
128
|
+
id: z.ZodString;
|
|
129
|
+
label: z.ZodString;
|
|
130
|
+
description: z.ZodOptional<z.ZodString>;
|
|
131
|
+
kind: z.ZodLiteral<"text">;
|
|
132
|
+
}, z.core.$strip>], "kind">>;
|
|
133
|
+
related: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
134
|
+
conversationId: z.ZodOptional<z.ZodString>;
|
|
135
|
+
label: z.ZodString;
|
|
136
|
+
note: z.ZodOptional<z.ZodString>;
|
|
137
|
+
url: z.ZodOptional<z.ZodString>;
|
|
138
|
+
}, z.core.$strict>>>;
|
|
139
|
+
}, z.core.$strip>;
|
|
140
|
+
type InboxItemRequest = z.output<typeof inboxItemRequestSchema>;
|
|
141
|
+
/**
|
|
142
|
+
* The request of a notice: only the related links that say what it is
|
|
143
|
+
* about, such as a pull request. A notice asks nothing, so it has no
|
|
144
|
+
* question.
|
|
145
|
+
*/
|
|
146
|
+
declare const inboxItemNoticeRequestSchema: z.ZodObject<{
|
|
147
|
+
related: z.ZodArray<z.ZodObject<{
|
|
148
|
+
conversationId: z.ZodOptional<z.ZodString>;
|
|
149
|
+
label: z.ZodString;
|
|
150
|
+
note: z.ZodOptional<z.ZodString>;
|
|
151
|
+
url: z.ZodOptional<z.ZodString>;
|
|
152
|
+
}, z.core.$strict>>;
|
|
153
|
+
}, z.core.$strict>;
|
|
154
|
+
type InboxItemNoticeRequest = z.output<typeof inboxItemNoticeRequestSchema>;
|
|
155
|
+
/**
|
|
156
|
+
* Return the question of an item's request. A notice's request holds only
|
|
157
|
+
* related links, so it has none.
|
|
158
|
+
*/
|
|
159
|
+
declare function inboxItemQuestion(request: InboxItemRequest | InboxItemNoticeRequest | null | undefined): InboxItemRequest | undefined;
|
|
101
160
|
/** Saved automation facts shown with a Message, not a live status view. */
|
|
102
161
|
declare const automationCardSchema: z.ZodObject<{
|
|
103
162
|
kind: z.ZodLiteral<"automation">;
|
|
@@ -172,4 +231,4 @@ declare const inboxItemChangeRecordSchema: z.ZodObject<{
|
|
|
172
231
|
reviewItemId: z.ZodString;
|
|
173
232
|
}, z.core.$strict>;
|
|
174
233
|
type InboxItemChangeRecord = z.output<typeof inboxItemChangeRecordSchema>;
|
|
175
|
-
export {
|
|
234
|
+
export { normalizeUserInputAnswer as _, annotationCard as a, MAX_INPUT_ATTACHMENTS as b, AutomationCard as c, UserInputAnswer as d, UserInputField as f, isEmptyUserInputAnswer as g, buttonUserInputField as h, MessageCard as i, inboxItemQuestion as l, answeredChoices as m, conversationTurnFailureCodeSchema as n, messageCardText as o, UserInputRequest as p, conversationTurnFailureReasonSchema as r, resolveMessageCards as s, InboxItemChangeRecord as t, USER_INPUT_NOTE as u, InputFile as v, MessageAttachment as x, MAX_ATTACHMENT_BYTES as y };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fs as SlackActionError, i as getConversationStore, qs as withSlackRetries, zs as getSlackClient } from "./db-BFmyYZtJ.js";
|
|
2
2
|
import * as z from "zod";
|
|
3
3
|
// src/chat/slack/channel.ts
|
|
4
4
|
const replySubtypeSchema = z.object({ subtype: z.string().optional() });
|
|
@@ -217,44 +217,4 @@ async function joinPublicChannelForRead(args) {
|
|
|
217
217
|
throw error;
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
|
-
|
|
221
|
-
const initializedAdapters = /* @__PURE__ */ new WeakSet();
|
|
222
|
-
async function getConnectedState(stateAdapter) {
|
|
223
|
-
const state = stateAdapter ?? getStateAdapter();
|
|
224
|
-
await state.connect();
|
|
225
|
-
return state;
|
|
226
|
-
}
|
|
227
|
-
/** Initialize the Slack adapter against the repository state adapter. */
|
|
228
|
-
async function ensureSlackAdapterInitialized(args) {
|
|
229
|
-
if (initializedAdapters.has(args.adapter)) return;
|
|
230
|
-
const state = await getConnectedState(args.state);
|
|
231
|
-
await args.adapter.initialize({ getState: () => state });
|
|
232
|
-
if (args.adapter.defaultBotTokenProvider && !args.adapter.botUserId) throw new Error("Slack adapter initialized without a resolved bot user id");
|
|
233
|
-
initializedAdapters.add(args.adapter);
|
|
234
|
-
}
|
|
235
|
-
/** Verify a Slack request using the adapter's configured signing secret. */
|
|
236
|
-
function verifySlackSignature(args) {
|
|
237
|
-
const verifySignature = args.adapter.verifySignature;
|
|
238
|
-
if (!verifySignature) throw new Error("Slack adapter does not expose signature verification");
|
|
239
|
-
return verifySignature.call(args.adapter, args.body, args.request.headers.get("x-slack-request-timestamp"), args.request.headers.get("x-slack-signature"));
|
|
240
|
-
}
|
|
241
|
-
/** Run Slack work with the installation token that matches the inbound event. */
|
|
242
|
-
async function runWithSlackInstallation(args) {
|
|
243
|
-
await ensureSlackAdapterInitialized({
|
|
244
|
-
adapter: args.adapter,
|
|
245
|
-
state: args.state
|
|
246
|
-
});
|
|
247
|
-
const internals = args.adapter;
|
|
248
|
-
if (internals.defaultBotTokenProvider) return await args.task();
|
|
249
|
-
const installationId = args.installation.isEnterpriseInstall ? args.installation.enterpriseId : args.installation.teamId;
|
|
250
|
-
if (!installationId) throw new Error("Slack installation context is missing team id");
|
|
251
|
-
if (!internals.resolveTokenForTeam || !internals.requestContext) throw new Error("Slack adapter cannot resolve workspace installations");
|
|
252
|
-
const tokenContext = await internals.resolveTokenForTeam.call(args.adapter, installationId, args.installation.isEnterpriseInstall);
|
|
253
|
-
if (!tokenContext) throw new Error(`Slack installation token was not found for ${installationId}`);
|
|
254
|
-
return await internals.requestContext.run({
|
|
255
|
-
...tokenContext,
|
|
256
|
-
enterpriseId: args.installation.enterpriseId,
|
|
257
|
-
isEnterpriseInstall: args.installation.isEnterpriseInstall
|
|
258
|
-
}, () => runWithSlackInstallationToken(tokenContext.token, args.task));
|
|
259
|
-
}
|
|
260
|
-
export { getChannelMessage as a, isPublicSlackChannel as c, listThreadReplies as d, joinPublicChannelForRead as i, joinPublicChannel as l, verifySlackSignature as n, getConversationInfo as o, checkSlackChannelReadAccess as r, isConversationMember as s, runWithSlackInstallation as t, listChannelMessages as u };
|
|
220
|
+
export { isConversationMember as a, listChannelMessages as c, getConversationInfo as i, listThreadReplies as l, joinPublicChannelForRead as n, isPublicSlackChannel as o, getChannelMessage as r, joinPublicChannel as s, checkSlackChannelReadAccess as t };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as getChatConfig } from "./config-CHQ8X251.js";
|
|
2
|
+
import { $d as juniorTurns, d as createSqlConversationEventStore, i as getConversationStore, oc as SYSTEM_IDENTITY_ID } from "./db-BFmyYZtJ.js";
|
|
2
3
|
import { t as startLocalVercelQueueServer } from "./local-server-CpnGhYml.js";
|
|
3
|
-
import {
|
|
4
|
+
import { oi as projectConversationEvents } from "./mailbox-turn-uSXhUFc9.js";
|
|
4
5
|
import { n as TURN_STEP_TOPIC } from "./topic-CRYYBYp-.js";
|
|
5
|
-
import { a as scheduleInput, i as turnStepConsumer, n as turnTools, r as createGatewayModelClient, t as createEngineContext } from "./engine-context-
|
|
6
|
+
import { a as scheduleInput, i as turnStepConsumer, n as turnTools, r as createGatewayModelClient, t as createEngineContext } from "./engine-context-CgQ7mlHt.js";
|
|
6
7
|
import { randomUUID } from "node:crypto";
|
|
7
8
|
import { localDestinationSchema } from "@sentry/junior-plugin-api";
|
|
8
9
|
import { setTimeout } from "node:timers/promises";
|
package/dist/cli/chat.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as loadAppPluginSet } from "../plugin-module-Cv2ETe8Y.js";
|
|
2
|
-
import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-
|
|
2
|
+
import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-AjrEV6Qe.js";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { createHash, randomUUID } from "node:crypto";
|
|
5
5
|
import { stderr, stdin, stdout } from "node:process";
|
|
@@ -97,18 +97,18 @@ async function loadLocalPluginSet() {
|
|
|
97
97
|
}
|
|
98
98
|
/** Configure plugin hooks after local chat has selected its state adapter. */
|
|
99
99
|
async function configureLocalChatPlugins(pluginSet) {
|
|
100
|
-
const [pluginsModule,
|
|
101
|
-
import("../plugins-
|
|
102
|
-
import("../db-
|
|
103
|
-
import("../
|
|
104
|
-
import("../validation-
|
|
105
|
-
import("../db-
|
|
100
|
+
const [pluginsModule, registryModule, catalogRuntimeModule, validationModule, databaseModule] = await Promise.all([
|
|
101
|
+
import("../plugins-D_Ru4CWc.js").then((n) => n.o),
|
|
102
|
+
import("../db-BFmyYZtJ.js").then((n) => n.Ct),
|
|
103
|
+
import("../catalog-runtime-DfSpJZdY.js").then((n) => n.t),
|
|
104
|
+
import("../validation-8gjfR91V.js").then((n) => n.r),
|
|
105
|
+
import("../db-BFmyYZtJ.js").then((n) => n.t)
|
|
106
106
|
]);
|
|
107
107
|
const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
|
|
108
108
|
const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
|
|
109
109
|
const pluginConfig = resolvedPluginSet ? pluginsModule.pluginCatalogConfigFromPluginSet(resolvedPluginSet) : pluginsModule.pluginCatalogConfigFromEnv();
|
|
110
110
|
const shouldValidatePluginCatalog = Boolean(pluginConfig) || Boolean(resolvedPluginSet?.registrations.length);
|
|
111
|
-
|
|
111
|
+
registryModule.validatePlugins(plugins);
|
|
112
112
|
const previousPluginCatalogConfig = catalogRuntimeModule.pluginCatalogRuntime.setConfig(pluginConfig);
|
|
113
113
|
try {
|
|
114
114
|
if (shouldValidatePluginCatalog) {
|
|
@@ -117,7 +117,7 @@ async function configureLocalChatPlugins(pluginSet) {
|
|
|
117
117
|
validationModule.validatePluginEgressCredentialHooks(resolvedPluginSet?.registrations ?? []);
|
|
118
118
|
}
|
|
119
119
|
databaseModule.getDb();
|
|
120
|
-
|
|
120
|
+
registryModule.setPlugins(plugins);
|
|
121
121
|
} catch (error) {
|
|
122
122
|
catalogRuntimeModule.pluginCatalogRuntime.setConfig(previousPluginCatalogConfig);
|
|
123
123
|
throw error;
|
|
@@ -154,28 +154,28 @@ function localDevServerUrl() {
|
|
|
154
154
|
async function prepareLocalChatRun(io, pluginSet) {
|
|
155
155
|
defaultStateAdapterForLocalChat();
|
|
156
156
|
await configureLocalChatPlugins(pluginSet);
|
|
157
|
-
const { setEventEmbeddingsConfig } = await import("../db-
|
|
157
|
+
const { setEventEmbeddingsConfig } = await import("../db-BFmyYZtJ.js").then((n) => n.Tu);
|
|
158
158
|
setEventEmbeddingsConfig({ enabled: true });
|
|
159
|
-
const { runLocalAgentTurn } = await import("../runner-
|
|
160
|
-
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-
|
|
161
|
-
const { createLocalOAuthState } = await import("../oauth-relay-
|
|
162
|
-
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-
|
|
163
|
-
const { bindSpawnAgent } = await import("../spawn-
|
|
164
|
-
const { bindMessageAgent } = await import("../message-
|
|
165
|
-
const {
|
|
166
|
-
const { createConversationTurnWorker } = await import("../conversation-turn-
|
|
167
|
-
const { resumeForPersonInput } = await import("../mailbox-turn-
|
|
159
|
+
const { runLocalAgentTurn } = await import("../runner-BstDRbD9.js");
|
|
160
|
+
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-CE4soEIY.js");
|
|
161
|
+
const { createLocalOAuthState } = await import("../oauth-relay-C36gX1gH.js").then((n) => n.t);
|
|
162
|
+
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-oSJMJOnn.js");
|
|
163
|
+
const { bindSpawnAgent } = await import("../spawn-frczVPIr.js").then((n) => n.n);
|
|
164
|
+
const { bindMessageAgent } = await import("../message-BNenhsmB.js").then((n) => n.n);
|
|
165
|
+
const { runConversation } = await import("../run-conversation-DL6ru7iW.js").then((n) => n.n);
|
|
166
|
+
const { createConversationTurnWorker } = await import("../conversation-turn-BUE_7xaN.js").then((n) => n.t);
|
|
167
|
+
const { resumeForPersonInput } = await import("../mailbox-turn-uSXhUFc9.js").then((n) => n.q);
|
|
168
168
|
const { createLocalConversationWork } = await import("../conversation-work-BaT_T6EB.js");
|
|
169
|
-
const { processConversationWork } = await import("../worker-
|
|
169
|
+
const { processConversationWork } = await import("../worker-BqMQQNRk.js").then((n) => n.n);
|
|
170
170
|
let agentRunner;
|
|
171
171
|
const localConversationWork = createLocalConversationWork(async (message) => {
|
|
172
172
|
if (!agentRunner) throw new Error("Local agent runner is not ready");
|
|
173
|
-
const
|
|
173
|
+
const runTurn = createConversationTurnWorker(agentRunner, void 0, { queue: localConversationWork.queue });
|
|
174
174
|
await processConversationWork(message, {
|
|
175
175
|
queue: localConversationWork.queue,
|
|
176
176
|
run: async (context) => {
|
|
177
177
|
await resumeForPersonInput(context.conversationId, context.attempt.messages);
|
|
178
|
-
return await
|
|
178
|
+
return await runConversation(context, { runTurn });
|
|
179
179
|
}
|
|
180
180
|
});
|
|
181
181
|
});
|
|
@@ -233,7 +233,7 @@ async function runPrompt(options, io, pluginSet) {
|
|
|
233
233
|
async function runCorePrompt(options, io, pluginSet) {
|
|
234
234
|
defaultStateAdapterForLocalChat();
|
|
235
235
|
await configureLocalChatPlugins(pluginSet);
|
|
236
|
-
const { runCoreEnginePrompt } = await import("../chat-core-engine-
|
|
236
|
+
const { runCoreEnginePrompt } = await import("../chat-core-engine-aH85nEHv.js");
|
|
237
237
|
const result = await runCoreEnginePrompt({
|
|
238
238
|
conversationId: newRunConversationId(),
|
|
239
239
|
message: options.message
|
package/dist/cli/check.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as parseSkillFile } from "../skills-
|
|
3
|
-
import { a as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, c as JUNIOR_HEARTBEAT_ROUTE, m as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION } from "../deployment-
|
|
4
|
-
import {
|
|
1
|
+
import { L as mapBounded } from "../prompt-Dv7gkpD6.js";
|
|
2
|
+
import { a as parseSkillFile } from "../skills-BCEU41zM.js";
|
|
3
|
+
import { a as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, c as JUNIOR_HEARTBEAT_ROUTE, m as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION } from "../deployment-DXq9ZLU4.js";
|
|
4
|
+
import { X as parseInlinePluginManifest, Z as parsePluginManifest } from "../registry-iXMT5Jmh.js";
|
|
5
5
|
import * as z from "zod";
|
|
6
|
-
import pLimit from "p-limit";
|
|
7
6
|
import path from "node:path";
|
|
8
7
|
import { mentionsTag } from "@sentry/junior-plugin-api";
|
|
8
|
+
import pLimit from "p-limit";
|
|
9
9
|
import fs from "node:fs/promises";
|
|
10
10
|
import { pathToFileURL } from "node:url";
|
|
11
11
|
// src/cli/check.ts
|
package/dist/cli/main.js
CHANGED
|
@@ -45,10 +45,10 @@ async function runChat(argv, pluginSet) {
|
|
|
45
45
|
return await (await import("./chat.js")).runChat(argv, void 0, { pluginSet });
|
|
46
46
|
}
|
|
47
47
|
async function runAdmin(argv) {
|
|
48
|
-
return await (await import("../admin-
|
|
48
|
+
return await (await import("../admin-CAugg87B.js")).runAdmin(argv);
|
|
49
49
|
}
|
|
50
50
|
async function runServiceAccount(argv) {
|
|
51
|
-
return await (await import("../service-account-
|
|
51
|
+
return await (await import("../service-account-CTV_jaNu.js")).runServiceAccount(argv);
|
|
52
52
|
}
|
|
53
53
|
function topLevelCommand(argv) {
|
|
54
54
|
return (argv[0] === "--" ? argv.slice(1) : argv)[0];
|
package/dist/cli/plugins.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { n as
|
|
1
|
+
import { Dt as coreRegistrations, Tt as validatePlugins, a as getDb, wt as setPlugins } from "../db-BFmyYZtJ.js";
|
|
2
|
+
import { h as createPluginLogger } from "../prompt-Dv7gkpD6.js";
|
|
3
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime-DfSpJZdY.js";
|
|
4
|
+
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-8gjfR91V.js";
|
|
4
5
|
import { t as loadAppPluginSet } from "../plugin-module-Cv2ETe8Y.js";
|
|
5
|
-
import { a as pluginRuntimeRegistrationsFromPluginSet, i as pluginCliRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "../plugins-
|
|
6
|
+
import { a as pluginRuntimeRegistrationsFromPluginSet, i as pluginCliRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "../plugins-D_Ru4CWc.js";
|
|
6
7
|
import { Command, CommanderError } from "commander";
|
|
7
8
|
import { stderr, stdout } from "node:process";
|
|
8
9
|
import { createJiti } from "jiti";
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as
|
|
1
|
+
import { n as getChatConfig } from "../config-CHQ8X251.js";
|
|
2
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime-DfSpJZdY.js";
|
|
3
|
+
import { n as resolve } from "../resolve-tony4ibz.js";
|
|
4
|
+
import { t as create, u as SANDBOX_RUNTIME } from "../profile-BQ-iBDsZ.js";
|
|
5
|
+
import { Gu as disconnectStateAdapter } from "../db-BFmyYZtJ.js";
|
|
3
6
|
// src/cli/snapshot-create.ts
|
|
4
7
|
const DEFAULT_TIMEOUT_MS = 6e5;
|
|
5
8
|
function progressMessage(phase) {
|
package/dist/cli/upgrade.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as getChatConfig } from "../config-CHQ8X251.js";
|
|
2
|
+
import { c as pendingMigrations, l as readMigrationRecords, s as createJuniorSqlExecutor } from "../db-BFmyYZtJ.js";
|
|
2
3
|
import { t as loadAppPluginSet } from "../plugin-module-Cv2ETe8Y.js";
|
|
3
|
-
import { t as
|
|
4
|
-
import { n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "../plugins-
|
|
4
|
+
import { t as createPluginCatalogRuntime } from "../registry-iXMT5Jmh.js";
|
|
5
|
+
import { n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "../plugins-D_Ru4CWc.js";
|
|
5
6
|
import { t as isMissingVirtualModule } from "../virtual-module-BeKA_EII.js";
|
|
6
7
|
import { basename, dirname, join, resolve } from "node:path";
|
|
7
8
|
import { createHash } from "node:crypto";
|
|
8
|
-
import { fileURLToPath } from "node:url";
|
|
9
9
|
import { readMigrationFiles } from "drizzle-orm/migrator";
|
|
10
|
+
import { fileURLToPath } from "node:url";
|
|
10
11
|
import { createJiti } from "jiti";
|
|
11
12
|
// src/chat/conversations/sql/migrations.ts
|
|
12
13
|
/** SQL schema migrations for durable Junior records. */
|
|
@@ -69,6 +70,27 @@ async function migrateSchema(executor) {
|
|
|
69
70
|
return lockedResult;
|
|
70
71
|
});
|
|
71
72
|
}
|
|
73
|
+
// src/cli/upgrade/database-url.ts
|
|
74
|
+
const NEON_POOLER_SUFFIX = "-pooler";
|
|
75
|
+
/**
|
|
76
|
+
* Pick the database URL for `junior upgrade` migrations.
|
|
77
|
+
*
|
|
78
|
+
* The migration lock is a session advisory lock. A transaction-mode pooler,
|
|
79
|
+
* such as Neon's `-pooler` endpoint, keeps that lock on its server session
|
|
80
|
+
* after the client leaves. The next upgrade on another session then waits,
|
|
81
|
+
* and one on the same session takes the lock again. For Neon, use the
|
|
82
|
+
* `DATABASE_URL` host without the `-pooler` suffix. The direct endpoint takes
|
|
83
|
+
* the same user, password, database, and parameters, so upgrade always
|
|
84
|
+
* migrates the database that `DATABASE_URL` names.
|
|
85
|
+
*/
|
|
86
|
+
function readMigrationDatabaseUrl(databaseUrl) {
|
|
87
|
+
if (!URL.canParse(databaseUrl)) return databaseUrl;
|
|
88
|
+
const url = new URL(databaseUrl);
|
|
89
|
+
const [endpoint, ...domain] = url.hostname.split(".");
|
|
90
|
+
if (!endpoint?.endsWith(NEON_POOLER_SUFFIX) || !url.hostname.endsWith(".neon.tech")) return databaseUrl;
|
|
91
|
+
url.hostname = [endpoint.slice(0, -7), ...domain].join(".");
|
|
92
|
+
return url.toString();
|
|
93
|
+
}
|
|
72
94
|
// src/chat/plugins/migrations.ts
|
|
73
95
|
function migrationTable(pluginName) {
|
|
74
96
|
return `__drizzle_${pluginName.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "").slice(0, 32)}_${createHash("sha256").update(pluginName).digest("hex").slice(0, 8)}`;
|
|
@@ -278,7 +300,7 @@ SELECT coalesce(
|
|
|
278
300
|
async function runUpgrade(io = DEFAULT_IO, options = {}) {
|
|
279
301
|
const { sql } = getChatConfig();
|
|
280
302
|
const sqlExecutor = createJuniorSqlExecutor({
|
|
281
|
-
connectionString:
|
|
303
|
+
connectionString: readMigrationDatabaseUrl(sql.databaseUrl),
|
|
282
304
|
driver: sql.driver,
|
|
283
305
|
onInfo: (message) => io.info(` ${message}`),
|
|
284
306
|
statementTimeoutMs: false
|