@sentry/junior 0.301.0 → 0.303.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-BdVnSuY5.js +43 -0
- package/dist/{admin-CRJHvCGg.js → admin-AfeAdS3J.js} +2 -2
- package/dist/{agent-runner-H4YhvNBj.js → agent-runner-BP8_DLUv.js} +4688 -13870
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +7 -8
- package/dist/api.d.ts +13 -12
- package/dist/api.js +268 -118
- package/dist/{app-HDZglaIu.d.ts → app-Dd9v1mNx.d.ts} +15 -15
- package/dist/app.d.ts +1 -1
- package/dist/app.js +99 -330
- package/dist/{automation-Cva5ZOwW.js → automation-D9MvhOWY.js} +3 -1
- package/dist/{background-compaction-queue-CNrZ3QcU.js → background-compaction-queue-xaE05jxH.js} +97 -206
- package/dist/{briefs-x6Mzwxmg.js → briefs-D8i-dKTp.js} +4 -4
- package/dist/{catalog-runtime-BEY6EGRi.js → catalog-runtime-d1EM6Z0V.js} +2 -2
- package/dist/cli/chat.d.ts +1 -1
- package/dist/cli/chat.js +21 -21
- package/dist/cli/check.js +8 -8
- 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 +5 -5
- package/dist/{config-CmjhyqgB.js → config-oGM7KA9M.js} +44 -63
- package/dist/{connections-CfIRm0xv.js → connections-BlikzEJv.js} +6 -6
- package/dist/{continue-in-slack-DPoABVkB.js → continue-in-slack-BZnYifiG.js} +5 -6
- package/dist/{conversation-BNXfq6Lb.js → conversation-CY1jnBiC.js} +1 -1
- package/dist/{conversation-feed-CfpyFMHP.js → conversation-feed-BZJRk6UV.js} +2 -1
- package/dist/{conversation-privacy-0CM0V2qK.js → conversation-privacy-Cx515ddM.js} +7 -7
- package/dist/{conversation-turn-C0sxyvS-.js → conversation-turn-DAhRdX4m.js} +20 -24
- package/dist/{credential-sync-tEMKZ_8M.js → credential-sync-DfhmWFeo.js} +18 -20
- package/dist/{db-Czra10QW.js → db-C-2tFxk3.js} +326 -17
- package/dist/{db-BdUHQhrC.d.ts → db-DPqcEM9_.d.ts} +25 -25
- package/dist/{executor-D_023K0H.js → executor-NVfS8aQ2.js} +51 -10
- package/dist/{history-IjdmO_r6.js → history-UZ3M2M9r.js} +13 -10
- package/dist/install-CHLrpRZc.js +228 -0
- package/dist/instrumentation.d.ts +4 -4
- package/dist/instrumentation.js +10 -10
- package/dist/{lineage-DmMIE0VL.js → lineage-HGLhd_-N.js} +2 -2
- package/dist/{logging-DcjLDDqi.js → logging-DiyqRLBx.js} +24 -20
- package/dist/{message-C0JY9RJP.js → message-CkCOcbFH.js} +9 -9
- package/dist/{model-input-CBp-p24N.js → model-input-DmoPPtPE.js} +5 -10
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +7 -6
- package/dist/{oauth-callback-server-BRq9QNhU.js → oauth-callback-server-CIf_6YmA.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-CQNDOi82.js → projection-DBq8tsA5.js} +489 -223
- package/dist/{prompt-DLUB5m72.js → prompt-D2KlJopL.js} +15 -5
- package/dist/{queue-CZyYgPF0.d.ts → queue-CbEHUO0l.d.ts} +1 -1
- package/dist/queue-DFaOscp5.js +115 -0
- package/dist/{registry-Dj377ADs.js → registry-Bu0Z9BEO.js} +37 -37
- package/dist/{resolve-DJkh9Fky.js → resolve-DXuA3G0g.js} +4 -229
- package/dist/{result-C8iIpDl1.js → result-DpiNseDA.js} +11 -16
- package/dist/rolldown-runtime-BKpuH2hG.js +26 -0
- package/dist/{runner-DZqrOy8C.js → runner-iu1heRFv.js} +10 -10
- package/dist/{sandbox-egress-signals-CGwH86S9.js → sandbox-egress-signals-2HFYDcQf.js} +1 -1
- package/dist/{schema-CdZFn7Qd.d.ts → schema-DHMOaRzC.d.ts} +959 -41
- package/dist/{schema-DyHXiQKI.js → schema-DvfX3Gq_.js} +141 -40
- 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-suY004dx.js → service-account-BcT5LR7V.js} +271 -20
- package/dist/{service-account-D6jGR4a1.js → service-account-xYkaQTrw.js} +3 -3
- package/dist/{session-stop-BLmfFI3d.js → session-stop-BLLp1IP_.js} +1098 -1110
- package/dist/{skills-CmNG0dHb.js → skills-CNAGH4ju.js} +6 -9
- package/dist/{slack-conversation-unfurl-Bty-DlHe.js → slack-conversation-unfurl-DYnqe5ci.js} +10 -14
- package/dist/{spawn-CNjkpXpk.js → spawn-cGasWW33.js} +7 -7
- package/dist/{state-CEbZuZD6.js → state-CDS6h_Wv.js} +34 -5
- package/dist/{stop-Bjy2-K4H.js → stop-DMMA67yT.js} +896 -196
- package/dist/{store-DmV4CoNr.js → store-Dgs7Oe44.js} +5 -5
- package/dist/{task-queue-AhG1tSXR.js → task-queue-DcF0nhhz.js} +3 -3
- package/dist/{task-runner-BMxZI3o7.js → task-runner-BGXF7Fo7.js} +15 -20
- package/dist/{thread-context-CXLnbg7g.js → thread-context-BPky1KBe.js} +12 -12
- package/dist/{store-Epv6t4vV.js → turn-session-routing-DGvn9MSl.js} +384 -13
- package/dist/{turn-user-message-DsUZi9gn.js → turn-user-message-19CkuUvM.js} +3 -3
- package/dist/{validation-DOz8X9BU.js → validation-lu1DgjNQ.js} +2 -2
- package/dist/vercel.js +1 -1
- package/dist/{version-CGMRmMPK.js → version-Uo3c94Dx.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-H3EsMWtJ.js → viewer-BPQHMx3-.js} +3 -3
- package/dist/warmup-H8uLvW9e.js +13946 -0
- package/dist/{statuses-Hn-HsOph.js → web-message-id-lNodcCOI.js} +136 -1
- package/dist/{worker-ClphajjD.js → worker-B-pM_-3K.js} +9 -12
- package/migrations/0108_conversation_embeddings.sql +13 -0
- package/migrations/0109_user_preferences.sql +1 -0
- package/migrations/0110_code_change_repository_state_index.sql +1 -0
- package/migrations/meta/0108_snapshot.json +4688 -0
- package/migrations/meta/0109_snapshot.json +4925 -0
- package/migrations/meta/0110_snapshot.json +4952 -0
- package/migrations/meta/_journal.json +22 -1
- package/package.json +16 -17
- package/dist/adapter-CNjGEJO9.js +0 -303
- package/dist/reporting-window-DopzcOHh.js +0 -137
- package/dist/turn-session-routing-BD3-jJl7.js +0 -380
- package/dist/users-BxvYclQg.js +0 -424
- package/dist/warmup-CdU5hR49.js +0 -3715
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as resolveLocalScheduleAtMs, i as getFirstRunAtMs, o as getZonedDateTimeParts, s as isValidTimeZone } from "./schedule-cP0AACm1.js";
|
|
2
|
-
import { i as actorIdentitySchema } from "./conversation-
|
|
2
|
+
import { i as actorIdentitySchema } from "./conversation-CY1jnBiC.js";
|
|
3
3
|
import * as z from "zod";
|
|
4
4
|
import { actorUserIdSchema, destinationVisibilitySchema, eventMatchFieldsSchema, eventMatchSchema, eventReachSchema, eventTypeSchema, pluginEventTypeSchema, slackDestinationSchema, taskOutcomeSchema } from "@sentry/junior-plugin-api";
|
|
5
5
|
// src/chat/automations/task.ts
|
|
@@ -568,6 +568,8 @@ const automationListQuerySchema = z.object({
|
|
|
568
568
|
"unavailable"
|
|
569
569
|
]).default("all"),
|
|
570
570
|
creator: z.string().max(300).optional(),
|
|
571
|
+
/** Only the viewer's own Automations, inside any scope. */
|
|
572
|
+
owner: z.literal("me").optional(),
|
|
571
573
|
destination: z.string().max(300).optional(),
|
|
572
574
|
/** Only Automations that run this skill. */
|
|
573
575
|
skill: automationSkillNameSchema.optional(),
|
package/dist/{background-compaction-queue-CNrZ3QcU.js → background-compaction-queue-xaE05jxH.js}
RENAMED
|
@@ -1,10 +1,50 @@
|
|
|
1
|
-
import { i as getChatConfig } from "./config-
|
|
2
|
-
import { E as withSpan,
|
|
3
|
-
import { t as readJuniorSecret } from "./secrets-
|
|
1
|
+
import { i as getChatConfig } from "./config-oGM7KA9M.js";
|
|
2
|
+
import { E as withSpan, m as logInfo, p as logException } from "./logging-DiyqRLBx.js";
|
|
3
|
+
import { t as readJuniorSecret } from "./secrets-DHaJ5TTn.js";
|
|
4
4
|
import * as z from "zod";
|
|
5
5
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
6
6
|
import { createHash, createHmac, timingSafeEqual } from "node:crypto";
|
|
7
7
|
import { QueueClient, handleCallback, registerDevConsumer } from "@vercel/queue";
|
|
8
|
+
/** Validate the v2 conversation work hint sent through Vercel Queue. */
|
|
9
|
+
const conversationQueueMessageSchema = z.object({
|
|
10
|
+
schemaVersion: z.literal(2),
|
|
11
|
+
conversationId: z.string().trim().min(1)
|
|
12
|
+
}).strict();
|
|
13
|
+
var ConversationQueueMessageRejectedError = class extends Error {
|
|
14
|
+
conversationId;
|
|
15
|
+
reason;
|
|
16
|
+
constructor(reason, message, options = {}) {
|
|
17
|
+
super(message);
|
|
18
|
+
this.name = "ConversationQueueMessageRejectedError";
|
|
19
|
+
this.reason = reason;
|
|
20
|
+
this.conversationId = options.conversationId;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
/** Return whether an error means the queue message was permanently rejected. */
|
|
24
|
+
function isConversationQueueMessageRejectedError(error) {
|
|
25
|
+
return error instanceof ConversationQueueMessageRejectedError;
|
|
26
|
+
}
|
|
27
|
+
/** Build the idempotency key of a wake that one worker event sends. */
|
|
28
|
+
function nudgeIdempotencyKey(reason, conversationId, nowMs) {
|
|
29
|
+
return `${reason}:${conversationId}:${nowMs}`;
|
|
30
|
+
}
|
|
31
|
+
// src/chat/runtime/request-deadline.ts
|
|
32
|
+
const requestDeadlineStorage = new AsyncLocalStorage();
|
|
33
|
+
function createTurnRequestDeadline(startedAtMs) {
|
|
34
|
+
return {
|
|
35
|
+
startedAtMs,
|
|
36
|
+
deadlineAtMs: startedAtMs + Math.max(1, getChatConfig().functionMaxDurationSeconds * 1e3 - 2e4)
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/** Return the host request deadline inherited by the current async turn. */
|
|
40
|
+
function getTurnRequestDeadline() {
|
|
41
|
+
return requestDeadlineStorage.getStore();
|
|
42
|
+
}
|
|
43
|
+
/** Run work with one host request deadline shared by nested queued turns. */
|
|
44
|
+
function runWithTurnRequestDeadline(callback, startedAtMs = Date.now()) {
|
|
45
|
+
if (requestDeadlineStorage.getStore()) return callback();
|
|
46
|
+
return requestDeadlineStorage.run(createTurnRequestDeadline(startedAtMs), callback);
|
|
47
|
+
}
|
|
8
48
|
// src/chat/queue/bullmq.ts
|
|
9
49
|
const MAX_ATTEMPTS = 50;
|
|
10
50
|
const MAX_BACKOFF_MS = 3e4;
|
|
@@ -99,7 +139,7 @@ async function startWorker(consumers) {
|
|
|
99
139
|
} };
|
|
100
140
|
}
|
|
101
141
|
/** Add one job on a Redis client that is open only for this send. */
|
|
102
|
-
async function send
|
|
142
|
+
async function send(topic, payload, options = {}) {
|
|
103
143
|
const { bullmq, connection } = await connect();
|
|
104
144
|
const queue = new bullmq.Queue(topic, { connection });
|
|
105
145
|
try {
|
|
@@ -126,13 +166,13 @@ async function send$1(topic, payload, options = {}) {
|
|
|
126
166
|
/** Queue provider backed by BullMQ, for local development only. */
|
|
127
167
|
const bullmqQueueProvider = {
|
|
128
168
|
messagingSystem: "bullmq",
|
|
129
|
-
send
|
|
169
|
+
send,
|
|
130
170
|
createCallback: () => async () => new Response("This queue provider does not push messages", { status: 404 }),
|
|
131
171
|
startWorker
|
|
132
172
|
};
|
|
133
173
|
// src/chat/queue/vercel.ts
|
|
134
174
|
function defaultQueueClientOptions() {
|
|
135
|
-
if (process.env
|
|
175
|
+
if (process.env["VERCEL_DEPLOYMENT_ID"]?.trim()) return {};
|
|
136
176
|
return { deploymentId: null };
|
|
137
177
|
}
|
|
138
178
|
let client;
|
|
@@ -168,73 +208,6 @@ const vercelQueueProvider = {
|
|
|
168
208
|
function getQueueProvider() {
|
|
169
209
|
return getChatConfig().queue.provider === "bullmq" ? bullmqQueueProvider : vercelQueueProvider;
|
|
170
210
|
}
|
|
171
|
-
// src/chat/runtime/request-deadline.ts
|
|
172
|
-
const requestDeadlineStorage = new AsyncLocalStorage();
|
|
173
|
-
function createTurnRequestDeadline(startedAtMs) {
|
|
174
|
-
return {
|
|
175
|
-
startedAtMs,
|
|
176
|
-
deadlineAtMs: startedAtMs + Math.max(1, getChatConfig().functionMaxDurationSeconds * 1e3 - 2e4)
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
/** Return the host request deadline inherited by the current async turn. */
|
|
180
|
-
function getTurnRequestDeadline() {
|
|
181
|
-
return requestDeadlineStorage.getStore();
|
|
182
|
-
}
|
|
183
|
-
/** Run work with one host request deadline shared by nested queued turns. */
|
|
184
|
-
function runWithTurnRequestDeadline(callback, startedAtMs = Date.now()) {
|
|
185
|
-
if (requestDeadlineStorage.getStore()) return callback();
|
|
186
|
-
return requestDeadlineStorage.run(createTurnRequestDeadline(startedAtMs), callback);
|
|
187
|
-
}
|
|
188
|
-
// src/chat/queue/callback.ts
|
|
189
|
-
/** Shared queue callback wiring for signed messages. */
|
|
190
|
-
/** Build the HTTP callback and local-dev consumer for one signed queue. */
|
|
191
|
-
function queueCallback(options) {
|
|
192
|
-
const consume = async (message, metadata) => {
|
|
193
|
-
if (options.skip?.(metadata)) return;
|
|
194
|
-
try {
|
|
195
|
-
await runWithTurnRequestDeadline(() => options.run(message, metadata));
|
|
196
|
-
} catch (error) {
|
|
197
|
-
const reason = options.permanentError?.(error);
|
|
198
|
-
if (!reason) throw error;
|
|
199
|
-
options.onRejected(reason, metadata, error);
|
|
200
|
-
}
|
|
201
|
-
};
|
|
202
|
-
const handler = async (value, metadata) => {
|
|
203
|
-
if (options.skip?.(metadata)) return;
|
|
204
|
-
const checked = options.verify(value);
|
|
205
|
-
if (checked.status === "rejected") {
|
|
206
|
-
options.onRejected(checked.reason, metadata);
|
|
207
|
-
return;
|
|
208
|
-
}
|
|
209
|
-
if (checked.status === "unavailable") throw new Error(`Queue message verification unavailable: ${checked.reason}`);
|
|
210
|
-
await consume(checked.message, metadata);
|
|
211
|
-
};
|
|
212
|
-
const retry = (error, metadata) => {
|
|
213
|
-
const reason = options.permanentError?.(error);
|
|
214
|
-
if (reason) {
|
|
215
|
-
options.onRejected(reason, metadata, error);
|
|
216
|
-
return { acknowledge: true };
|
|
217
|
-
}
|
|
218
|
-
if (options.maxDeliveries !== null && metadata.deliveryCount >= options.maxDeliveries) return { acknowledge: true };
|
|
219
|
-
};
|
|
220
|
-
const consumer = {
|
|
221
|
-
consumerGroup: options.consumerGroup,
|
|
222
|
-
handler,
|
|
223
|
-
retry,
|
|
224
|
-
topic: options.topic,
|
|
225
|
-
visibilityTimeoutSeconds: options.visibilityTimeoutSeconds
|
|
226
|
-
};
|
|
227
|
-
return {
|
|
228
|
-
/** Run a message that an in-process queue already trusts. */
|
|
229
|
-
consume,
|
|
230
|
-
consumer,
|
|
231
|
-
create: () => getQueueProvider().createCallback(consumer),
|
|
232
|
-
registerDev: () => {
|
|
233
|
-
if (process.env.NODE_ENV !== "development") return;
|
|
234
|
-
return getQueueProvider().registerDevConsumer?.(consumer);
|
|
235
|
-
}
|
|
236
|
-
};
|
|
237
|
-
}
|
|
238
211
|
// src/chat/queue/sign.ts
|
|
239
212
|
/** Sign and check queue messages before public callbacks run them. */
|
|
240
213
|
const QUEUE_SIGNATURE_MAX_AGE_MS = 36e5;
|
|
@@ -318,100 +291,6 @@ function verifyQueueMessage(config, value, nowMs = Date.now()) {
|
|
|
318
291
|
message: message.data
|
|
319
292
|
};
|
|
320
293
|
}
|
|
321
|
-
// src/chat/cache-warming/queue.ts
|
|
322
|
-
/** Send and receive delayed cache warmup messages. */
|
|
323
|
-
/** Deploy topic name. Keep stable for Vercel queue wiring. */
|
|
324
|
-
const CACHE_WARMUP_QUEUE_TOPIC = "junior_cache_warmups";
|
|
325
|
-
const CACHE_WARMUP_DEV_CONSUMER_GROUP = "junior_cache_warmups_dev";
|
|
326
|
-
const cacheWarmupSign = {
|
|
327
|
-
context: "junior.cache_warmup_queue.v1",
|
|
328
|
-
schema: z.discriminatedUnion("kind", [z.object({
|
|
329
|
-
kind: z.literal("warmup"),
|
|
330
|
-
conversationId: z.string().min(1),
|
|
331
|
-
cycle: z.number().int().positive(),
|
|
332
|
-
generation: z.string().min(1),
|
|
333
|
-
cacheExpiresAtMs: z.number().int().positive()
|
|
334
|
-
}).strict(), z.object({
|
|
335
|
-
kind: z.literal("horizon"),
|
|
336
|
-
conversationId: z.string().min(1),
|
|
337
|
-
generation: z.string().min(1)
|
|
338
|
-
}).strict()]),
|
|
339
|
-
signatureVersion: "v1",
|
|
340
|
-
parts: (message) => [
|
|
341
|
-
message.kind,
|
|
342
|
-
message.conversationId,
|
|
343
|
-
message.generation,
|
|
344
|
-
message.kind === "warmup" ? String(message.cycle) : "",
|
|
345
|
-
message.kind === "warmup" ? String(message.cacheExpiresAtMs) : ""
|
|
346
|
-
]
|
|
347
|
-
};
|
|
348
|
-
/** Send a cache warming message that is delivered after `delayMs`. */
|
|
349
|
-
async function sendCacheWarmup(message, delayMs) {
|
|
350
|
-
await getQueueProvider().send(CACHE_WARMUP_QUEUE_TOPIC, signQueueMessage(cacheWarmupSign, message), {
|
|
351
|
-
delaySeconds: Math.max(0, Math.floor(delayMs / 1e3)),
|
|
352
|
-
retentionSeconds: message.kind === "warmup" ? Math.min(QUEUE_SIGNATURE_MAX_AGE_MS / 1e3, Math.ceil(Math.max(0, delayMs) / 1e3) + 120) : QUEUE_SIGNATURE_MAX_AGE_MS / 1e3,
|
|
353
|
-
idempotencyKey: `cache-warmup_${message.generation}_${message.kind === "warmup" ? message.cycle : message.kind}`
|
|
354
|
-
});
|
|
355
|
-
}
|
|
356
|
-
function logCacheWarmupRejected(reason, metadata, error) {
|
|
357
|
-
logWarn("cache_warming.queue_message.rejected", {
|
|
358
|
-
"app.queue.consumer_group": metadata.consumerGroup,
|
|
359
|
-
"app.queue.delivery_count": metadata.deliveryCount,
|
|
360
|
-
"app.queue.message_id": metadata.messageId,
|
|
361
|
-
"app.queue.reject_reason": reason,
|
|
362
|
-
"app.queue.topic_name": metadata.topicName,
|
|
363
|
-
...error instanceof Error ? { "exception.message": error.message } : void 0
|
|
364
|
-
});
|
|
365
|
-
}
|
|
366
|
-
function cacheWarmupCallback() {
|
|
367
|
-
return queueCallback({
|
|
368
|
-
consumerGroup: CACHE_WARMUP_DEV_CONSUMER_GROUP,
|
|
369
|
-
maxDeliveries: 1,
|
|
370
|
-
onRejected: logCacheWarmupRejected,
|
|
371
|
-
run: async (message) => {
|
|
372
|
-
const { runCacheWarmup } = await import("./warmup-CdU5hR49.js").then((n) => n.o);
|
|
373
|
-
await runCacheWarmup(message);
|
|
374
|
-
},
|
|
375
|
-
skip: () => !getChatConfig().cacheWarmingEnabled,
|
|
376
|
-
topic: CACHE_WARMUP_QUEUE_TOPIC,
|
|
377
|
-
verify: (value) => verifyQueueMessage(cacheWarmupSign, value)
|
|
378
|
-
});
|
|
379
|
-
}
|
|
380
|
-
/** Create the HTTP route for cache warmup messages. */
|
|
381
|
-
function createVercelCacheWarmupCallback() {
|
|
382
|
-
return cacheWarmupCallback().create();
|
|
383
|
-
}
|
|
384
|
-
/** Return the queue consumer for cache warmups, for a pulling queue worker. */
|
|
385
|
-
function cacheWarmupQueueConsumer() {
|
|
386
|
-
return cacheWarmupCallback().consumer;
|
|
387
|
-
}
|
|
388
|
-
/** Receive cache warmup messages during local development. */
|
|
389
|
-
function registerVercelCacheWarmupDevConsumer() {
|
|
390
|
-
return cacheWarmupCallback().registerDev();
|
|
391
|
-
}
|
|
392
|
-
/** Validate the v2 conversation work hint sent through Vercel Queue. */
|
|
393
|
-
const conversationQueueMessageSchema = z.object({
|
|
394
|
-
schemaVersion: z.literal(2),
|
|
395
|
-
conversationId: z.string().trim().min(1)
|
|
396
|
-
}).strict();
|
|
397
|
-
var ConversationQueueMessageRejectedError = class extends Error {
|
|
398
|
-
conversationId;
|
|
399
|
-
reason;
|
|
400
|
-
constructor(reason, message, options = {}) {
|
|
401
|
-
super(message);
|
|
402
|
-
this.name = "ConversationQueueMessageRejectedError";
|
|
403
|
-
this.reason = reason;
|
|
404
|
-
this.conversationId = options.conversationId;
|
|
405
|
-
}
|
|
406
|
-
};
|
|
407
|
-
/** Return whether an error means the queue message was permanently rejected. */
|
|
408
|
-
function isConversationQueueMessageRejectedError(error) {
|
|
409
|
-
return error instanceof ConversationQueueMessageRejectedError;
|
|
410
|
-
}
|
|
411
|
-
/** Build the idempotency key of a wake that one worker event sends. */
|
|
412
|
-
function nudgeIdempotencyKey(reason, conversationId, nowMs) {
|
|
413
|
-
return `${reason}:${conversationId}:${nowMs}`;
|
|
414
|
-
}
|
|
415
294
|
// src/chat/task-execution/queue-signing.ts
|
|
416
295
|
const conversationQueueSign = {
|
|
417
296
|
context: "junior.conversation_work_queue.v2",
|
|
@@ -433,7 +312,7 @@ const CONVERSATION_WORK_QUEUE_RETENTION_SECONDS = CONVERSATION_WORK_QUEUE_SIGNAT
|
|
|
433
312
|
let defaultQueue;
|
|
434
313
|
/** Resolve the Vercel Queue topic used for conversation wake-up nudges. */
|
|
435
314
|
function resolveConversationWorkQueueTopic(options = {}) {
|
|
436
|
-
return options.topic?.trim() || process.env
|
|
315
|
+
return options.topic?.trim() || process.env["JUNIOR_CONVERSATION_WORK_QUEUE_TOPIC"]?.trim() || "junior_conversation_work";
|
|
437
316
|
}
|
|
438
317
|
function toDelaySeconds(options) {
|
|
439
318
|
if (!options?.delayMs || options.delayMs <= 0) return;
|
|
@@ -466,43 +345,55 @@ function getVercelConversationWorkQueue() {
|
|
|
466
345
|
defaultQueue ??= createVercelConversationWorkQueue();
|
|
467
346
|
return defaultQueue;
|
|
468
347
|
}
|
|
469
|
-
// src/chat/
|
|
470
|
-
/**
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
const
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
};
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
348
|
+
// src/chat/queue/callback.ts
|
|
349
|
+
/** Shared queue callback wiring for signed messages. */
|
|
350
|
+
/** Build the HTTP callback and local-dev consumer for one signed queue. */
|
|
351
|
+
function queueCallback(options) {
|
|
352
|
+
const consume = async (message, metadata) => {
|
|
353
|
+
if (options.skip?.(metadata)) return;
|
|
354
|
+
try {
|
|
355
|
+
await runWithTurnRequestDeadline(() => options.run(message, metadata));
|
|
356
|
+
} catch (error) {
|
|
357
|
+
const reason = options.permanentError?.(error);
|
|
358
|
+
if (!reason) throw error;
|
|
359
|
+
options.onRejected(reason, metadata, error);
|
|
360
|
+
}
|
|
361
|
+
};
|
|
362
|
+
const handler = async (value, metadata) => {
|
|
363
|
+
if (options.skip?.(metadata)) return;
|
|
364
|
+
const checked = options.verify(value);
|
|
365
|
+
if (checked.status === "rejected") {
|
|
366
|
+
options.onRejected(checked.reason, metadata);
|
|
367
|
+
return;
|
|
368
|
+
}
|
|
369
|
+
if (checked.status === "unavailable") throw new Error(`Queue message verification unavailable: ${checked.reason}`);
|
|
370
|
+
await consume(checked.message, metadata);
|
|
371
|
+
};
|
|
372
|
+
const retry = (error, metadata) => {
|
|
373
|
+
const reason = options.permanentError?.(error);
|
|
374
|
+
if (reason) {
|
|
375
|
+
options.onRejected(reason, metadata, error);
|
|
376
|
+
return { acknowledge: true };
|
|
377
|
+
}
|
|
378
|
+
if (options.maxDeliveries !== null && metadata.deliveryCount >= options.maxDeliveries) return { acknowledge: true };
|
|
379
|
+
};
|
|
380
|
+
const consumer = {
|
|
381
|
+
consumerGroup: options.consumerGroup,
|
|
382
|
+
handler,
|
|
383
|
+
retry,
|
|
384
|
+
topic: options.topic,
|
|
385
|
+
visibilityTimeoutSeconds: options.visibilityTimeoutSeconds
|
|
386
|
+
};
|
|
387
|
+
return {
|
|
388
|
+
/** Run a message that an in-process queue already trusts. */
|
|
389
|
+
consume,
|
|
390
|
+
consumer,
|
|
391
|
+
create: () => getQueueProvider().createCallback(consumer),
|
|
392
|
+
registerDev: () => {
|
|
393
|
+
if (process.env["NODE_ENV"] !== "development") return;
|
|
394
|
+
return getQueueProvider().registerDevConsumer?.(consumer);
|
|
395
|
+
}
|
|
396
|
+
};
|
|
506
397
|
}
|
|
507
398
|
// src/chat/services/background-compaction-queue.ts
|
|
508
399
|
/**
|
|
@@ -543,4 +434,4 @@ const vercelBackgroundCompactionQueue = { send: async (message) => {
|
|
|
543
434
|
retentionSeconds: QUEUE_SIGNATURE_MAX_AGE_MS / 1e3
|
|
544
435
|
});
|
|
545
436
|
} };
|
|
546
|
-
export {
|
|
437
|
+
export { nudgeIdempotencyKey as _, queueCallback as a, verifyConversationQueueMessage as c, verifyQueueMessage as d, getQueueProvider as f, isConversationQueueMessageRejectedError as g, conversationQueueMessageSchema as h, verifyBackgroundCompactionMessage as i, QUEUE_SIGNATURE_MAX_AGE_MS as l, ConversationQueueMessageRejectedError as m, backgroundCompactionId as n, getVercelConversationWorkQueue as o, getTurnRequestDeadline as p, vercelBackgroundCompactionQueue as r, resolveConversationWorkQueueTopic as s, BACKGROUND_COMPACTION_QUEUE_TOPIC as t, signQueueMessage as u };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { $ as briefResourceLabel, X as briefCodeChangeSchema, f as conversationEventPageSchema, tt as parseBriefInput, u as conversationDetailReportSchema } from "./conversation-CY1jnBiC.js";
|
|
2
|
+
import { l as completeObject, n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-D2KlJopL.js";
|
|
3
3
|
import { CLI_USAGE } from "./cli/run.js";
|
|
4
4
|
import * as z from "zod";
|
|
5
5
|
import path from "node:path";
|
|
@@ -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];
|
|
@@ -262,7 +262,7 @@ async function parseRunOptions(argv) {
|
|
|
262
262
|
* token.
|
|
263
263
|
*/
|
|
264
264
|
async function configuredBriefModelId() {
|
|
265
|
-
const { botConfig } = await import("./config-
|
|
265
|
+
const { botConfig } = await import("./config-oGM7KA9M.js").then((n) => n.r);
|
|
266
266
|
return botConfig.fastModelId;
|
|
267
267
|
}
|
|
268
268
|
function apiUrl(baseUrl, pathname) {
|
|
@@ -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-Bu0Z9BEO.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-BP8_DLUv.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-DBq8tsA5.js").then((n) => n.er),
|
|
103
|
+
import("../catalog-runtime-d1EM6Z0V.js").then((n) => n.t),
|
|
104
|
+
import("../validation-lu1DgjNQ.js").then((n) => n.r),
|
|
105
|
+
import("../db-C-2tFxk3.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-DBq8tsA5.js").then((n) => n.hr);
|
|
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-iu1heRFv.js");
|
|
158
|
+
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-CIf_6YmA.js");
|
|
159
|
+
const { createLocalOAuthState } = await import("../oauth-relay-DAmfVmJu.js").then((n) => n.t);
|
|
160
|
+
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-2HFYDcQf.js");
|
|
161
|
+
const { bindSpawnAgent } = await import("../spawn-cGasWW33.js").then((n) => n.n);
|
|
162
|
+
const { bindMessageAgent } = await import("../message-CkCOcbFH.js").then((n) => n.n);
|
|
163
|
+
const { createChildConversationWorker, createDeliverToParent } = await import("../result-DpiNseDA.js").then((n) => n.o);
|
|
164
|
+
const { createConversationTurnWorker } = await import("../conversation-turn-DAhRdX4m.js").then((n) => n.t);
|
|
165
|
+
const { skipInputAfterConversationStop } = await import("../session-stop-BLLp1IP_.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-B-pM_-3K.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-CNAGH4ju.js";
|
|
2
|
+
import { N as JUNIOR_HEARTBEAT_ROUTE, R as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, j as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-DiyqRLBx.js";
|
|
3
|
+
import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-Bu0Z9BEO.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);
|
|
@@ -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 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"
|