@sentry/junior 0.257.0 → 0.258.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/{actor-BTtLaeWy.js → actor-tlxzqaRe.js} +3 -6
- package/dist/{admin-DgIkm6Vy.js → admin-My1SLGVO.js} +2 -3
- package/dist/{agent-hooks-BjtTzvru.js → agent-hooks-BJ_5mlRH.js} +69 -109
- package/dist/{agent-invocations-Bdu3ROfo.js → agent-invocations-Qfz7dWgU.js} +6 -12
- package/dist/{agent-runner-D7OboVb3.js → agent-runner-DGsFQw72.js} +261 -458
- package/dist/api/schema.d.ts +414 -448
- package/dist/api/schema.js +5 -5
- package/dist/api.d.ts +2 -12
- package/dist/api.js +94 -158
- package/dist/{app-BsU5QNBd.d.ts → app-PX2H1PxU.d.ts} +21 -44
- package/dist/app.d.ts +3 -3
- package/dist/app.js +204 -321
- package/dist/{assistant-reply-CbTPebzL.js → assistant-reply-H1M-91oF.js} +3 -5
- package/dist/{automation-CHdlHVZP.js → automation-DWBFBenG.js} +6 -11
- package/dist/{briefs-oLOldnDM.js → briefs-vYoK85rJ.js} +8 -11
- package/dist/{cadence-D00SCzT1.js → cadence-R7Em4RjE.js} +1 -2
- package/dist/{catalog-runtime-CZzhGQ7F.js → catalog-runtime-BN4DVxco.js} +3 -4
- package/dist/cli/chat.d.ts +2 -4
- package/dist/cli/chat.js +22 -24
- package/dist/cli/check.d.ts +1 -3
- package/dist/cli/check.js +4 -5
- package/dist/cli/env.d.ts +1 -3
- package/dist/cli/env.js +1 -2
- package/dist/cli/init.d.ts +1 -3
- package/dist/cli/init.js +3 -3
- package/dist/cli/main.d.ts +1 -3
- package/dist/cli/main.js +4 -5
- package/dist/cli/plugins.d.ts +2 -4
- package/dist/cli/plugins.js +7 -8
- package/dist/cli/run.d.ts +1 -2
- package/dist/cli/run.js +1 -2
- package/dist/cli/snapshot-create.d.ts +1 -3
- package/dist/cli/snapshot-create.js +4 -5
- package/dist/cli/upgrade.d.ts +3 -6
- package/dist/cli/upgrade.js +11 -17
- package/dist/{client-D8HnkOQX.js → client-DbyHuMFU.js} +9 -16
- package/dist/{config-CJRnWK9H.js → config-_WO_AjCB.js} +18 -15
- package/dist/{connections-ClYrKzpX.js → connections-ag_1JOhB.js} +14 -19
- package/dist/{conversation-CKNLYBJt.js → conversation-DjN3mlog.js} +8 -15
- package/dist/{conversation-privacy-C8b1nphZ.js → conversation-privacy-DHP_xnVj.js} +2 -3
- package/dist/{conversation-work-C6y3T5Hx.js → conversation-work-BaT_T6EB.js} +1 -2
- package/dist/{credential-sync-BXfohNmJ.js → credential-sync-B-CPX_ag.js} +23 -28
- package/dist/{db-Ca9Nt5ci.d.ts → db-BnRqQ7G5.d.ts} +1 -1
- package/dist/{executor-Do0THDRR.js → executor-RvG6kVe1.js} +30 -52
- package/dist/{experimental-CQIvMUO7.js → experimental-BNK1l1jv.js} +2 -4
- package/dist/{history-9pO1Zd4Y.js → history-AY8rs-FR.js} +5 -9
- package/dist/{history-DvqWZlYX.d.ts → history-BgI33Kie.d.ts} +12 -20
- package/dist/{images-BN_BiBXF.js → images-C2J_bj2g.js} +5 -6
- package/dist/instrumentation.d.ts +1 -3
- package/dist/instrumentation.js +6 -8
- package/dist/{job-queue-B6SV9uVa.js → job-queue-DVe37it2.js} +6 -12
- package/dist/{logging-CWxiIuCF.js → logging-DsHONhVm.js} +7 -12
- package/dist/{message-TUOdbSBW.js → message-DyitL8no.js} +5 -6
- package/dist/{model-profile-BwU8mqwD.js → model-profile-Bg8EoCKD.js} +2 -4
- package/dist/nitro.d.ts +3 -5
- package/dist/nitro.js +12 -17
- package/dist/{oauth-authorization-BA4Dt6a7.js → oauth-authorization-djQn5Nhy.js} +2 -4
- package/dist/{oauth-callback-server-Dj5UJODo.js → oauth-callback-server-CDby-pCn.js} +3 -4
- package/dist/{oauth-relay-CdCnu80W.js → oauth-relay-CTygMkNx.js} +2 -3
- package/dist/{package-discovery-BVvSnQBB.js → package-discovery-DJBompdd.js} +17 -21
- package/dist/{pending-auth-s_QFribU.js → pending-auth-D8J1uJUS.js} +37 -28
- package/dist/{plugin-module-CVvEUSMH.js → plugin-module-Cf5gVPWP.js} +1 -2
- package/dist/{plugins-CjfUP5gJ.d.ts → plugins-B11Mfkmv.d.ts} +0 -4
- package/dist/{plugins-egKWjgue.js → plugins-DOm9Y6qI.js} +2 -3
- package/dist/{private-trace-result-BLvBjy_e.js → private-trace-result-CE7_lEdq.js} +1 -2
- package/dist/{profile-h-72wM78.js → profile-DpYjfKke.js} +16 -28
- package/dist/{prompt-DyoEj9c2.js → prompt-xgpyMtg7.js} +5 -9
- package/dist/{queue-B5SnqRln.d.ts → queue-C37RbDVc.d.ts} +0 -2
- package/dist/{registry-sLTr-sV9.js → registry-Du566MtJ.js} +16 -29
- package/dist/{resolve-ncQPZROQ.js → resolve-ClCIgh8E.js} +7 -12
- package/dist/{result-C883vngT.js → result-BBbKA61B.js} +13 -17
- package/dist/{rolldown-runtime-B4FMCO8f.js → rolldown-runtime-nwUcYXjP.js} +1 -2
- package/dist/{runner-CzYImdOF.js → runner-CCuqFSqx.js} +12 -13
- package/dist/{sandbox-egress-signals-CZbMINHI.js → sandbox-egress-signals-DY1mbKF4.js} +2 -3
- package/dist/{schema-Dy69D4Ge.js → schema-DrMh3NtR.js} +15 -26
- package/dist/{sentry-CgWZM_kV.js → sentry-BBUlHih9.js} +2 -3
- package/dist/{session-stop-CQjKd4a2.js → session-stop-CIoFiwwe.js} +23 -33
- package/dist/{skills-C22SLruK.js → skills-DyQBLIrK.js} +9 -9
- package/dist/{spawn-DY9CLXDL.js → spawn-Dqfeo7XP.js} +4 -5
- package/dist/{store-DoewL5mG.d.ts → store-CG0VJyye.d.ts} +0 -14
- package/dist/{store-DXFIQy-G.js → store-DJLwq4x8.js} +13 -15
- package/dist/{task-queue-B17vV0La.js → task-queue-BzW4MaWU.js} +5 -7
- package/dist/{task-runner-DUjvzYXj.js → task-runner-D3qJh4fK.js} +22 -26
- package/dist/{tasks-D_WIJtvO.js → tasks-CEXKTASS.js} +62 -78
- package/dist/{thread-state-Ch4yuCqG.js → thread-state-W3f6kAtz.js} +13 -19
- package/dist/{turn-failure-response-C5nBKC4S.js → turn-failure-response-CWx7aNIh.js} +16 -22
- package/dist/{turn-lifecycle-CO-ylUmV.js → turn-lifecycle-C9JFst7-.js} +2 -3
- package/dist/{turn-session-routing-B3LWooK5.js → turn-session-routing-CUxtfpr7.js} +2 -3
- package/dist/{validation-CXYxaNYx.js → validation-BHRxa5G4.js} +3 -4
- package/dist/vercel.d.ts +1 -3
- package/dist/vercel.js +1 -2
- package/dist/{version-BcdZy2zg.js → version-C0U6rHg0.js} +3 -5
- package/dist/{version-CnXZ614E.d.ts → version-Cc2OFd9G.d.ts} +0 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -2
- package/dist/{viewer-DSZXygMU.js → viewer-CGvvRqKp.js} +26 -57
- package/dist/{web-input-B9Bv0_lR.js → web-input-Keb5GRWj.js} +98 -155
- package/dist/{web-message-id-xPI_EFSC.js → web-message-id-CJSUiksE.js} +3 -6
- package/dist/{work-nAfDSUFP.js → work-DRcsJ3hV.js} +14 -16
- package/dist/{worker-vGXZ6XFT.js → worker-Cjo-QqPq.js} +7 -8
- package/package.json +7 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ct as extractAssistantText } from "./tasks-
|
|
2
|
-
|
|
1
|
+
import { ct as extractAssistantText } from "./tasks-CEXKTASS.js";
|
|
2
|
+
// src/chat/no-reply.ts
|
|
3
3
|
const NO_REPLY_MARKER = "[[NO_REPLY]]";
|
|
4
4
|
/**
|
|
5
5
|
* True when one assistant message ends with the silence marker.
|
|
@@ -8,8 +8,7 @@ const NO_REPLY_MARKER = "[[NO_REPLY]]";
|
|
|
8
8
|
function isNoReplyMarker(text) {
|
|
9
9
|
return text.trimEnd().endsWith(NO_REPLY_MARKER);
|
|
10
10
|
}
|
|
11
|
-
|
|
12
|
-
//#region src/chat/services/assistant-reply.ts
|
|
11
|
+
// src/chat/services/assistant-reply.ts
|
|
13
12
|
const THINKING_XML_BLOCK_PATTERN = /[ \t]*<thinking\b[^>]*>[\s\S]*?<\/thinking>[ \t]*(?:\r?\n)?/gi;
|
|
14
13
|
const FENCED_CODE_BLOCK_PATTERN = /```[\s\S]*?```/g;
|
|
15
14
|
/** Remove provider reasoning wrappers while preserving fenced code examples. */
|
|
@@ -41,5 +40,4 @@ function getAssistantReplyText(message) {
|
|
|
41
40
|
const decision = decideReply(message);
|
|
42
41
|
return decision.kind === "deliver" ? decision.text : void 0;
|
|
43
42
|
}
|
|
44
|
-
//#endregion
|
|
45
43
|
export { isNoReplyMarker as a, NO_REPLY_MARKER as i, getAssistantReplyText as n, sanitizeAssistantText as r, decideReply as t };
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { a as resolveLocalScheduleAtMs, i as isValidTimeZone, r as getZonedDateTimeParts, t as getFirstRunAtMs } from "./cadence-
|
|
1
|
+
import { a as resolveLocalScheduleAtMs, i as isValidTimeZone, r as getZonedDateTimeParts, t as getFirstRunAtMs } from "./cadence-R7Em4RjE.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { actorUserIdSchema, destinationVisibilitySchema, eventMatchSchema, eventTypeSchema, pluginEventTypeSchema, slackDestinationSchema, taskOutcomeSchema } from "@sentry/junior-plugin-api";
|
|
4
|
-
|
|
4
|
+
// src/chat/task-outcomes-schema.ts
|
|
5
5
|
const taskMessageDestinationInputSchema = z.enum(["current_conversation", "task_creator"]).describe("Where to send the message. Use current_conversation for posts, digests, summaries, and channel reminders. Use task_creator only when the user asks for a direct reminder or notification.");
|
|
6
6
|
/** Input accepted by task authoring tools before a user becomes a DM Destination. */
|
|
7
7
|
const taskOutcomeInputSchema = z.object({
|
|
8
8
|
action: z.literal("send_message"),
|
|
9
9
|
destination: taskMessageDestinationInputSchema
|
|
10
10
|
}).strict();
|
|
11
|
-
|
|
12
|
-
//#region src/chat/scheduled-automations/schedule-intent.ts
|
|
11
|
+
// src/chat/scheduled-automations/schedule-intent.ts
|
|
13
12
|
/**
|
|
14
13
|
* Owns model-facing schedule intent and materializes it against the trusted
|
|
15
14
|
* server clock into the canonical schedule persisted by core.
|
|
@@ -244,8 +243,7 @@ const eventAutomationSchema = z.object({
|
|
|
244
243
|
task: z.object({ text: z.string().min(1) }).strict(),
|
|
245
244
|
trigger: eventAutomationTriggerSchema
|
|
246
245
|
}).strict();
|
|
247
|
-
|
|
248
|
-
//#region src/chat/automations/edit-schema.ts
|
|
246
|
+
// src/chat/automations/edit-schema.ts
|
|
249
247
|
const automationTitleSchema = z.string().trim().min(1).max(60);
|
|
250
248
|
const automationInstructionSchema = z.string().trim().min(1).max(4e3);
|
|
251
249
|
/**
|
|
@@ -267,8 +265,7 @@ const eventAutomationEditSchema = automationEditFieldsSchema.extend({ trigger: e
|
|
|
267
265
|
identifier: z.string().trim().min(1).max(300),
|
|
268
266
|
label: z.string().trim().min(1).max(500)
|
|
269
267
|
}).optional() }).strict();
|
|
270
|
-
|
|
271
|
-
//#region src/chat/scheduled-automations/types.ts
|
|
268
|
+
// src/chat/scheduled-automations/types.ts
|
|
272
269
|
/** Durable scheduled-automation domain types owned by Junior core. */
|
|
273
270
|
const scheduledAutomationStatusSchema = z.enum([
|
|
274
271
|
"active",
|
|
@@ -375,8 +372,7 @@ const SCHEDULED_AUTOMATION_SYSTEM_ACTOR = Object.freeze({
|
|
|
375
372
|
platform: "system",
|
|
376
373
|
name: "scheduled-automation"
|
|
377
374
|
});
|
|
378
|
-
|
|
379
|
-
//#region src/api/schema/automation.ts
|
|
375
|
+
// src/api/schema/automation.ts
|
|
380
376
|
const automationDestinationSchema = z.object({
|
|
381
377
|
channelId: z.string().min(1),
|
|
382
378
|
label: z.string().min(1),
|
|
@@ -646,5 +642,4 @@ const automationEditErrorSchema = z.object({
|
|
|
646
642
|
const automationEventCatalogSchema = z.array(pluginEventTypeSchema.safeExtend({ namespace: z.string() }));
|
|
647
643
|
const automationScheduleIntentSchema = scheduleIntentSchema;
|
|
648
644
|
const automationSchedulePreviewSchema = scheduledAutomationSchema.pick({ schedule: true }).extend({ nextRunAtMs: z.number() }).strict();
|
|
649
|
-
//#endregion
|
|
650
645
|
export { eventAutomationSchema as A, eventAutomationSummarySchema as C, scheduledRunSchema as D, scheduledAutomationSchema as E, taskOutcomeInputSchema as F, compileScheduleIntent as M, scheduleIntentSchema as N, automationInstructionToolSchema as O, weekdaySchema as P, automationVersionSchema as S, SCHEDULED_AUTOMATION_SYSTEM_ACTOR as T, automationSummarySchema as _, automationExecutionSchema as a, automationVersionListSchema as b, automationLifecycleSchema as c, automationParamsSchema as d, automationRunListSchema as f, automationSchedulePreviewSchema as g, automationScheduleIntentSchema as h, automationExecutionListSchema as i, ScheduleIntentError as j, automationTitleSchema as k, automationListQuerySchema as l, automationRunWindowsSchema as m, automationEditSchema as n, automationExecutionStatusDaySchema as o, automationRunSchema as p, automationEventCatalogSchema as r, automationExecutionStatusSchema as s, automationEditErrorSchema as t, automationListSchema as u, automationUpdateSchema as v, scheduledAutomationSummarySchema as w, automationVersionParamsSchema as x, automationVersionActivateSchema as y };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { r as completeObject } from "./client-
|
|
2
|
-
import { r as defaultModelId } from "./model-profile-
|
|
3
|
-
import { U as parseBriefInput, d as conversationDetailReportSchema, p as conversationEventPageSchema, z as briefCodeChangeSchema } from "./conversation-
|
|
4
|
-
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-
|
|
1
|
+
import { r as completeObject } from "./client-DbyHuMFU.js";
|
|
2
|
+
import { r as defaultModelId } from "./model-profile-Bg8EoCKD.js";
|
|
3
|
+
import { U as parseBriefInput, d as conversationDetailReportSchema, p as conversationEventPageSchema, z as briefCodeChangeSchema } from "./conversation-DjN3mlog.js";
|
|
4
|
+
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-xgpyMtg7.js";
|
|
5
5
|
import { CLI_USAGE } from "./cli/run.js";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
9
|
-
|
|
9
|
+
// src/chat/briefs/render.ts
|
|
10
10
|
function list(items, empty) {
|
|
11
11
|
return items.length > 0 ? items.map((item) => `- ${item}`).join("\n") : empty;
|
|
12
12
|
}
|
|
@@ -114,8 +114,7 @@ function renderBriefMarkdown(args) {
|
|
|
114
114
|
""
|
|
115
115
|
].join("\n");
|
|
116
116
|
}
|
|
117
|
-
|
|
118
|
-
//#region src/chat/briefs/snapshot.ts
|
|
117
|
+
// src/chat/briefs/snapshot.ts
|
|
119
118
|
const conversationSnapshotSchema = z.object({
|
|
120
119
|
schemaVersion: z.literal(1),
|
|
121
120
|
pulledAt: z.string().datetime(),
|
|
@@ -194,8 +193,7 @@ function throughIndexFromSnapshot(snapshot) {
|
|
|
194
193
|
function completedTurnIndexesFromSnapshot(snapshot) {
|
|
195
194
|
return allEvents(snapshot).filter((event) => event.data.type === "turn_lifecycle" && (event.data.state === "succeeded" || event.data.state === "no_reply")).map((event) => event.seq);
|
|
196
195
|
}
|
|
197
|
-
|
|
198
|
-
//#region src/cli/briefs.ts
|
|
196
|
+
// src/cli/briefs.ts
|
|
199
197
|
/**
|
|
200
198
|
* Local Brief snapshot and replay CLI.
|
|
201
199
|
*
|
|
@@ -269,7 +267,7 @@ async function parseRunOptions(argv) {
|
|
|
269
267
|
* `DATABASE_URL` at import, and `briefs pull` must work with only a token.
|
|
270
268
|
*/
|
|
271
269
|
async function configuredDefaultModelId() {
|
|
272
|
-
const { botConfig } = await import("./config-
|
|
270
|
+
const { botConfig } = await import("./config-_WO_AjCB.js").then((n) => n.r);
|
|
273
271
|
return defaultModelId(botConfig);
|
|
274
272
|
}
|
|
275
273
|
function apiUrl(baseUrl, pathname) {
|
|
@@ -394,5 +392,4 @@ async function runBriefs(argv) {
|
|
|
394
392
|
return 1;
|
|
395
393
|
}
|
|
396
394
|
}
|
|
397
|
-
//#endregion
|
|
398
395
|
export { runBriefs };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/chat/scheduled-automations/cadence.ts
|
|
2
2
|
const FORMATTERS = /* @__PURE__ */ new Map();
|
|
3
3
|
function getFormatter(timezone) {
|
|
4
4
|
const existing = FORMATTERS.get(timezone);
|
|
@@ -252,5 +252,4 @@ function getNextRunAtMs(task, scheduledForMs, afterMs = scheduledForMs) {
|
|
|
252
252
|
timezone
|
|
253
253
|
});
|
|
254
254
|
}
|
|
255
|
-
//#endregion
|
|
256
255
|
export { resolveLocalScheduleAtMs as a, isValidTimeZone as i, getNextRunAtMs as n, getZonedDateTimeParts as r, getFirstRunAtMs as t };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { t as createPluginCatalogRuntime } from "./registry-
|
|
3
|
-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
|
|
2
|
+
import { t as createPluginCatalogRuntime } from "./registry-Du566MtJ.js";
|
|
3
|
+
// src/chat/plugins/catalog-runtime.ts
|
|
4
4
|
var catalog_runtime_exports = /* @__PURE__ */ __exportAll({ pluginCatalogRuntime: () => pluginCatalogRuntime });
|
|
5
5
|
const pluginCatalogRuntime = createPluginCatalogRuntime();
|
|
6
|
-
//#endregion
|
|
7
6
|
export { pluginCatalogRuntime as n, catalog_runtime_exports as t };
|
package/dist/cli/chat.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { n as JuniorPluginSet } from "../plugins-
|
|
2
|
-
//#region src/cli/chat.d.ts
|
|
1
|
+
import { n as JuniorPluginSet } from "../plugins-B11Mfkmv.js";
|
|
3
2
|
export declare const CHAT_USAGE = "usage: junior chat\n junior chat -p <message>";
|
|
4
3
|
export type ChatCommandOptions = {
|
|
5
4
|
mode: "interactive";
|
|
@@ -16,5 +15,4 @@ export interface ChatIo {
|
|
|
16
15
|
/** Run the local Junior chat command. */
|
|
17
16
|
export declare function runChat(argv: string[], io?: ChatIo, deps?: {
|
|
18
17
|
pluginSet?: JuniorPluginSet | null;
|
|
19
|
-
}): Promise<number>;
|
|
20
|
-
//#endregion
|
|
18
|
+
}): Promise<number>;
|
package/dist/cli/chat.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-
|
|
2
|
-
import { t as loadAppPluginSet } from "../plugin-module-
|
|
1
|
+
import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-DGsFQw72.js";
|
|
2
|
+
import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.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";
|
|
6
6
|
import { createJiti } from "jiti";
|
|
7
7
|
import * as readline from "node:readline/promises";
|
|
8
|
-
|
|
8
|
+
// src/chat/local/conversation.ts
|
|
9
9
|
const LOCAL_CONVERSATION_ALIAS_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/;
|
|
10
10
|
function slugifyConversationAlias(alias) {
|
|
11
11
|
const trimmed = alias.trim();
|
|
@@ -22,8 +22,7 @@ function normalizeLocalConversationId(input) {
|
|
|
22
22
|
if (!slug) return;
|
|
23
23
|
return `local:${workspaceKey(input.cwd ?? process.cwd())}:${slug}`;
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
//#region src/cli/chat.ts
|
|
25
|
+
// src/cli/chat.ts
|
|
27
26
|
/**
|
|
28
27
|
* Local chat CLI command.
|
|
29
28
|
*
|
|
@@ -99,11 +98,11 @@ async function loadLocalPluginSet() {
|
|
|
99
98
|
/** Configure plugin hooks after local chat has selected its state adapter. */
|
|
100
99
|
async function configureLocalChatPlugins(pluginSet) {
|
|
101
100
|
const [pluginsModule, agentHooksModule, catalogRuntimeModule, validationModule, databaseModule] = await Promise.all([
|
|
102
|
-
import("../plugins-
|
|
103
|
-
import("../agent-hooks-
|
|
104
|
-
import("../catalog-runtime-
|
|
105
|
-
import("../validation-
|
|
106
|
-
import("../viewer-
|
|
101
|
+
import("../plugins-DOm9Y6qI.js").then((n) => n.o),
|
|
102
|
+
import("../agent-hooks-BJ_5mlRH.js").then((n) => n.t),
|
|
103
|
+
import("../catalog-runtime-BN4DVxco.js").then((n) => n.t),
|
|
104
|
+
import("../validation-BHRxa5G4.js").then((n) => n.r),
|
|
105
|
+
import("../viewer-CGvvRqKp.js").then((n) => n.s)
|
|
107
106
|
]);
|
|
108
107
|
const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
|
|
109
108
|
const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
|
|
@@ -153,21 +152,21 @@ function localDevServerUrl() {
|
|
|
153
152
|
async function prepareLocalChatRun(io, pluginSet) {
|
|
154
153
|
defaultStateAdapterForLocalChat();
|
|
155
154
|
await configureLocalChatPlugins(pluginSet);
|
|
156
|
-
const { setExperimentalFeatures } = await import("../experimental-
|
|
155
|
+
const { setExperimentalFeatures } = await import("../experimental-BNK1l1jv.js").then((n) => n.t);
|
|
157
156
|
setExperimentalFeatures({ subagents: true });
|
|
158
|
-
const { setBriefsConfig } = await import("../agent-hooks-
|
|
157
|
+
const { setBriefsConfig } = await import("../agent-hooks-BJ_5mlRH.js").then((n) => n.m);
|
|
159
158
|
setBriefsConfig({ enabled: true });
|
|
160
|
-
const { runLocalAgentTurn } = await import("../runner-
|
|
161
|
-
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-
|
|
162
|
-
const { createLocalOAuthState } = await import("../oauth-relay-
|
|
163
|
-
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-
|
|
164
|
-
const { bindSpawnAgent } = await import("../spawn-
|
|
165
|
-
const { bindMessageAgent } = await import("../message-
|
|
166
|
-
const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-
|
|
167
|
-
const { startAgentInvocationsForChildInput } = await import("../result-
|
|
168
|
-
const { skipInputBeforeConversationStop } = await import("../session-stop-
|
|
169
|
-
const { createLocalConversationWork } = await import("../conversation-work-
|
|
170
|
-
const { processConversationWork } = await import("../worker-
|
|
159
|
+
const { runLocalAgentTurn } = await import("../runner-CCuqFSqx.js");
|
|
160
|
+
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-CDby-pCn.js");
|
|
161
|
+
const { createLocalOAuthState } = await import("../oauth-relay-CTygMkNx.js").then((n) => n.t);
|
|
162
|
+
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-DY1mbKF4.js");
|
|
163
|
+
const { bindSpawnAgent } = await import("../spawn-Dqfeo7XP.js").then((n) => n.n);
|
|
164
|
+
const { bindMessageAgent } = await import("../message-DyitL8no.js").then((n) => n.n);
|
|
165
|
+
const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-DRcsJ3hV.js").then((n) => n.a);
|
|
166
|
+
const { startAgentInvocationsForChildInput } = await import("../result-BBbKA61B.js").then((n) => n.r);
|
|
167
|
+
const { skipInputBeforeConversationStop } = await import("../session-stop-CIoFiwwe.js").then((n) => n.r);
|
|
168
|
+
const { createLocalConversationWork } = await import("../conversation-work-BaT_T6EB.js");
|
|
169
|
+
const { processConversationWork } = await import("../worker-Cjo-QqPq.js").then((n) => n.n);
|
|
171
170
|
let agentRunner;
|
|
172
171
|
const localConversationWork = createLocalConversationWork(async (message) => {
|
|
173
172
|
if (!agentRunner) throw new Error("Local agent runner is not ready");
|
|
@@ -280,5 +279,4 @@ async function runChat(argv, io = DEFAULT_IO, deps = {}) {
|
|
|
280
279
|
return 1;
|
|
281
280
|
}
|
|
282
281
|
}
|
|
283
|
-
//#endregion
|
|
284
282
|
export { CHAT_USAGE, runChat };
|
package/dist/cli/check.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
//#region src/cli/check.d.ts
|
|
2
1
|
export interface ValidationIo {
|
|
3
2
|
info: (line: string) => void;
|
|
4
3
|
warn: (line: string) => void;
|
|
5
4
|
error: (line: string) => void;
|
|
6
5
|
}
|
|
7
|
-
export declare function runCheck(rootDir?: string, io?: ValidationIo): Promise<void>;
|
|
8
|
-
//#endregion
|
|
6
|
+
export declare function runCheck(rootDir?: string, io?: ValidationIo): Promise<void>;
|
package/dist/cli/check.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { E as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, N as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, O as JUNIOR_HEARTBEAT_ROUTE } from "../logging-
|
|
2
|
-
import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-
|
|
3
|
-
import { i as parseSkillFile } from "../skills-
|
|
1
|
+
import { E as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, N as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, O as JUNIOR_HEARTBEAT_ROUTE } from "../logging-DsHONhVm.js";
|
|
2
|
+
import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-Du566MtJ.js";
|
|
3
|
+
import { i as parseSkillFile } from "../skills-DyQBLIrK.js";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import fs from "node:fs/promises";
|
|
6
6
|
import { pathToFileURL } from "node:url";
|
|
7
|
-
|
|
7
|
+
// src/cli/check.ts
|
|
8
8
|
const DEFAULT_IO = {
|
|
9
9
|
info: console.log,
|
|
10
10
|
warn: console.warn,
|
|
@@ -589,5 +589,4 @@ async function runCheck(rootDir = process.cwd(), io = DEFAULT_IO) {
|
|
|
589
589
|
}
|
|
590
590
|
io.info(`${formatHeading("ok", `Validation passed (${pluginSources.length} plugin manifest${pluginSources.length === 1 ? "" : "s"}, ${skillDirs.length} skill director${skillDirs.length === 1 ? "y" : "ies"} checked).`)}`);
|
|
591
591
|
}
|
|
592
|
-
//#endregion
|
|
593
592
|
export { runCheck };
|
package/dist/cli/env.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/cli/env.d.ts
|
|
2
1
|
export declare const JUNIOR_LOCAL_DEV_INTERNAL_SECRET = "junior-local-dev-internal";
|
|
3
2
|
export declare const JUNIOR_LOCAL_DEV_HEARTBEAT_SECRET = "junior-local-dev-heartbeat";
|
|
4
3
|
/** Apply global development defaults after env files have been loaded. */
|
|
@@ -9,5 +8,4 @@ export declare function applyJuniorDevelopmentDefaults(env: NodeJS.ProcessEnv, o
|
|
|
9
8
|
* Load CLI env files from the nearest package root and workspace root so
|
|
10
9
|
* `pnpm exec junior ...` sees the same credentials as local repo scripts.
|
|
11
10
|
*/
|
|
12
|
-
export declare function loadCliEnvFiles(cwd?: string): void;
|
|
13
|
-
//#endregion
|
|
11
|
+
export declare function loadCliEnvFiles(cwd?: string): void;
|
package/dist/cli/env.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import fs from "node:fs";
|
|
3
|
-
|
|
3
|
+
// src/cli/env.ts
|
|
4
4
|
function envFileNames(nodeEnv) {
|
|
5
5
|
return [
|
|
6
6
|
`.env.${nodeEnv}.local`,
|
|
@@ -59,5 +59,4 @@ function loadCliEnvFiles(cwd = process.cwd()) {
|
|
|
59
59
|
}
|
|
60
60
|
applyJuniorDevelopmentDefaults(process.env);
|
|
61
61
|
}
|
|
62
|
-
//#endregion
|
|
63
62
|
export { JUNIOR_LOCAL_DEV_HEARTBEAT_SECRET, JUNIOR_LOCAL_DEV_INTERNAL_SECRET, applyJuniorDevelopmentDefaults, loadCliEnvFiles };
|
package/dist/cli/init.d.ts
CHANGED
package/dist/cli/init.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { juniorVercelConfig } from "../vercel.js";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import fs from "node:fs";
|
|
4
|
-
|
|
4
|
+
// src/cli/init.ts
|
|
5
5
|
function writeServerEntry(targetDir) {
|
|
6
6
|
fs.writeFileSync(path.join(targetDir, "server.ts"), `import { initSentry } from "@sentry/junior/instrumentation";
|
|
7
7
|
|
|
@@ -16,6 +16,7 @@ const [
|
|
|
16
16
|
]);
|
|
17
17
|
|
|
18
18
|
const app = await createApp({
|
|
19
|
+
allowedDomains: ["example.com"],
|
|
19
20
|
briefs: { enabled: true },
|
|
20
21
|
plugins,
|
|
21
22
|
});
|
|
@@ -142,7 +143,7 @@ async function runInit(dir, log = console.log) {
|
|
|
142
143
|
"cross-env": "^10.1.0",
|
|
143
144
|
jiti: "^2.7.0",
|
|
144
145
|
nitro: "3.0.260522-beta",
|
|
145
|
-
typescript: "^
|
|
146
|
+
typescript: "^7.0.2"
|
|
146
147
|
}
|
|
147
148
|
};
|
|
148
149
|
fs.writeFileSync(path.join(target, "package.json"), `${JSON.stringify(pkg, null, 2)}\n`);
|
|
@@ -205,5 +206,4 @@ SENTRY_AUTH_TOKEN=
|
|
|
205
206
|
log(` cd ${targetDir} && pnpm install && pnpm dev`);
|
|
206
207
|
log("");
|
|
207
208
|
}
|
|
208
|
-
//#endregion
|
|
209
209
|
export { runInit };
|
package/dist/cli/main.d.ts
CHANGED
package/dist/cli/main.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { loadCliEnvFiles } from "./env.js";
|
|
2
2
|
import { runCli } from "./run.js";
|
|
3
3
|
import { pathToFileURL } from "node:url";
|
|
4
|
-
|
|
4
|
+
// src/cli/main.ts
|
|
5
5
|
const SENTRY_FLUSH_TIMEOUT_MS = 2e3;
|
|
6
6
|
async function flushSentry() {
|
|
7
|
-
await (await import("../sentry-
|
|
7
|
+
await (await import("../sentry-BBUlHih9.js").then((n) => n.u)).flush(SENTRY_FLUSH_TIMEOUT_MS);
|
|
8
8
|
}
|
|
9
9
|
async function initSentry() {
|
|
10
10
|
(await import("../instrumentation.js")).initSentry();
|
|
@@ -25,10 +25,10 @@ async function runChat(argv, pluginSet) {
|
|
|
25
25
|
return await (await import("./chat.js")).runChat(argv, void 0, { pluginSet });
|
|
26
26
|
}
|
|
27
27
|
async function runAdmin(argv) {
|
|
28
|
-
return await (await import("../admin-
|
|
28
|
+
return await (await import("../admin-My1SLGVO.js")).runAdmin(argv);
|
|
29
29
|
}
|
|
30
30
|
async function runBriefs(argv) {
|
|
31
|
-
return await (await import("../briefs-
|
|
31
|
+
return await (await import("../briefs-vYoK85rJ.js")).runBriefs(argv);
|
|
32
32
|
}
|
|
33
33
|
function topLevelCommand(argv) {
|
|
34
34
|
return (argv[0] === "--" ? argv.slice(1) : argv)[0];
|
|
@@ -66,5 +66,4 @@ if (isDirectCliEntry()) runMain(process.argv.slice(2)).catch((error) => {
|
|
|
66
66
|
process.exit(1);
|
|
67
67
|
})();
|
|
68
68
|
});
|
|
69
|
-
//#endregion
|
|
70
69
|
export { runMain };
|
package/dist/cli/plugins.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { n as JuniorPluginSet } from "../plugins-
|
|
1
|
+
import { n as JuniorPluginSet } from "../plugins-B11Mfkmv.js";
|
|
2
2
|
import { PluginCliIo } from "@sentry/junior-plugin-api";
|
|
3
|
-
//#region src/cli/plugins.d.ts
|
|
4
3
|
export type PluginCommandIo = PluginCliIo;
|
|
5
4
|
export interface CliPluginCommandDispatcher {
|
|
6
5
|
commandNames: string[];
|
|
@@ -9,5 +8,4 @@ export interface CliPluginCommandDispatcher {
|
|
|
9
8
|
/** Load the app plugin set once for one CLI process. */
|
|
10
9
|
export declare function loadCliPluginSet(): Promise<JuniorPluginSet | undefined>;
|
|
11
10
|
/** Import configured app plugins and build the plugin CLI command dispatcher. */
|
|
12
|
-
export declare function loadCliPluginCommands(pluginSet?: JuniorPluginSet | null): Promise<CliPluginCommandDispatcher>;
|
|
13
|
-
//#endregion
|
|
11
|
+
export declare function loadCliPluginCommands(pluginSet?: JuniorPluginSet | null): Promise<CliPluginCommandDispatcher>;
|
package/dist/cli/plugins.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as pluginCatalogRuntime } from "../catalog-runtime-
|
|
3
|
-
import { d as setPlugins, f as validatePlugins, ft as createPluginLogger } from "../agent-hooks-
|
|
4
|
-
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-
|
|
5
|
-
import { a as pluginRuntimeRegistrationsFromPluginSet, i as pluginCliRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "../plugins-
|
|
6
|
-
import { t as loadAppPluginSet } from "../plugin-module-
|
|
1
|
+
import { d as getDb } from "../viewer-CGvvRqKp.js";
|
|
2
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime-BN4DVxco.js";
|
|
3
|
+
import { d as setPlugins, f as validatePlugins, ft as createPluginLogger } from "../agent-hooks-BJ_5mlRH.js";
|
|
4
|
+
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-BHRxa5G4.js";
|
|
5
|
+
import { a as pluginRuntimeRegistrationsFromPluginSet, i as pluginCliRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "../plugins-DOm9Y6qI.js";
|
|
6
|
+
import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
|
|
7
7
|
import { stderr, stdout } from "node:process";
|
|
8
8
|
import { createJiti } from "jiti";
|
|
9
9
|
import { Command, CommanderError } from "commander";
|
|
10
|
-
|
|
10
|
+
// src/cli/plugins.ts
|
|
11
11
|
/**
|
|
12
12
|
* Plugin CLI bootstrap for the local/package command line.
|
|
13
13
|
* This module imports app plugins, validates top-level namespaces before
|
|
@@ -168,5 +168,4 @@ async function loadCliPluginCommands(pluginSet) {
|
|
|
168
168
|
}
|
|
169
169
|
};
|
|
170
170
|
}
|
|
171
|
-
//#endregion
|
|
172
171
|
export { loadCliPluginCommands, loadCliPluginSet };
|
package/dist/cli/run.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/cli/run.d.ts
|
|
2
1
|
export declare const CLI_USAGE = "usage: junior init <dir>\n junior admin list|grant <email>|revoke <email>\n junior snapshot create\n junior check [dir]\n junior upgrade\n junior chat\n junior chat -p <message>\n junior briefs pull <conversationId...> --base-url <url> [--token <token>] --out <dir>\n junior briefs run <snapshot...> [--model <id>] [--prompt <file>] [--turn-by-turn] [--out <dir>]";
|
|
3
2
|
interface CliHandlers {
|
|
4
3
|
runAdmin: (argv: string[]) => Promise<number>;
|
|
@@ -15,4 +14,4 @@ interface CliIo {
|
|
|
15
14
|
}
|
|
16
15
|
/** Dispatch CLI arguments to command handlers and return a process exit code. */
|
|
17
16
|
export declare function runCli(argv: string[], handlers: CliHandlers, io?: CliIo): Promise<number>;
|
|
18
|
-
|
|
17
|
+
export {};
|
package/dist/cli/run.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/cli/run.ts
|
|
2
2
|
const CLI_USAGE = "usage: junior init <dir>\n junior admin list|grant <email>|revoke <email>\n junior snapshot create\n junior check [dir]\n junior upgrade\n junior chat\n junior chat -p <message>\n junior briefs pull <conversationId...> --base-url <url> [--token <token>] --out <dir>\n junior briefs run <snapshot...> [--model <id>] [--prompt <file>] [--turn-by-turn] [--out <dir>]";
|
|
3
3
|
const DEFAULT_IO = { error: console.error };
|
|
4
4
|
/** Strip Node's leading argv separator while preserving command-level flags. */
|
|
@@ -50,5 +50,4 @@ async function runCli(argv, handlers, io = DEFAULT_IO) {
|
|
|
50
50
|
io.error(CLI_USAGE);
|
|
51
51
|
return 1;
|
|
52
52
|
}
|
|
53
|
-
//#endregion
|
|
54
53
|
export { CLI_USAGE, runCli };
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
//#region src/cli/snapshot-create.d.ts
|
|
2
1
|
/** Resolve or create the default sandbox snapshot and report its progress. */
|
|
3
|
-
export declare function runSnapshotCreate(log?: (line: string) => void): Promise<void>;
|
|
4
|
-
//#endregion
|
|
2
|
+
export declare function runSnapshotCreate(log?: (line: string) => void): Promise<void>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as pluginCatalogRuntime } from "../catalog-runtime-
|
|
2
|
-
import { S as disconnectStateAdapter, t as create } from "../profile-
|
|
3
|
-
import { r as resolve } from "../resolve-
|
|
4
|
-
|
|
1
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime-BN4DVxco.js";
|
|
2
|
+
import { S as disconnectStateAdapter, t as create } from "../profile-DpYjfKke.js";
|
|
3
|
+
import { r as resolve } from "../resolve-ClCIgh8E.js";
|
|
4
|
+
// src/cli/snapshot-create.ts
|
|
5
5
|
const DEFAULT_RUNTIME = "node22";
|
|
6
6
|
const DEFAULT_TIMEOUT_MS = 6e5;
|
|
7
7
|
function progressMessage(phase) {
|
|
@@ -75,5 +75,4 @@ async function runSnapshotCreate(log = console.log) {
|
|
|
75
75
|
await disconnectStateAdapter();
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
//#endregion
|
|
79
78
|
export { runSnapshotCreate };
|
package/dist/cli/upgrade.d.ts
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import "../db-
|
|
2
|
-
import { n as JuniorPluginSet } from "../plugins-
|
|
3
|
-
//#region src/cli/upgrade/types.d.ts
|
|
1
|
+
import "../db-BnRqQ7G5.js";
|
|
2
|
+
import { n as JuniorPluginSet } from "../plugins-B11Mfkmv.js";
|
|
4
3
|
interface UpgradeIo {
|
|
5
4
|
info: (line: string) => void;
|
|
6
5
|
}
|
|
7
|
-
//#endregion
|
|
8
|
-
//#region src/cli/upgrade.d.ts
|
|
9
6
|
/** Resolve the plugin set available to upgrade migrations in source and built CLI runs. */
|
|
10
7
|
export declare function resolveUpgradePluginSet(): Promise<JuniorPluginSet | undefined>;
|
|
11
8
|
/** Apply Junior and enabled-plugin database migrations. */
|
|
12
9
|
export declare function runUpgrade(io?: UpgradeIo, options?: {
|
|
13
10
|
pluginSet?: JuniorPluginSet | null;
|
|
14
11
|
}): Promise<void>;
|
|
15
|
-
|
|
12
|
+
export {};
|
package/dist/cli/upgrade.js
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import { i as getChatConfig } from "../config-
|
|
2
|
-
import { t as createJuniorSqlExecutor } from "../executor-
|
|
3
|
-
import { t as createPluginCatalogRuntime } from "../registry-
|
|
4
|
-
import { n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "../plugins-
|
|
5
|
-
import { t as loadAppPluginSet } from "../plugin-module-
|
|
1
|
+
import { i as getChatConfig } from "../config-_WO_AjCB.js";
|
|
2
|
+
import { t as createJuniorSqlExecutor } from "../executor-RvG6kVe1.js";
|
|
3
|
+
import { t as createPluginCatalogRuntime } from "../registry-Du566MtJ.js";
|
|
4
|
+
import { n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "../plugins-DOm9Y6qI.js";
|
|
5
|
+
import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
|
|
6
6
|
import { basename, dirname, join, resolve } from "node:path";
|
|
7
7
|
import { createHash } from "node:crypto";
|
|
8
8
|
import { fileURLToPath } from "node:url";
|
|
9
9
|
import { createJiti } from "jiti";
|
|
10
10
|
import { readMigrationFiles } from "drizzle-orm/migrator";
|
|
11
|
-
|
|
11
|
+
// src/db/postgres-error.ts
|
|
12
12
|
/** Return whether an unknown PostgreSQL failure has the requested SQLSTATE. */
|
|
13
13
|
function isPostgresErrorCode(error, code) {
|
|
14
14
|
return typeof error === "object" && error !== null && "code" in error && error.code === code;
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
//#region src/chat/conversations/sql/migrations.ts
|
|
16
|
+
// src/chat/conversations/sql/migrations.ts
|
|
18
17
|
/** SQL schema migrations for durable Junior records. */
|
|
19
18
|
const CORE_MIGRATION_BRIDGE_VERSION = "0.107.1";
|
|
20
19
|
const MIGRATIONS_TABLE = "__drizzle_junior_core";
|
|
@@ -87,8 +86,7 @@ async function migrateSchema(executor) {
|
|
|
87
86
|
return migrationResult(migrations, lockedState);
|
|
88
87
|
});
|
|
89
88
|
}
|
|
90
|
-
|
|
91
|
-
//#region src/chat/plugins/migrations.ts
|
|
89
|
+
// src/chat/plugins/migrations.ts
|
|
92
90
|
function migrationTable(pluginName) {
|
|
93
91
|
return `__drizzle_${pluginName.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "").slice(0, 32)}_${createHash("sha256").update(pluginName).digest("hex").slice(0, 8)}`;
|
|
94
92
|
}
|
|
@@ -192,8 +190,7 @@ async function migratePluginSchemas(executor, roots, options = {}) {
|
|
|
192
190
|
}
|
|
193
191
|
return result;
|
|
194
192
|
}
|
|
195
|
-
|
|
196
|
-
//#region src/cli/upgrade/migrations/upgrade-plugins.ts
|
|
193
|
+
// src/cli/upgrade/migrations/upgrade-plugins.ts
|
|
197
194
|
function unique(values) {
|
|
198
195
|
return [...new Set(values)];
|
|
199
196
|
}
|
|
@@ -238,16 +235,14 @@ async function resolveUpgradePluginCatalog(context) {
|
|
|
238
235
|
const pluginSet = packageNames.length > 0 || registrations.length > 0 || context.pluginSet ? defineJuniorPlugins([...packageNames, ...registrations], manifests ? { manifests } : {}) : void 0;
|
|
239
236
|
return mergeCatalogConfig(catalog, pluginCatalogConfigFromPluginSet(pluginSet));
|
|
240
237
|
}
|
|
241
|
-
|
|
242
|
-
//#region src/cli/upgrade/migrations/plugin-sql.ts
|
|
238
|
+
// src/cli/upgrade/migrations/plugin-sql.ts
|
|
243
239
|
/** Apply SQL schema migrations owned by explicitly enabled plugins. */
|
|
244
240
|
async function migratePluginsToSql(context, options = {}) {
|
|
245
241
|
const pluginCatalog = createPluginCatalogRuntime();
|
|
246
242
|
pluginCatalog.setConfig(await resolveUpgradePluginCatalog(context));
|
|
247
243
|
return await migratePluginSchemas(context.sqlExecutor, pluginCatalog.getMigrationRoots(), options);
|
|
248
244
|
}
|
|
249
|
-
|
|
250
|
-
//#region src/cli/upgrade.ts
|
|
245
|
+
// src/cli/upgrade.ts
|
|
251
246
|
/**
|
|
252
247
|
* SQL-only upgrade entry point.
|
|
253
248
|
*
|
|
@@ -309,5 +304,4 @@ async function runUpgrade(io = DEFAULT_IO, options = {}) {
|
|
|
309
304
|
await sqlExecutor.close();
|
|
310
305
|
}
|
|
311
306
|
}
|
|
312
|
-
//#endregion
|
|
313
307
|
export { resolveUpgradePluginSet, runUpgrade };
|