@sentry/junior 0.311.0 → 0.312.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-G2M0y6rP.js → adapter-context-BRjEWRy1.js} +2 -2
- package/dist/{adapter-B1wujchl.js → adapter-iIq7ihf7.js} +1 -1
- package/dist/{admin-DCiBhUT1.js → admin-DhInw5K9.js} +1 -1
- package/dist/{agent-runner-BVHPUIc8.js → agent-runner-C9iDurwX.js} +3423 -3477
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +6 -6
- package/dist/api.d.ts +2 -2
- package/dist/api.js +289 -306
- package/dist/{app-Cw5Vy6H6.d.ts → app-DRFrC8Mw.d.ts} +2 -9
- package/dist/app.d.ts +1 -1
- package/dist/app.js +338 -604
- package/dist/{background-compaction-queue-CJDnWVOJ.js → background-compaction-queue-DrKi7w3d.js} +10 -85
- package/dist/callback-mFlTUWWx.js +75 -0
- package/dist/{catalog-runtime-DMY3VV-D.js → catalog-runtime-D7xapBAX.js} +1 -1
- package/dist/channel-access-CJGfNTdn.js +221 -0
- package/dist/child-message-DcsritGf.js +179 -0
- package/dist/cli/chat.js +18 -19
- package/dist/cli/check.js +3 -3
- package/dist/cli/init.js +0 -1
- package/dist/cli/main.js +3 -7
- package/dist/cli/plugins.js +4 -4
- package/dist/cli/run.d.ts +1 -2
- package/dist/cli/run.js +1 -2
- package/dist/cli/snapshot-create.js +5 -5
- package/dist/cli/upgrade.d.ts +1 -1
- package/dist/cli/upgrade.js +3 -3
- package/dist/{config-BrXDQefC.js → config-kXB2Y5tl.js} +59 -27
- package/dist/{continue-in-slack-DNXSC9So.js → continue-in-slack-O6pV5004.js} +7 -8
- package/dist/{conversation-feed-DkinDu5o.js → conversation-feed-uNOv_x68.js} +74 -20
- package/dist/{conversation-privacy-DxttrKb9.js → conversation-privacy-L4ja1_W6.js} +1 -1
- package/dist/{conversation-turn-DWw7Xhdr.js → conversation-turn-CeLbHqdw.js} +31 -27
- package/dist/{credential-sync-Bk8wGb8Y.js → credential-sync-I8VBGk05.js} +16 -15
- package/dist/{projection-Cns7XwWa.js → credentialed-Cb6E2phL.js} +16308 -20732
- package/dist/{db-7ETESH44.d.ts → db-BbC5stfa.d.ts} +11 -6
- package/dist/{db-DTxzH7u5.js → db-LAyyX8tk.js} +174 -91
- package/dist/{executor-DqTiYj9S.js → executor-SCub-fAq.js} +117 -97
- package/dist/{html-B9Sl4Axb.js → html-BCZ3Xtb_.js} +6 -6
- package/dist/ingest-BDf3D50j.js +3836 -0
- package/dist/{install-Sg4ePfLl.js → install-DCFJFkC0.js} +2 -2
- package/dist/instrumentation.js +3 -3
- package/dist/{lineage-BHAMpNKr.js → lineage-B_m-4TJw.js} +2 -2
- package/dist/{stop-CYsfc0Ed.js → list-CN2QA2R9.js} +663 -442
- package/dist/{logging-FjclQsXu.js → logging-dQ9ZRGQ8.js} +1 -1
- package/dist/{schedule-BLJ476XQ.js → media-CYm1QD8T.js} +1055 -11
- package/dist/{message-CJ7_RL50.js → message-DSXGj1hM.js} +19 -26
- package/dist/{model-input-CMLh4Cwq.js → model-input--TrP9hYV.js} +3 -3
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +4 -3
- package/dist/{oauth-callback-server-RVcbiDjL.js → oauth-callback-server-DHCZC6B4.js} +2 -2
- package/dist/{oauth-relay-Bu9kkaQu.js → oauth-relay-pPMGnDZt.js} +1 -1
- package/dist/{registry-BPwuOP2O.js → registry-CZOzddwu.js} +1 -1
- package/dist/{resolve-BK29bBry.js → resolve-cKOQ14Dh.js} +3 -3
- package/dist/result-DcvEOe1r.js +574 -0
- package/dist/result-event-type-BdIJuZxg.js +48 -0
- package/dist/{runner-BcAE-cJm.js → runner-DBfUW44l.js} +14 -16
- package/dist/{sandbox-egress-signals-C-q0go5b.js → sandbox-egress-signals-BVF_xAm1.js} +1 -1
- package/dist/{schema-DYcJeV7d.d.ts → schema-BEHKxr4I.d.ts} +166 -242
- package/dist/{schema-BLgSZXcL.js → schema-Bk9Nm2E8.js} +106 -121
- package/dist/{service-account-iJoCtkHR.js → service-account-CVYsFjty.js} +3 -3
- package/dist/{service-account-gN0zqf0S.js → service-account-Ts4ulcrV.js} +5 -5
- package/dist/{skills-BoZ80epJ.js → skills-VTnhAJWm.js} +2 -2
- package/dist/{slack-conversation-unfurl-CogYrITA.js → slack-conversation-unfurl-fuLnF1jE.js} +9 -9
- package/dist/{spawn-Dk92r7mX.js → spawn-vxAarlX5.js} +6 -5
- package/dist/start-conversation-CEn2KH1A.js +941 -0
- package/dist/{state-DH3Cmgp3.js → state-C1P3_Ywk.js} +4 -4
- package/dist/statuses-_cRJHXK7.js +150 -0
- package/dist/store-DFZaN-Ix.js +492 -0
- package/dist/task-queue-Cx4Lmjyk.js +90 -0
- package/dist/task-runner-CbTwFA6k.js +1432 -0
- package/dist/{thread-context-BW2BsQbH.js → thread-context-BkAZDTX2.js} +7 -7
- package/dist/thread-state-DhPndWi1.js +5625 -0
- package/dist/{validation-DrJd0nnq.js → validation-nIzMtAVJ.js} +1 -1
- package/dist/{task-queue-C_zldF5J.js → vercel-queue-hW90XzbG.js} +93 -172
- package/dist/{version-CNKZ8owc.js → version-Brbtz4Qf.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{warmup-BWdHew2H.js → warmup-BDA5myRK.js} +6463 -12290
- package/dist/web-message-id-C6P83ans.js +10 -0
- package/dist/{worker-t9qpu_Zx.js → worker-D63RcaVD.js} +20 -7
- package/migrations/0143_todos.sql +14 -0
- package/migrations/0144_inbox_items.sql +32 -0
- package/migrations/0145_todo_changed_by_agent.sql +1 -0
- package/migrations/0146_inbox_item_subject_title_parts.sql +1 -0
- package/migrations/0147_inbox_snooze_wake_reason.sql +1 -0
- package/migrations/0148_authorization_request_index.sql +1 -0
- package/migrations/0149_conversation_metadata.sql +10 -0
- package/migrations/0150_conversation_metadata_fill.sql +39 -0
- package/migrations/0151_conversation_search_index.sql +1 -0
- package/migrations/0152_inbox_item_legacy_automation_keys.sql +21 -0
- package/migrations/0153_artifact_expiry.sql +1 -0
- package/migrations/0154_artifact_permanent_sha_index.sql +1 -0
- package/migrations/0155_artifact_drop_public_sha_index.sql +3 -0
- package/migrations/0156_conversation_kind_lead.sql +6 -0
- package/migrations/0157_conversation_lead_actor_index.sql +1 -0
- package/migrations/meta/0143_snapshot.json +6434 -0
- package/migrations/meta/0144_snapshot.json +6434 -0
- package/migrations/meta/0145_snapshot.json +6440 -0
- package/migrations/meta/0146_snapshot.json +6446 -0
- package/migrations/meta/0147_snapshot.json +6452 -0
- package/migrations/meta/0148_snapshot.json +6474 -0
- package/migrations/meta/0149_snapshot.json +6490 -0
- package/migrations/meta/0150_snapshot.json +6490 -0
- package/migrations/meta/0151_snapshot.json +6505 -0
- package/migrations/meta/0152_snapshot.json +6505 -0
- package/migrations/meta/0153_snapshot.json +6511 -0
- package/migrations/meta/0154_snapshot.json +6533 -0
- package/migrations/meta/0155_snapshot.json +6511 -0
- package/migrations/meta/0156_snapshot.json +6511 -0
- package/migrations/meta/0157_snapshot.json +6527 -0
- package/migrations/meta/_journal.json +106 -1
- package/package.json +6 -6
- package/skills/design-automation-skill/SKILL.md +108 -0
- package/dist/briefs-BDjnug6Y.js +0 -395
- package/dist/conversation-ca__NDQW.js +0 -1063
- package/dist/prompt-CDqcsDYC.js +0 -910
- package/dist/store-DmmMIrQi.js +0 -335
- package/dist/task-runner-C7oCJQIx.js +0 -294
- package/dist/turn-session-routing-Xh_2nSQe.js +0 -261
- package/dist/web-message-id-Ch5dPq-a.js +0 -306
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
2
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-D7xapBAX.js";
|
|
3
3
|
import { isDeepStrictEqual } from "node:util";
|
|
4
4
|
// src/chat/plugins/validation.ts
|
|
5
5
|
var validation_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,11 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { E as withSpan, m as logInfo, p as logException } from "./logging-dQ9ZRGQ8.js";
|
|
2
|
+
import { r as getChatConfig } from "./config-kXB2Y5tl.js";
|
|
3
3
|
import "./fan-out-Cod-yEHG.js";
|
|
4
4
|
import * as z from "zod";
|
|
5
5
|
import pLimit from "p-limit";
|
|
6
|
-
import { AsyncLocalStorage } from "node:async_hooks";
|
|
7
6
|
import { createHash, createHmac, timingSafeEqual } from "node:crypto";
|
|
8
7
|
import { QueueClient, handleCallback, registerDevConsumer } from "@vercel/queue";
|
|
8
|
+
// src/chat/secrets.ts
|
|
9
|
+
/** Read the server secret that signs internal tokens and payloads. */
|
|
10
|
+
function readJuniorSecret() {
|
|
11
|
+
return process.env["JUNIOR_SECRET"]?.trim() || void 0;
|
|
12
|
+
}
|
|
13
|
+
/** Read the raw dashboard session secret, with `JUNIOR_SECRET` as fallback. */
|
|
14
|
+
function readSignInSecret() {
|
|
15
|
+
return process.env["BETTER_AUTH_SECRET"] ?? process.env["JUNIOR_SECRET"];
|
|
16
|
+
}
|
|
17
|
+
/** Read the bearer secret that internal cron requests must send. */
|
|
18
|
+
function readSchedulerSecret() {
|
|
19
|
+
return process.env["JUNIOR_SCHEDULER_SECRET"]?.trim() || process.env["CRON_SECRET"]?.trim();
|
|
20
|
+
}
|
|
21
|
+
/** Read the VAPID private key that signs web push messages. */
|
|
22
|
+
function readWebPushPrivateKey() {
|
|
23
|
+
return process.env["JUNIOR_WEB_PUSH_PRIVATE_KEY"]?.trim();
|
|
24
|
+
}
|
|
9
25
|
// src/chat/queue/bullmq.ts
|
|
10
26
|
const MAX_ATTEMPTS = 50;
|
|
11
27
|
const MAX_BACKOFF_MS = 3e4;
|
|
@@ -170,94 +186,6 @@ const vercelQueueProvider = {
|
|
|
170
186
|
function getQueueProvider() {
|
|
171
187
|
return getChatConfig().queue.provider === "bullmq" ? bullmqQueueProvider : vercelQueueProvider;
|
|
172
188
|
}
|
|
173
|
-
// src/chat/runtime/request-deadline.ts
|
|
174
|
-
const requestDeadlineStorage = new AsyncLocalStorage();
|
|
175
|
-
function createTurnRequestDeadline(startedAtMs) {
|
|
176
|
-
return {
|
|
177
|
-
startedAtMs,
|
|
178
|
-
deadlineAtMs: startedAtMs + Math.max(1, getChatConfig().functionMaxDurationSeconds * 1e3 - 2e4)
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
/** Return the host request deadline inherited by the current async turn. */
|
|
182
|
-
function getTurnRequestDeadline() {
|
|
183
|
-
return requestDeadlineStorage.getStore();
|
|
184
|
-
}
|
|
185
|
-
/** Run work under the current host request deadline, or start one. */
|
|
186
|
-
function runWithTurnRequestDeadline(callback, startedAtMs = Date.now()) {
|
|
187
|
-
if (requestDeadlineStorage.getStore()) return callback();
|
|
188
|
-
return runWithNewTurnRequestDeadline(callback, startedAtMs);
|
|
189
|
-
}
|
|
190
|
-
/** Run work that a new host request owns, even inside another request. */
|
|
191
|
-
function runWithNewTurnRequestDeadline(callback, startedAtMs = Date.now()) {
|
|
192
|
-
return requestDeadlineStorage.run(createTurnRequestDeadline(startedAtMs), callback);
|
|
193
|
-
}
|
|
194
|
-
// src/chat/queue/callback.ts
|
|
195
|
-
/** Shared queue callback wiring for signed messages. */
|
|
196
|
-
/** Build the HTTP callback and local-dev consumer for one signed queue. */
|
|
197
|
-
function queueCallback(options) {
|
|
198
|
-
const consume = async (message, metadata) => {
|
|
199
|
-
if (options.skip?.(metadata)) return;
|
|
200
|
-
try {
|
|
201
|
-
await runWithTurnRequestDeadline(() => options.run(message, metadata));
|
|
202
|
-
} catch (error) {
|
|
203
|
-
const reason = options.permanentError?.(error);
|
|
204
|
-
if (!reason) throw error;
|
|
205
|
-
options.onRejected(reason, metadata, error);
|
|
206
|
-
}
|
|
207
|
-
};
|
|
208
|
-
const handler = async (value, metadata) => {
|
|
209
|
-
if (options.skip?.(metadata)) return;
|
|
210
|
-
const checked = options.verify(value);
|
|
211
|
-
if (checked.status === "rejected") {
|
|
212
|
-
options.onRejected(checked.reason, metadata);
|
|
213
|
-
return;
|
|
214
|
-
}
|
|
215
|
-
if (checked.status === "unavailable") throw new Error(`Queue message verification unavailable: ${checked.reason}`);
|
|
216
|
-
await runWithNewTurnRequestDeadline(() => consume(checked.message, metadata));
|
|
217
|
-
};
|
|
218
|
-
const retry = (error, metadata) => {
|
|
219
|
-
const reason = options.permanentError?.(error);
|
|
220
|
-
if (reason) {
|
|
221
|
-
options.onRejected(reason, metadata, error);
|
|
222
|
-
return { acknowledge: true };
|
|
223
|
-
}
|
|
224
|
-
if (options.maxDeliveries !== null && metadata.deliveryCount >= options.maxDeliveries) return { acknowledge: true };
|
|
225
|
-
};
|
|
226
|
-
const consumer = {
|
|
227
|
-
consumerGroup: options.consumerGroup,
|
|
228
|
-
handler,
|
|
229
|
-
retry,
|
|
230
|
-
topic: options.topic,
|
|
231
|
-
visibilityTimeoutSeconds: options.visibilityTimeoutSeconds
|
|
232
|
-
};
|
|
233
|
-
return {
|
|
234
|
-
/** Run a message that an in-process queue already trusts. */
|
|
235
|
-
consume,
|
|
236
|
-
consumer,
|
|
237
|
-
create: () => getQueueProvider().createCallback(consumer),
|
|
238
|
-
registerDev: () => {
|
|
239
|
-
if (process.env["NODE_ENV"] !== "development") return;
|
|
240
|
-
return getQueueProvider().registerDevConsumer?.(consumer);
|
|
241
|
-
}
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
// src/chat/secrets.ts
|
|
245
|
-
/** Read the server secret that signs internal tokens and payloads. */
|
|
246
|
-
function readJuniorSecret() {
|
|
247
|
-
return process.env["JUNIOR_SECRET"]?.trim() || void 0;
|
|
248
|
-
}
|
|
249
|
-
/** Read the raw dashboard session secret, with `JUNIOR_SECRET` as fallback. */
|
|
250
|
-
function readSignInSecret() {
|
|
251
|
-
return process.env["BETTER_AUTH_SECRET"] ?? process.env["JUNIOR_SECRET"];
|
|
252
|
-
}
|
|
253
|
-
/** Read the bearer secret that internal cron requests must send. */
|
|
254
|
-
function readSchedulerSecret() {
|
|
255
|
-
return process.env["JUNIOR_SCHEDULER_SECRET"]?.trim() || process.env["CRON_SECRET"]?.trim();
|
|
256
|
-
}
|
|
257
|
-
/** Read the VAPID private key that signs web push messages. */
|
|
258
|
-
function readWebPushPrivateKey() {
|
|
259
|
-
return process.env["JUNIOR_WEB_PUSH_PRIVATE_KEY"]?.trim();
|
|
260
|
-
}
|
|
261
189
|
// src/chat/queue/sign.ts
|
|
262
190
|
/** Sign and check queue messages before public callbacks run them. */
|
|
263
191
|
const QUEUE_SIGNATURE_MAX_AGE_MS = 36e5;
|
|
@@ -341,88 +269,81 @@ function verifyQueueMessage(config, value, nowMs = Date.now()) {
|
|
|
341
269
|
message: message.data
|
|
342
270
|
};
|
|
343
271
|
}
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
* Plugins register named tasks. This module owns the shared signed message,
|
|
349
|
-
* send path, and HTTP/local callback. Core keeps one topic and one runner.
|
|
350
|
-
*/
|
|
351
|
-
/** Deploy topic name. Keep stable for Vercel queue wiring. */
|
|
352
|
-
const PLUGIN_TASK_QUEUE_TOPIC = "junior_plugin_tasks";
|
|
353
|
-
const PLUGIN_TASK_DEV_CONSUMER_GROUP = "junior_plugin_tasks_dev";
|
|
354
|
-
const PLUGIN_TASK_MAX_DELIVERIES = 5;
|
|
355
|
-
const PLUGIN_TASK_SIGN_CONTEXT = "junior.plugin_task_queue.v1";
|
|
356
|
-
const PLUGIN_TASK_SIGN_VERSION = "v1";
|
|
357
|
-
const pluginTaskParamsSchema = z.object({
|
|
358
|
-
conversationId: z.string().min(1),
|
|
359
|
-
sessionId: z.string().min(1)
|
|
272
|
+
/** Validate the v2 conversation work hint sent through Vercel Queue. */
|
|
273
|
+
const conversationQueueMessageSchema = z.object({
|
|
274
|
+
schemaVersion: z.literal(2),
|
|
275
|
+
conversationId: z.string().trim().min(1)
|
|
360
276
|
}).strict();
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
message.plugin,
|
|
371
|
-
message.name,
|
|
372
|
-
message.params.conversationId,
|
|
373
|
-
message.params.sessionId
|
|
374
|
-
]
|
|
277
|
+
var ConversationQueueMessageRejectedError = class extends Error {
|
|
278
|
+
conversationId;
|
|
279
|
+
reason;
|
|
280
|
+
constructor(reason, message, options = {}) {
|
|
281
|
+
super(message);
|
|
282
|
+
this.name = "ConversationQueueMessageRejectedError";
|
|
283
|
+
this.reason = reason;
|
|
284
|
+
this.conversationId = options.conversationId;
|
|
285
|
+
}
|
|
375
286
|
};
|
|
376
|
-
/**
|
|
377
|
-
function
|
|
378
|
-
return
|
|
379
|
-
}
|
|
380
|
-
/**
|
|
381
|
-
function
|
|
382
|
-
return
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
287
|
+
/** Return whether an error means the queue message was permanently rejected. */
|
|
288
|
+
function isConversationQueueMessageRejectedError(error) {
|
|
289
|
+
return error instanceof ConversationQueueMessageRejectedError;
|
|
290
|
+
}
|
|
291
|
+
/** Build the idempotency key of a wake that one worker event sends. */
|
|
292
|
+
function nudgeIdempotencyKey(reason, conversationId, nowMs) {
|
|
293
|
+
return `${reason}:${conversationId}:${nowMs}`;
|
|
294
|
+
}
|
|
295
|
+
// src/chat/task-execution/queue-signing.ts
|
|
296
|
+
const conversationQueueSign = {
|
|
297
|
+
context: "junior.conversation_work_queue.v2",
|
|
298
|
+
schema: conversationQueueMessageSchema,
|
|
299
|
+
separator: ":",
|
|
300
|
+
signatureVersion: "v2",
|
|
301
|
+
parts: (message) => [message.conversationId]
|
|
302
|
+
};
|
|
303
|
+
const CONVERSATION_WORK_QUEUE_SIGNATURE_MAX_SKEW_MS = QUEUE_SIGNATURE_MAX_AGE_MS;
|
|
304
|
+
/** Sign a conversation queue payload before it crosses the public callback route. */
|
|
305
|
+
function signConversationQueueMessage(message, nowMs = Date.now()) {
|
|
306
|
+
return signQueueMessage(conversationQueueSign, message, nowMs);
|
|
307
|
+
}
|
|
308
|
+
/** Explain whether a queue payload is verified, rejected, or unavailable. */
|
|
309
|
+
function verifyConversationQueueMessage(value, nowMs = Date.now()) {
|
|
310
|
+
return verifyQueueMessage(conversationQueueSign, value, nowMs);
|
|
311
|
+
}
|
|
312
|
+
const CONVERSATION_WORK_QUEUE_RETENTION_SECONDS = CONVERSATION_WORK_QUEUE_SIGNATURE_MAX_SKEW_MS / 1e3;
|
|
313
|
+
let defaultQueue;
|
|
314
|
+
/** Resolve the Vercel Queue topic used for conversation wake-up nudges. */
|
|
315
|
+
function resolveConversationWorkQueueTopic(options = {}) {
|
|
316
|
+
return options.topic?.trim() || process.env["JUNIOR_CONVERSATION_WORK_QUEUE_TOPIC"]?.trim() || "junior_conversation_work";
|
|
317
|
+
}
|
|
318
|
+
function toDelaySeconds(options) {
|
|
319
|
+
if (!options?.delayMs || options.delayMs <= 0) return;
|
|
320
|
+
return Math.ceil(options.delayMs / 1e3);
|
|
321
|
+
}
|
|
322
|
+
/** Create the Vercel Queue implementation for conversation wake-up nudges. */
|
|
323
|
+
function createVercelConversationWorkQueue(options = {}) {
|
|
324
|
+
const topic = resolveConversationWorkQueueTopic(options);
|
|
325
|
+
const client = options.client ?? getQueueProvider();
|
|
326
|
+
return { async send(message, sendOptions) {
|
|
327
|
+
const payload = signConversationQueueMessage(message);
|
|
328
|
+
return await withSpan("conversation.work.publish", "queue.publish", { conversationId: message.conversationId }, async (setSpanAttributes) => {
|
|
329
|
+
const result = await client.send(topic, payload, {
|
|
330
|
+
idempotencyKey: sendOptions?.idempotencyKey,
|
|
331
|
+
delaySeconds: toDelaySeconds(sendOptions),
|
|
332
|
+
retentionSeconds: options.retentionSeconds ?? CONVERSATION_WORK_QUEUE_RETENTION_SECONDS
|
|
333
|
+
});
|
|
334
|
+
if (!result.messageId) return {};
|
|
335
|
+
setSpanAttributes({ "messaging.message.id": result.messageId });
|
|
336
|
+
return { messageId: result.messageId };
|
|
337
|
+
}, {
|
|
338
|
+
"messaging.destination.name": topic,
|
|
339
|
+
"messaging.message.body.size": Buffer.byteLength(JSON.stringify(payload)),
|
|
340
|
+
"messaging.system": getQueueProvider().messagingSystem
|
|
341
|
+
});
|
|
342
|
+
} };
|
|
423
343
|
}
|
|
424
|
-
/**
|
|
425
|
-
function
|
|
426
|
-
|
|
344
|
+
/** Return the default production conversation work queue. */
|
|
345
|
+
function getVercelConversationWorkQueue() {
|
|
346
|
+
defaultQueue ??= createVercelConversationWorkQueue();
|
|
347
|
+
return defaultQueue;
|
|
427
348
|
}
|
|
428
|
-
export {
|
|
349
|
+
export { conversationQueueMessageSchema as a, QUEUE_SIGNATURE_MAX_AGE_MS as c, getQueueProvider as d, readJuniorSecret as f, readWebPushPrivateKey as h, ConversationQueueMessageRejectedError as i, signQueueMessage as l, readSignInSecret as m, resolveConversationWorkQueueTopic as n, isConversationQueueMessageRejectedError as o, readSchedulerSecret as p, verifyConversationQueueMessage as r, nudgeIdempotencyKey as s, getVercelConversationWorkQueue as t, verifyQueueMessage as u };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// package.json
|
|
2
|
-
var version = "0.
|
|
2
|
+
var version = "0.312.0";
|
|
3
3
|
// src/version.ts
|
|
4
4
|
/** Installed Junior package version, or `unknown` when package metadata is unavailable. */
|
|
5
5
|
const JUNIOR_VERSION = typeof version === "string" && version.trim() ? version : "unknown";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as JUNIOR_VERSION } from "./version-
|
|
1
|
+
export { t as JUNIOR_VERSION } from "./version-Brbtz4Qf.js";
|