@sentry/junior 0.302.0 → 0.304.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/{adapter-context-Cx9fn9B3.js → adapter-context-B1IpoELr.js} +2 -2
- package/dist/{admin-_poE5NKL.js → admin-BnVFGo_z.js} +5 -5
- package/dist/{agent-runner-CY9RvsTX.js → agent-runner-CoEeZSRh.js} +1461 -1248
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +6 -6
- package/dist/api.d.ts +13 -12
- package/dist/api.js +230 -105
- package/dist/{app-BpY3wtRP.d.ts → app-Cs157Zc5.d.ts} +17 -15
- package/dist/app.d.ts +1 -1
- package/dist/app.js +108 -96
- package/dist/{automation-Cva5ZOwW.js → automation-CuA3yEcD.js} +3 -1
- package/dist/{background-compaction-queue-CXFq1_Cz.js → background-compaction-queue-WLPNSF_b.js} +6 -6
- package/dist/{briefs-B3NG-pid.js → briefs-CagVVefw.js} +12 -9
- package/dist/{catalog-runtime-Dss0lSV6.js → catalog-runtime-B8ZXvXWm.js} +2 -2
- package/dist/cli/chat.d.ts +1 -1
- package/dist/cli/chat.js +21 -21
- package/dist/cli/check.js +10 -10
- package/dist/cli/env.d.ts +1 -0
- package/dist/cli/env.js +8 -7
- package/dist/cli/init.js +13 -4
- package/dist/cli/main.js +4 -4
- package/dist/cli/plugins.js +6 -6
- package/dist/cli/snapshot-create.js +7 -5
- package/dist/cli/upgrade.d.ts +2 -2
- package/dist/cli/upgrade.js +6 -6
- package/dist/{config-CzeZiMKs.js → config-DdO1BNcw.js} +142 -67
- package/dist/{connections-CDYhMfrs.js → connections-D20kp0j5.js} +6 -6
- package/dist/{continue-in-slack-7Uf05ndC.js → continue-in-slack-BKEVMBj1.js} +8 -8
- package/dist/{conversation-BNXfq6Lb.js → conversation-BOqdRtUx.js} +4 -12
- package/dist/{conversation-feed-Clf_cv0n.js → conversation-feed-CgpgP7yi.js} +35 -2
- package/dist/{conversation-privacy-D9xnM5mK.js → conversation-privacy-L1SK_v0V.js} +16 -8
- package/dist/{conversation-turn-D7SEZgTG.js → conversation-turn-BptVJylj.js} +20 -23
- package/dist/{credential-sync-DoD0gW-j.js → credential-sync-D1J1CGzL.js} +19 -19
- package/dist/{db-B-gtnNjr.js → db-EKJnkrIb.js} +180 -17
- package/dist/{db-BdsCzytP.d.ts → db-zbN5ZV_o.d.ts} +26 -26
- package/dist/{executor-DZg20EqU.js → executor-CoIZmFK8.js} +55 -15
- package/dist/{history-IjdmO_r6.js → history-m2-ceTTX.js} +21 -12
- package/dist/{install-t1KQyTUs.js → install-BT2Pf6HP.js} +3 -3
- package/dist/instrumentation.d.ts +4 -4
- package/dist/instrumentation.js +15 -11
- package/dist/{lineage-C79GjoQr.js → lineage-C5DGQCS_.js} +2 -2
- package/dist/{logging-C9oDAg4M.js → logging-QSZuMcvo.js} +19 -19
- package/dist/{message-BLUCzJXN.js → message-TtxftRHj.js} +9 -9
- package/dist/{model-input-5jwNC45G.js → model-input-BHXfA29g.js} +4 -9
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +8 -8
- package/dist/{oauth-callback-server-BBl66vCb.js → oauth-callback-server-B0enqHtZ.js} +5 -4
- package/dist/{oauth-relay-DRzq73b6.js → oauth-relay-DAmfVmJu.js} +3 -6
- package/dist/{package-discovery-DJhGdS4c.js → package-discovery-x4AvVhMj.js} +1 -1
- package/dist/{plugin-module-Cf5gVPWP.js → plugin-module-Cv2ETe8Y.js} +1 -1
- package/dist/{plugins-BBX07Jzt.js → plugins-Bkk0XRo2.js} +3 -3
- package/dist/{projection-CIBwgD3s.js → projection-CNKK7doO.js} +755 -221
- package/dist/{prompt-CRQbzp5e.js → prompt-DSjhoKu5.js} +185 -12
- package/dist/{queue-DtCDaIct.js → queue-CDxkit82.js} +4 -4
- package/dist/{queue-CZyYgPF0.d.ts → queue-CbEHUO0l.d.ts} +1 -1
- package/dist/{registry-DdFQHZ_d.js → registry-DBDNUUmz.js} +37 -37
- package/dist/{resolve-CdW4BdrK.js → resolve-CQLhMWSu.js} +3 -3
- package/dist/{result-oOMv1t4O.js → result-B-pauj42.js} +10 -15
- package/dist/rolldown-runtime-BKpuH2hG.js +26 -0
- package/dist/{runner-DqitLtm-.js → runner-B3KxKks5.js} +10 -10
- package/dist/{sandbox-egress-signals-Bw9I0yfJ.js → sandbox-egress-signals-DJJX9ClG.js} +1 -1
- package/dist/{schema-DnVQepWP.js → schema-Bx0Mlo32.js} +77 -13
- package/dist/{schema-BIFM-U1a.d.ts → schema-CKcu-IK6.d.ts} +562 -23
- package/dist/{secrets-DebYU866.js → secrets-DHaJ5TTn.js} +4 -4
- package/dist/{sentry-BRTJqumy.js → sentry-CPbZjomA.js} +3 -28
- package/dist/{sentry-route-name-BhwWnfqj.js → sentry-route-name-C6EIzAGP.js} +1 -1
- package/dist/{service-account-CrZftRTb.js → service-account-2HmlNPvy.js} +49 -48
- package/dist/{service-account-B6mKAPVo.js → service-account-DQLqkSVv.js} +5 -5
- package/dist/{session-stop-DW63Z3kj.js → session-stop-DEeZKqbX.js} +132 -74
- package/dist/{skills-C16fz60Z.js → skills-2UrD7JkN.js} +6 -9
- package/dist/{slack-conversation-unfurl-BHhefEb7.js → slack-conversation-unfurl-Dd129Uov.js} +14 -18
- package/dist/{spawn-D_RnFYfy.js → spawn-eMho9HDJ.js} +7 -7
- package/dist/{legacy-web-actor-id-C-cEeWqL.js → state-Bveuc4Zh.js} +32 -32
- package/dist/{stop-7p1i08CY.js → stop-D_ltJLDS.js} +359 -171
- package/dist/{store-C28I0CVW.js → store-COeYnPL_.js} +5 -5
- package/dist/{task-queue-BVUJbQ28.js → task-queue-CBIDXZpV.js} +3 -3
- package/dist/{task-runner-CWi8j7Z6.js → task-runner-CJF7zIJL.js} +15 -18
- package/dist/{thread-context-D3-yYUd0.js → thread-context-Cg0jt0aE.js} +12 -12
- package/dist/{turn-session-routing-BFMS9ATF.js → turn-session-routing-CaY3Tp8m.js} +32 -32
- package/dist/{turn-user-message-C3-O8Omt.js → turn-user-message-tcom1RYd.js} +3 -3
- package/dist/{validation-BSFKUIb4.js → validation-EU91JwIT.js} +2 -2
- package/dist/vercel.js +1 -1
- package/dist/{version-BHHXNi-0.js → version-BYRPhY5G.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-B1SO21Qa.js → viewer-Cf8ISkAc.js} +3 -3
- package/dist/{warmup-Bz9bzkzN.js → warmup-TgY4S1vx.js} +202 -577
- package/dist/{worker-BspReIIK.js → worker-C6Uq4OKD.js} +9 -12
- package/migrations/0109_user_preferences.sql +1 -0
- package/migrations/0110_code_change_repository_state_index.sql +1 -0
- package/migrations/0111_attachment_kinds.sql +14 -0
- package/migrations/0112_attachment_url_fill.sql +51 -0
- package/migrations/0113_attachment_url_index.sql +1 -0
- package/migrations/meta/0099_snapshot.json +102 -326
- package/migrations/meta/0109_snapshot.json +4925 -0
- package/migrations/meta/0110_snapshot.json +4952 -0
- package/migrations/meta/0111_snapshot.json +5011 -0
- package/migrations/meta/0112_snapshot.json +5011 -0
- package/migrations/meta/0113_snapshot.json +5033 -0
- package/migrations/meta/_journal.json +36 -1
- package/package.json +16 -19
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Q as briefResourceLabel, Y as briefCodeChangeSchema, et as parseBriefInput, f as conversationEventPageSchema, u as conversationDetailReportSchema } from "./conversation-BOqdRtUx.js";
|
|
2
|
+
import { l as completeObject, n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-DSjhoKu5.js";
|
|
3
3
|
import { CLI_USAGE } from "./cli/run.js";
|
|
4
4
|
import * as z from "zod";
|
|
5
5
|
import path from "node:path";
|
|
@@ -71,7 +71,7 @@ function renderBriefMarkdown(args) {
|
|
|
71
71
|
"",
|
|
72
72
|
list(brief.decisions.filter((decision) => decision.kind === "confirmed").map((decision) => `${decision.text}${decision.by ? ` — ${decision.by}` : ""}`), "None."),
|
|
73
73
|
"",
|
|
74
|
-
"### Assumed
|
|
74
|
+
"### Assumed (not confirmed)",
|
|
75
75
|
"",
|
|
76
76
|
list(brief.decisions.filter((decision) => decision.kind === "assumed").map((decision) => `${decision.text}${decision.by ? ` — ${decision.by}` : ""}`), "None."),
|
|
77
77
|
"",
|
|
@@ -202,7 +202,7 @@ function optionValue(argv, index, option) {
|
|
|
202
202
|
function parsePullOptions(argv) {
|
|
203
203
|
const conversationIds = [];
|
|
204
204
|
let baseUrl;
|
|
205
|
-
let token = process.env
|
|
205
|
+
let token = process.env["JUNIOR_API_TOKEN"]?.trim();
|
|
206
206
|
let out;
|
|
207
207
|
for (let index = 0; index < argv.length; index += 1) {
|
|
208
208
|
const argument = argv[index];
|
|
@@ -248,8 +248,10 @@ async function parseRunOptions(argv) {
|
|
|
248
248
|
else snapshots.push(argument);
|
|
249
249
|
}
|
|
250
250
|
if (snapshots.length === 0) throw new Error(CLI_USAGE);
|
|
251
|
+
const bot = await configuredBot();
|
|
251
252
|
return {
|
|
252
|
-
|
|
253
|
+
assistantName: bot.userName,
|
|
254
|
+
model: model ?? bot.fastModelId,
|
|
253
255
|
out,
|
|
254
256
|
promptFile,
|
|
255
257
|
snapshots,
|
|
@@ -257,13 +259,13 @@ async function parseRunOptions(argv) {
|
|
|
257
259
|
};
|
|
258
260
|
}
|
|
259
261
|
/**
|
|
260
|
-
* Read the production
|
|
262
|
+
* Read the production bot config only when a run needs it. `chat/config`
|
|
261
263
|
* reads `DATABASE_URL` at import, and `briefs pull` must work with only a
|
|
262
264
|
* token.
|
|
263
265
|
*/
|
|
264
|
-
async function
|
|
265
|
-
const { botConfig } = await import("./config-
|
|
266
|
-
return botConfig
|
|
266
|
+
async function configuredBot() {
|
|
267
|
+
const { botConfig } = await import("./config-DdO1BNcw.js").then((n) => n.r);
|
|
268
|
+
return botConfig;
|
|
267
269
|
}
|
|
268
270
|
function apiUrl(baseUrl, pathname) {
|
|
269
271
|
const base = new URL(baseUrl);
|
|
@@ -332,6 +334,7 @@ async function runSnapshot(snapshotPath, options, prompt) {
|
|
|
332
334
|
const input = briefInputFromSnapshot(snapshot, finalThroughIndex);
|
|
333
335
|
const versions = [];
|
|
334
336
|
for (const throughIndex of generationIndexes(snapshot, options.turnByTurn, finalThroughIndex)) versions.push(await generateBrief({
|
|
337
|
+
assistantName: options.assistantName,
|
|
335
338
|
completeObject: (request) => completeObject({
|
|
336
339
|
...request,
|
|
337
340
|
modelId: options.model,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as createPluginCatalogRuntime } from "./registry-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
|
+
import { t as createPluginCatalogRuntime } from "./registry-DBDNUUmz.js";
|
|
3
3
|
// src/chat/plugins/catalog-runtime.ts
|
|
4
4
|
var catalog_runtime_exports = /* @__PURE__ */ __exportAll({ pluginCatalogRuntime: () => pluginCatalogRuntime });
|
|
5
5
|
const pluginCatalogRuntime = createPluginCatalogRuntime();
|
package/dist/cli/chat.d.ts
CHANGED
package/dist/cli/chat.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
1
|
+
import { t as loadAppPluginSet } from "../plugin-module-Cv2ETe8Y.js";
|
|
2
|
+
import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-CoEeZSRh.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";
|
|
@@ -88,8 +88,8 @@ function writeStream(stream, text) {
|
|
|
88
88
|
}
|
|
89
89
|
/** Keep local chat ephemeral by default; Redis is opt-in via an explicit adapter. */
|
|
90
90
|
function defaultStateAdapterForLocalChat() {
|
|
91
|
-
if (process.env
|
|
92
|
-
process.env
|
|
91
|
+
if (process.env["JUNIOR_STATE_ADAPTER"]) return;
|
|
92
|
+
process.env["JUNIOR_STATE_ADAPTER"] = "memory";
|
|
93
93
|
}
|
|
94
94
|
/** Load the app plugin module so source-mode local chat matches server wiring. */
|
|
95
95
|
async function loadLocalPluginSet() {
|
|
@@ -98,11 +98,11 @@ async function loadLocalPluginSet() {
|
|
|
98
98
|
/** Configure plugin hooks after local chat has selected its state adapter. */
|
|
99
99
|
async function configureLocalChatPlugins(pluginSet) {
|
|
100
100
|
const [pluginsModule, agentHooksModule, catalogRuntimeModule, validationModule, databaseModule] = await Promise.all([
|
|
101
|
-
import("../plugins-
|
|
102
|
-
import("../projection-
|
|
103
|
-
import("../catalog-runtime-
|
|
104
|
-
import("../validation-
|
|
105
|
-
import("../db-
|
|
101
|
+
import("../plugins-Bkk0XRo2.js").then((n) => n.o),
|
|
102
|
+
import("../projection-CNKK7doO.js").then((n) => n.Qn),
|
|
103
|
+
import("../catalog-runtime-B8ZXvXWm.js").then((n) => n.t),
|
|
104
|
+
import("../validation-EU91JwIT.js").then((n) => n.r),
|
|
105
|
+
import("../db-EKJnkrIb.js").then((n) => n.n)
|
|
106
106
|
]);
|
|
107
107
|
const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
|
|
108
108
|
const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
|
|
@@ -146,25 +146,25 @@ function newRunConversationId() {
|
|
|
146
146
|
return conversationId;
|
|
147
147
|
}
|
|
148
148
|
function localDevServerUrl() {
|
|
149
|
-
return `http://127.0.0.1:${process.env
|
|
149
|
+
return `http://127.0.0.1:${process.env["PORT"]?.trim() || "3000"}`;
|
|
150
150
|
}
|
|
151
151
|
/** Wire the shared local-turn setup so prompt and interactive runs stay identical. */
|
|
152
152
|
async function prepareLocalChatRun(io, pluginSet) {
|
|
153
153
|
defaultStateAdapterForLocalChat();
|
|
154
154
|
await configureLocalChatPlugins(pluginSet);
|
|
155
|
-
const { setBriefsConfig } = await import("../projection-
|
|
155
|
+
const { setBriefsConfig } = await import("../projection-CNKK7doO.js").then((n) => n.pr);
|
|
156
156
|
setBriefsConfig({ enabled: true });
|
|
157
|
-
const { runLocalAgentTurn } = await import("../runner-
|
|
158
|
-
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-
|
|
159
|
-
const { createLocalOAuthState } = await import("../oauth-relay-
|
|
160
|
-
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-
|
|
161
|
-
const { bindSpawnAgent } = await import("../spawn-
|
|
162
|
-
const { bindMessageAgent } = await import("../message-
|
|
163
|
-
const { createChildConversationWorker, createDeliverToParent } = await import("../result-
|
|
164
|
-
const { createConversationTurnWorker } = await import("../conversation-turn-
|
|
165
|
-
const { skipInputAfterConversationStop } = await import("../session-stop-
|
|
157
|
+
const { runLocalAgentTurn } = await import("../runner-B3KxKks5.js");
|
|
158
|
+
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-B0enqHtZ.js");
|
|
159
|
+
const { createLocalOAuthState } = await import("../oauth-relay-DAmfVmJu.js").then((n) => n.t);
|
|
160
|
+
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-DJJX9ClG.js");
|
|
161
|
+
const { bindSpawnAgent } = await import("../spawn-eMho9HDJ.js").then((n) => n.n);
|
|
162
|
+
const { bindMessageAgent } = await import("../message-TtxftRHj.js").then((n) => n.n);
|
|
163
|
+
const { createChildConversationWorker, createDeliverToParent } = await import("../result-B-pauj42.js").then((n) => n.o);
|
|
164
|
+
const { createConversationTurnWorker } = await import("../conversation-turn-BptVJylj.js").then((n) => n.t);
|
|
165
|
+
const { skipInputAfterConversationStop } = await import("../session-stop-DEeZKqbX.js").then((n) => n.a);
|
|
166
166
|
const { createLocalConversationWork } = await import("../conversation-work-BaT_T6EB.js");
|
|
167
|
-
const { processConversationWork } = await import("../worker-
|
|
167
|
+
const { processConversationWork } = await import("../worker-C6Uq4OKD.js").then((n) => n.n);
|
|
168
168
|
let agentRunner;
|
|
169
169
|
const localConversationWork = createLocalConversationWork(async (message) => {
|
|
170
170
|
if (!agentRunner) throw new Error("Local agent runner is not ready");
|
package/dist/cli/check.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { i as parseSkillFile } from "../skills-2UrD7JkN.js";
|
|
2
|
+
import { N as JUNIOR_HEARTBEAT_ROUTE, R as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, j as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-QSZuMcvo.js";
|
|
3
|
+
import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-DBDNUUmz.js";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import fs from "node:fs/promises";
|
|
6
6
|
import { pathToFileURL } from "node:url";
|
|
@@ -20,8 +20,8 @@ const ANSI = {
|
|
|
20
20
|
cyan: "\x1B[36m"
|
|
21
21
|
};
|
|
22
22
|
function supportsColor(stream) {
|
|
23
|
-
if (process.env
|
|
24
|
-
if (process.env
|
|
23
|
+
if (process.env["NO_COLOR"] !== void 0) return false;
|
|
24
|
+
if (process.env["FORCE_COLOR"] && process.env["FORCE_COLOR"] !== "0") return true;
|
|
25
25
|
return Boolean(stream?.isTTY);
|
|
26
26
|
}
|
|
27
27
|
const COLOR_ENABLED = supportsColor(process.stdout) || supportsColor(process.stderr);
|
|
@@ -207,7 +207,7 @@ function isPluginFactoryExport(name, value) {
|
|
|
207
207
|
return typeof value === "function" && (name === "default" || name.endsWith("Plugin"));
|
|
208
208
|
}
|
|
209
209
|
function isPluginRegistrationLike(value) {
|
|
210
|
-
return isRecord(value) && isRecord(value
|
|
210
|
+
return isRecord(value) && isRecord(value["manifest"]);
|
|
211
211
|
}
|
|
212
212
|
async function collectPackageJsPluginSources(packageDir, packageName) {
|
|
213
213
|
const entryPath = await resolvePackageEntryPath(packageDir);
|
|
@@ -383,7 +383,7 @@ async function validateDeploymentConfig(rootDir, packages) {
|
|
|
383
383
|
const hasJuniorMarkers = await hasJuniorDeploymentMarkers(rootDir, packages, nitroConfig);
|
|
384
384
|
if (nitroConfig !== void 0 && hasJuniorMarkers) {
|
|
385
385
|
checked = true;
|
|
386
|
-
if (!/\bjuniorNitro\s*\(/.test(nitroConfig)) errors.push(`${nitroConfigPath}: missing juniorNitro(). The Nitro module emits
|
|
386
|
+
if (!/\bjuniorNitro\s*\(/.test(nitroConfig)) errors.push(`${nitroConfigPath}: missing juniorNitro(). The Nitro module emits the Vercel queue trigger and heartbeat cron into the deployed build output.`);
|
|
387
387
|
}
|
|
388
388
|
const vercelConfigPath = path.join(rootDir, "vercel.json");
|
|
389
389
|
const vercelConfigText = await readTextFile(vercelConfigPath);
|
|
@@ -411,7 +411,7 @@ async function validateDeploymentConfig(rootDir, packages) {
|
|
|
411
411
|
}
|
|
412
412
|
if (hasJuniorMarkers && vercelConfig.framework !== void 0 && vercelConfig.framework !== "nitro") {
|
|
413
413
|
checked = true;
|
|
414
|
-
errors.push(`${vercelConfigPath}: framework must be "nitro" for
|
|
414
|
+
errors.push(`${vercelConfigPath}: framework must be "nitro" for the Vercel deployment wiring.`);
|
|
415
415
|
}
|
|
416
416
|
if (isRecord(vercelConfig.functions)) {
|
|
417
417
|
if (vercelConfig.functions["api/internal/agent/continue.ts"] !== void 0) {
|
|
@@ -420,7 +420,7 @@ async function validateDeploymentConfig(rootDir, packages) {
|
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
422
|
if (hasJuniorMarkers && Array.isArray(vercelConfig.crons)) {
|
|
423
|
-
if (vercelConfig.crons.some((cron) => isRecord(cron) && cron
|
|
423
|
+
if (vercelConfig.crons.some((cron) => isRecord(cron) && cron["path"] === "/api/internal/heartbeat")) {
|
|
424
424
|
checked = true;
|
|
425
425
|
warnings.push(`${vercelConfigPath}: ${JUNIOR_HEARTBEAT_ROUTE} cron is now emitted by juniorNitro() into Nitro's Vercel Build Output config. Remove the root cron entry to avoid deployment drift.`);
|
|
426
426
|
}
|
|
@@ -587,6 +587,6 @@ async function runCheck(rootDir = process.cwd(), io = DEFAULT_IO) {
|
|
|
587
587
|
for (const error of errors) io.error(`${statusIcon("error")} error: ${error}`);
|
|
588
588
|
throw new Error(`Validation failed (${errors.length} error${errors.length === 1 ? "" : "s"}, ${pluginSources.length} plugin manifest${pluginSources.length === 1 ? "" : "s"}, ${skillDirs.length} skill director${skillDirs.length === 1 ? "y" : "ies"} checked).`);
|
|
589
589
|
}
|
|
590
|
-
io.info(
|
|
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
592
|
export { runCheck };
|
package/dist/cli/env.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export declare const JUNIOR_LOCAL_DEV_HEARTBEAT_SECRET = "junior-local-dev-heart
|
|
|
3
3
|
/** Apply global development defaults after env files have been loaded. */
|
|
4
4
|
export declare function applyJuniorDevelopmentDefaults(env: NodeJS.ProcessEnv, options?: {
|
|
5
5
|
baseUrl?: string;
|
|
6
|
+
vercelDeployment?: boolean;
|
|
6
7
|
}): void;
|
|
7
8
|
/**
|
|
8
9
|
* Load CLI env files from the nearest package root and workspace root so
|
package/dist/cli/env.js
CHANGED
|
@@ -17,12 +17,12 @@ function hasValue(value) {
|
|
|
17
17
|
}
|
|
18
18
|
/** Apply global development defaults after env files have been loaded. */
|
|
19
19
|
function applyJuniorDevelopmentDefaults(env, options = {}) {
|
|
20
|
-
if ((env
|
|
21
|
-
if (!hasValue(env
|
|
22
|
-
if (!hasValue(env
|
|
23
|
-
if (!hasValue(env
|
|
20
|
+
if ((env["NODE_ENV"] ?? "development") !== "development") return;
|
|
21
|
+
if (!hasValue(env["JUNIOR_SECRET"])) env["JUNIOR_SECRET"] = JUNIOR_LOCAL_DEV_INTERNAL_SECRET;
|
|
22
|
+
if (!hasValue(env["JUNIOR_STATE_ADAPTER"]) && !options.vercelDeployment) env["JUNIOR_STATE_ADAPTER"] = "memory";
|
|
23
|
+
if (!hasValue(env["JUNIOR_SCHEDULER_SECRET"]) && !hasValue(env["CRON_SECRET"])) env["JUNIOR_SCHEDULER_SECRET"] = JUNIOR_LOCAL_DEV_HEARTBEAT_SECRET;
|
|
24
24
|
const baseUrl = options.baseUrl;
|
|
25
|
-
if (!hasValue(env
|
|
25
|
+
if (!hasValue(env["JUNIOR_BASE_URL"]) && hasValue(baseUrl)) env["JUNIOR_BASE_URL"] = baseUrl.trim();
|
|
26
26
|
}
|
|
27
27
|
function hasEnvRootMarker(dir) {
|
|
28
28
|
return fs.existsSync(path.join(dir, "package.json")) || fs.existsSync(path.join(dir, "pnpm-workspace.yaml"));
|
|
@@ -51,12 +51,13 @@ function resolveCliEnvRoots(cwd) {
|
|
|
51
51
|
* `pnpm exec junior ...` sees the same credentials as local repo scripts.
|
|
52
52
|
*/
|
|
53
53
|
function loadCliEnvFiles(cwd = process.cwd()) {
|
|
54
|
-
const nodeEnv = process.env
|
|
54
|
+
const nodeEnv = process.env["NODE_ENV"] ?? "development";
|
|
55
|
+
const vercelDeployment = (process.env["VERCEL_ENV"] === "production" || process.env["VERCEL_ENV"] === "preview") && hasValue(process.env["REDIS_URL"]);
|
|
55
56
|
for (const root of resolveCliEnvRoots(cwd)) for (const envFile of envFileNames(nodeEnv)) {
|
|
56
57
|
const absolutePath = path.join(root, envFile);
|
|
57
58
|
if (!fs.existsSync(absolutePath)) continue;
|
|
58
59
|
process.loadEnvFile(absolutePath);
|
|
59
60
|
}
|
|
60
|
-
applyJuniorDevelopmentDefaults(process.env);
|
|
61
|
+
applyJuniorDevelopmentDefaults(process.env, { vercelDeployment });
|
|
61
62
|
}
|
|
62
63
|
export { JUNIOR_LOCAL_DEV_HEARTBEAT_SECRET, JUNIOR_LOCAL_DEV_INTERNAL_SECRET, applyJuniorDevelopmentDefaults, loadCliEnvFiles };
|
package/dist/cli/init.js
CHANGED
|
@@ -60,13 +60,21 @@ export default withSentryConfig(config, {
|
|
|
60
60
|
function writeTsConfig(targetDir) {
|
|
61
61
|
fs.writeFileSync(path.join(targetDir, "tsconfig.json"), `${JSON.stringify({
|
|
62
62
|
extends: "nitro/tsconfig",
|
|
63
|
-
compilerOptions: {}
|
|
63
|
+
compilerOptions: { noUncheckedIndexedAccess: true }
|
|
64
64
|
}, null, 2)}\n`);
|
|
65
65
|
}
|
|
66
66
|
function writePnpmWorkspace(targetDir) {
|
|
67
67
|
fs.writeFileSync(path.join(targetDir, "pnpm-workspace.yaml"), `minimumReleaseAge: 1440
|
|
68
68
|
minimumReleaseAgeExclude:
|
|
69
69
|
- "@sentry/*"
|
|
70
|
+
# pnpm fails the install when a dependency has an unreviewed build script.
|
|
71
|
+
# These are the @sentry/junior runtime dependencies that have one.
|
|
72
|
+
allowBuilds:
|
|
73
|
+
"@google/genai": true
|
|
74
|
+
"@mongodb-js/zstd": true
|
|
75
|
+
esbuild: true
|
|
76
|
+
node-liblzma: false
|
|
77
|
+
protobufjs: true
|
|
70
78
|
`);
|
|
71
79
|
}
|
|
72
80
|
function writeVercelJson(targetDir) {
|
|
@@ -88,14 +96,13 @@ jobs:
|
|
|
88
96
|
steps:
|
|
89
97
|
- uses: actions/checkout@v6
|
|
90
98
|
- uses: pnpm/action-setup@v6
|
|
91
|
-
with:
|
|
92
|
-
version: 10
|
|
93
99
|
- uses: actions/setup-node@v6
|
|
94
100
|
with:
|
|
95
101
|
node-version: 24
|
|
96
102
|
cache: pnpm
|
|
97
103
|
- run: pnpm install
|
|
98
104
|
- run: pnpm check
|
|
105
|
+
- run: pnpm typecheck
|
|
99
106
|
# Snapshot warmup needs Vercel OIDC, so the Vercel deploy build runs it.
|
|
100
107
|
- run: pnpm build
|
|
101
108
|
env:
|
|
@@ -116,6 +123,8 @@ async function runInit(dir, log = console.log) {
|
|
|
116
123
|
version: "0.1.0",
|
|
117
124
|
private: true,
|
|
118
125
|
type: "module",
|
|
126
|
+
packageManager: "pnpm@12.18.0",
|
|
127
|
+
engines: { node: "24.x" },
|
|
119
128
|
scripts: {
|
|
120
129
|
dev: "nitro dev",
|
|
121
130
|
check: "junior check",
|
|
@@ -130,7 +139,7 @@ async function runInit(dir, log = console.log) {
|
|
|
130
139
|
hono: "^4.13.11"
|
|
131
140
|
},
|
|
132
141
|
devDependencies: {
|
|
133
|
-
"@types/node": "^
|
|
142
|
+
"@types/node": "^24.19.2",
|
|
134
143
|
jiti: "^2.7.0",
|
|
135
144
|
nitro: "3.0.260522-beta",
|
|
136
145
|
typescript: "^7.0.2"
|
package/dist/cli/main.js
CHANGED
|
@@ -24,7 +24,7 @@ function formatCliFailure(error) {
|
|
|
24
24
|
// src/cli/main.ts
|
|
25
25
|
const SENTRY_FLUSH_TIMEOUT_MS = 2e3;
|
|
26
26
|
async function flushSentry() {
|
|
27
|
-
await (await import("../sentry-
|
|
27
|
+
await (await import("../sentry-CPbZjomA.js").then((n) => n.u)).flush(SENTRY_FLUSH_TIMEOUT_MS);
|
|
28
28
|
}
|
|
29
29
|
async function initSentry() {
|
|
30
30
|
(await import("../instrumentation.js")).initSentry();
|
|
@@ -45,13 +45,13 @@ 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-BnVFGo_z.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-DQLqkSVv.js")).runServiceAccount(argv);
|
|
52
52
|
}
|
|
53
53
|
async function runBriefs(argv) {
|
|
54
|
-
return await (await import("../briefs-
|
|
54
|
+
return await (await import("../briefs-CagVVefw.js")).runBriefs(argv);
|
|
55
55
|
}
|
|
56
56
|
function topLevelCommand(argv) {
|
|
57
57
|
return (argv[0] === "--" ? argv.slice(1) : argv)[0];
|
package/dist/cli/plugins.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { n as pluginCatalogRuntime } from "../catalog-runtime-
|
|
4
|
-
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { o as getDb } from "../db-EKJnkrIb.js";
|
|
2
|
+
import { _o as createPluginLogger, dr as validatePlugins, ur as setPlugins } from "../projection-CNKK7doO.js";
|
|
3
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime-B8ZXvXWm.js";
|
|
4
|
+
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-EU91JwIT.js";
|
|
5
|
+
import { t as loadAppPluginSet } from "../plugin-module-Cv2ETe8Y.js";
|
|
6
|
+
import { a as pluginRuntimeRegistrationsFromPluginSet, i as pluginCliRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "../plugins-Bkk0XRo2.js";
|
|
7
7
|
import { stderr, stdout } from "node:process";
|
|
8
8
|
import { createJiti } from "jiti";
|
|
9
9
|
import { Command, CommanderError } from "commander";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { n as
|
|
4
|
-
import {
|
|
1
|
+
import { i as getChatConfig } from "../config-DdO1BNcw.js";
|
|
2
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime-B8ZXvXWm.js";
|
|
3
|
+
import { n as resolve } from "../resolve-CQLhMWSu.js";
|
|
4
|
+
import { Za as SANDBOX_RUNTIME, ea as create } from "../projection-CNKK7doO.js";
|
|
5
|
+
import { J as disconnectStateAdapter } from "../db-EKJnkrIb.js";
|
|
5
6
|
// src/cli/snapshot-create.ts
|
|
6
7
|
const DEFAULT_TIMEOUT_MS = 6e5;
|
|
7
8
|
function progressMessage(phase) {
|
|
@@ -44,7 +45,7 @@ function logSnapshotProfile(runtime, log) {
|
|
|
44
45
|
}
|
|
45
46
|
/** Resolve or create the default sandbox snapshot and report its progress. */
|
|
46
47
|
async function runSnapshotCreate(log = console.log) {
|
|
47
|
-
if (process.env
|
|
48
|
+
if (process.env["JUNIOR_SKIP_SNAPSHOT"] === "1") {
|
|
48
49
|
log("Skipping sandbox snapshot create (JUNIOR_SKIP_SNAPSHOT=1)");
|
|
49
50
|
return;
|
|
50
51
|
}
|
|
@@ -67,6 +68,7 @@ async function runSnapshotCreate(log = console.log) {
|
|
|
67
68
|
`resolve_outcome=${snapshot.resolveOutcome}`,
|
|
68
69
|
`cache_hit=${snapshot.cacheHit}`,
|
|
69
70
|
`dependency_count=${snapshot.dependencyCount}`,
|
|
71
|
+
`state=${getChatConfig().state.adapter}`,
|
|
70
72
|
...snapshot.profileHash ? [`profile_hash=${snapshot.profileHash}`] : [],
|
|
71
73
|
...snapshot.snapshotId ? [`snapshot_id=${snapshot.snapshotId}`] : [],
|
|
72
74
|
...snapshot.rebuildReason ? [`rebuild_reason=${snapshot.rebuildReason}`] : []
|
package/dist/cli/upgrade.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../db-BdsCzytP.js";
|
|
2
1
|
import { n as JuniorPluginSet } from "../plugins-B_0Cr0MO.js";
|
|
2
|
+
import "../db-zbN5ZV_o.js";
|
|
3
3
|
interface UpgradeIo {
|
|
4
4
|
info: (line: string) => void;
|
|
5
5
|
}
|
|
@@ -7,6 +7,6 @@ interface UpgradeIo {
|
|
|
7
7
|
export declare function resolveUpgradePluginSet(): Promise<JuniorPluginSet | undefined>;
|
|
8
8
|
/** Apply Junior and enabled-plugin database migrations. */
|
|
9
9
|
export declare function runUpgrade(io?: UpgradeIo, options?: {
|
|
10
|
-
pluginSet?: JuniorPluginSet | null;
|
|
10
|
+
pluginSet?: JuniorPluginSet | null | undefined;
|
|
11
11
|
}): Promise<void>;
|
|
12
12
|
export {};
|
package/dist/cli/upgrade.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { i as getChatConfig } from "../config-
|
|
2
|
-
import { t as createJuniorSqlExecutor } from "../executor-
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
5
|
-
import { t as
|
|
1
|
+
import { i as getChatConfig } from "../config-DdO1BNcw.js";
|
|
2
|
+
import { t as createJuniorSqlExecutor } from "../executor-CoIZmFK8.js";
|
|
3
|
+
import { t as loadAppPluginSet } from "../plugin-module-Cv2ETe8Y.js";
|
|
4
|
+
import { t as createPluginCatalogRuntime } from "../registry-DBDNUUmz.js";
|
|
5
|
+
import { n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "../plugins-Bkk0XRo2.js";
|
|
6
6
|
import { basename, dirname, join, resolve } from "node:path";
|
|
7
7
|
import { createHash } from "node:crypto";
|
|
8
8
|
import { readMigrationFiles } from "drizzle-orm/migrator";
|
|
@@ -64,7 +64,7 @@ function migrationResult(migrations, state) {
|
|
|
64
64
|
/** Reject legacy databases that must first run the bridge release upgrade. */
|
|
65
65
|
function assertSupportedMigrationState(state) {
|
|
66
66
|
if (!state.hasJuniorTables || state.appliedAt !== void 0) return;
|
|
67
|
-
throw new Error(`Existing
|
|
67
|
+
throw new Error(`Existing SQL tables have no core Drizzle migration history. Stop old workers, install @sentry/junior@${CORE_MIGRATION_BRIDGE_VERSION}, run \`junior upgrade\`, then restore this version and rerun \`junior upgrade\` before restarting workers.`);
|
|
68
68
|
}
|
|
69
69
|
/** Apply the packaged Drizzle migrations during `junior upgrade`. */
|
|
70
70
|
async function migrateSchema(executor) {
|