bunqueue-dashboard 0.0.29 → 0.0.31
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/agent/db.ts +16 -19
- package/agent/server.ts +4 -4
- package/dist/.vite/manifest.json +194 -146
- package/dist/assets/{AddJob-UCSTFuum.js → AddJob-CAhdg38n.js} +1 -1
- package/dist/assets/{Alerts-CofRabaP.js → Alerts-70bxf-PT.js} +1 -1
- package/dist/assets/{AreaChart-Dl_9G6GH.js → AreaChart-2gM0YoZT.js} +1 -1
- package/dist/assets/{Benchmark-B1VUJJLw.js → Benchmark-CFZ3WCvj.js} +1 -1
- package/dist/assets/{BulkAddJobs-DVgkRtrp.js → BulkAddJobs-BzgzpGg_.js} +1 -1
- package/dist/assets/CopilotPanel-DZUGIf1q.js +44 -0
- package/dist/assets/{Cron-CqlZj2V5.js → Cron-ltjSoTjj.js} +1 -1
- package/dist/assets/CronManager-BcFALDeT.js +1 -0
- package/dist/assets/{Database-BYZ8LJb5.js → Database-CV2yt5O2.js} +2 -2
- package/dist/assets/{Diagnostics-Dk1ErNCF.js → Diagnostics-D-EK4GEi.js} +1 -1
- package/dist/assets/Dlq-fZAKwQoC.js +1 -0
- package/dist/assets/DlqControl-eTrrQCrn.js +1 -0
- package/dist/assets/{DlqPro-D8DOy5MI.js → DlqPro-CF79339e.js} +1 -1
- package/dist/assets/{Flows-DP9-h7a0.js → Flows-Ba8G7mcC.js} +1 -1
- package/dist/assets/JobInspector--d_8ca9p.js +2 -0
- package/dist/assets/Jobs-DEqAc1A5.js +1 -0
- package/dist/assets/JobsPro-BcaokZIf.js +1 -0
- package/dist/assets/Logs-DBTukPIX.js +1 -0
- package/dist/assets/LogsPro-Wl_e6hZM.js +1 -0
- package/dist/assets/{McpServer-MfQ0qsAI.js → McpServer-CnWJsKw7.js} +1 -1
- package/dist/assets/{Metrics-C4Dwg_DP.js → Metrics-DzeIhNL-.js} +1 -1
- package/dist/assets/{MetricsPro-Bt9zLjkN.js → MetricsPro-O9eVJSH0.js} +1 -1
- package/dist/assets/Overview-Bnu7rWqt.js +1 -0
- package/dist/assets/{Pagination-BQg6KGW1.js → Pagination-D4ki-pGz.js} +1 -1
- package/dist/assets/QueueActions-DHoSkWRz.js +1 -0
- package/dist/assets/QueueControl-DKqEXnkM.js +1 -0
- package/dist/assets/{QueueDetail-wjRLlCYY.js → QueueDetail-DLRow04B.js} +1 -1
- package/dist/assets/QueueDetailPro-BYmOVd4T.js +1 -0
- package/dist/assets/Queues-CoyjRFN7.js +1 -0
- package/dist/assets/{QueuesOverview-DfRqAfS1.js → QueuesOverview-BeWdJpKi.js} +1 -1
- package/dist/assets/{S3Backup-UQ_HKrn0.js → S3Backup-BaLFgl9d.js} +1 -1
- package/dist/assets/{S3BackupPro-V3JNhUK8.js → S3BackupPro-DJB4oWgz.js} +1 -1
- package/dist/assets/{ServerControl-DXidWdsq.js → ServerControl-_0lVB33E.js} +1 -1
- package/dist/assets/{Settings-0j8DZK9n.js → Settings-zKFJTtnq.js} +1 -1
- package/dist/assets/Usage-CKGkvl0j.js +1 -0
- package/dist/assets/{UsagePro-CbVFCD3J.js → UsagePro-B-TJ6fp4.js} +1 -1
- package/dist/assets/{Webhooks-Dr0oBZr9.js → Webhooks-C3zmvY-_.js} +1 -1
- package/dist/assets/{Workers-Bwil4zIU.js → Workers-jKhhXl3W.js} +1 -1
- package/dist/assets/{WorkersPro-BRYPAhyx.js → WorkersPro-mvY5VX8I.js} +1 -1
- package/dist/assets/{connectionStore-B-hNUqwK.js → connectionStore-Ci04lJmR.js} +1 -1
- package/dist/assets/dist-1f1fMHVO.js +11 -0
- package/dist/assets/dist-BlWBaCN6.js +11 -0
- package/dist/assets/dist-DZL8soAh.js +79 -0
- package/dist/assets/dist-DjvZiKhB.js +2 -0
- package/dist/assets/dist-DpZcbP9W.js +11 -0
- package/dist/assets/{form-C-zZyKfB.js → form-DGinTEEb.js} +1 -1
- package/dist/assets/index-BOcegTHa.js +8 -0
- package/dist/assets/index-DWV3tgrk.css +1 -0
- package/dist/assets/{react-vendor-B68RYDeC.js → react-vendor-BcouBxpZ.js} +2 -2
- package/dist/assets/{useThroughputSeries-defI_JpV.js → useThroughputSeries-Chp5OLx3.js} +1 -1
- package/dist/index.html +4 -4
- package/package.json +5 -5
- package/scripts/embedded.gen.ts +122 -112
- package/scripts/serve.ts +11 -0
- package/dist/assets/CopilotPanel-BJeJYfaz.js +0 -152
- package/dist/assets/CronManager-C6kjWCLE.js +0 -1
- package/dist/assets/Dlq-DANXiXsm.js +0 -1
- package/dist/assets/DlqControl-DUturU7q.js +0 -1
- package/dist/assets/JobInspector-BHZtkFL6.js +0 -2
- package/dist/assets/Jobs-Bgr-HRmL.js +0 -1
- package/dist/assets/JobsPro-C2Vc2iRC.js +0 -1
- package/dist/assets/Logs-CaOn3IpL.js +0 -1
- package/dist/assets/LogsPro-BpSZaHzN.js +0 -1
- package/dist/assets/Overview-BO3xG6I0.js +0 -1
- package/dist/assets/QueueActions-Bez_iOjl.js +0 -1
- package/dist/assets/QueueControl-CEXlJDkE.js +0 -1
- package/dist/assets/QueueDetailPro-CuVyxX4Z.js +0 -1
- package/dist/assets/Queues-2W2E6e5R.js +0 -1
- package/dist/assets/Usage-C5DsZvR5.js +0 -1
- package/dist/assets/index-BjRjwWwc.js +0 -8
- package/dist/assets/index-mF63w920.css +0 -1
package/agent/db.ts
CHANGED
|
@@ -436,24 +436,28 @@ function translateError(e: unknown): Error {
|
|
|
436
436
|
/**
|
|
437
437
|
* Time-boxed, off-thread execution of an arbitrary query. Spawns a disposable
|
|
438
438
|
* readonly Worker and races it against QUERY_TIMEOUT_MS so a runaway scan can't
|
|
439
|
-
* freeze the agent's control endpoints.
|
|
440
|
-
* Worker cannot be created (e.g. a compiled single-file binary) — still bounded
|
|
441
|
-
* in memory and statement type, just not interruptible.
|
|
439
|
+
* freeze the agent's control endpoints.
|
|
442
440
|
*/
|
|
441
|
+
let queryWorkerUrl = new URL('./dbQueryWorker.ts', import.meta.url).href;
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* The standalone executable's bundle root is scripts/serve.ts, so it supplies
|
|
445
|
+
* the embedded worker URL relative to that entrypoint. Source-mode agent runs
|
|
446
|
+
* keep the module-relative default above.
|
|
447
|
+
*/
|
|
448
|
+
export function setQueryWorkerUrl(url: string): void {
|
|
449
|
+
queryWorkerUrl = url;
|
|
450
|
+
}
|
|
451
|
+
|
|
443
452
|
export async function queryWithTimeout(path: string, sql: string): Promise<DbQueryResult> {
|
|
444
453
|
let worker: Worker;
|
|
445
454
|
try {
|
|
446
|
-
worker = new Worker(
|
|
447
|
-
} catch {
|
|
448
|
-
|
|
455
|
+
worker = new Worker(queryWorkerUrl, { type: 'module' });
|
|
456
|
+
} catch (e) {
|
|
457
|
+
throw new Error(`Query worker unavailable: ${(e as Error).message ?? String(e)}`);
|
|
449
458
|
}
|
|
450
459
|
try {
|
|
451
460
|
return await new Promise<DbQueryResult>((resolve, reject) => {
|
|
452
|
-
// The Worker module is not always available at runtime — notably a
|
|
453
|
-
// `bun build --compile` single-file binary does not embed it, and there
|
|
454
|
-
// `new Worker(...)` does NOT throw synchronously: it resolves and then
|
|
455
|
-
// fails asynchronously via the `error` event (ModuleNotFound). Guard both
|
|
456
|
-
// paths and degrade to a synchronous run rather than failing the request.
|
|
457
461
|
let settled = false;
|
|
458
462
|
const timer = setTimeout(() => {
|
|
459
463
|
if (settled) return;
|
|
@@ -473,15 +477,8 @@ export async function queryWithTimeout(path: string, sql: string): Promise<DbQue
|
|
|
473
477
|
if (settled) return;
|
|
474
478
|
settled = true;
|
|
475
479
|
clearTimeout(timer);
|
|
476
|
-
// Worker infra itself failed to load/run (e.g. not embedded in the
|
|
477
|
-
// compiled binary). Fall back to the synchronous path — still readonly,
|
|
478
|
-
// allowlisted and row-capped, just not interruptible by the wall clock.
|
|
479
480
|
ev.preventDefault?.();
|
|
480
|
-
|
|
481
|
-
resolve(dbQuery(path, sql));
|
|
482
|
-
} catch (e) {
|
|
483
|
-
reject(translateError(e));
|
|
484
|
-
}
|
|
481
|
+
reject(new Error(`Query worker failed: ${ev.message || 'unknown worker error'}`));
|
|
485
482
|
});
|
|
486
483
|
worker.postMessage({ path, sql });
|
|
487
484
|
});
|
package/agent/server.ts
CHANGED
|
@@ -180,10 +180,10 @@ export function createFetchHandler(mgr: ProcessManager, opts: AgentOptions) {
|
|
|
180
180
|
// GETs (including the /db/* inspector, which can expose job payloads) are
|
|
181
181
|
// protected by the Origin allowlist alone — a drive-by cross-origin page
|
|
182
182
|
// can't read the response (no ACAO for its origin), which is the real
|
|
183
|
-
// threat.
|
|
184
|
-
//
|
|
185
|
-
//
|
|
186
|
-
//
|
|
183
|
+
// threat. Reads intentionally remain available without a token for local
|
|
184
|
+
// dashboards that don't configure AGENT_TOKEN; when a token is configured,
|
|
185
|
+
// the browser client does send it, but only POST/PUT require it.
|
|
186
|
+
// Non-browser local callers on loopback are trusted for reads.
|
|
187
187
|
const mutating = method === 'POST' || method === 'PUT';
|
|
188
188
|
if (mutating && !tokenOk(req, token)) {
|
|
189
189
|
return json({ ok: false, error: 'Unauthorized' }, 401, origin);
|