@warlock.js/devtools 5.57.0 → 5.59.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/CHANGELOG.md +23 -0
- package/README.md +3 -0
- package/cjs/{ai-source-DTpxumMA.cjs → ai-source-BdvMfyKw.cjs} +84 -17
- package/cjs/ai-source-BdvMfyKw.cjs.map +1 -0
- package/cjs/app-versions-DfpPZOI2.cjs +253 -0
- package/cjs/app-versions-DfpPZOI2.cjs.map +1 -0
- package/cjs/{auth-DzU0gHDG.cjs → auth-B3wyjJnQ.cjs} +43 -406
- package/cjs/auth-B3wyjJnQ.cjs.map +1 -0
- package/cjs/{boot-Dy5OqgTM.cjs → boot-nczSvJ_F.cjs} +15 -12
- package/cjs/boot-nczSvJ_F.cjs.map +1 -0
- package/cjs/{capture-CqIiaznN.cjs → capture-CuyT8Vab.cjs} +4 -4
- package/cjs/{capture-CqIiaznN.cjs.map → capture-CuyT8Vab.cjs.map} +1 -1
- package/cjs/{cascade-store-pHjKeSFm.cjs → cascade-store-CuRRYzt_.cjs} +141 -4
- package/cjs/cascade-store-CuRRYzt_.cjs.map +1 -0
- package/cjs/{current-request-id-BoJJb3y7.cjs → current-request-id-CeQhRz9Q.cjs} +3 -3
- package/cjs/{current-request-id-BoJJb3y7.cjs.map → current-request-id-CeQhRz9Q.cjs.map} +1 -1
- package/cjs/{errors-CyZp5yS-.cjs → errors-BadbSDX8.cjs} +6 -4
- package/cjs/errors-BadbSDX8.cjs.map +1 -0
- package/cjs/helpers-BcMBFy9v.cjs +439 -0
- package/cjs/helpers-BcMBFy9v.cjs.map +1 -0
- package/cjs/{histogram-BaI-PnCv.cjs → histogram-DTOGnNBW.cjs} +6 -6
- package/cjs/{histogram-BaI-PnCv.cjs.map → histogram-DTOGnNBW.cjs.map} +1 -1
- package/cjs/{http-DCfXQvw-.cjs → http-Biauhqi0.cjs} +517 -28
- package/cjs/http-Biauhqi0.cjs.map +1 -0
- package/cjs/index.cjs +1 -1
- package/cjs/{insights-BKtqxdnP.cjs → insights-BjJA6Ret.cjs} +8 -7
- package/cjs/{insights-BKtqxdnP.cjs.map → insights-BjJA6Ret.cjs.map} +1 -1
- package/cjs/{migrations-w7GMsrQw.cjs → migrations-BP4cYTGo.cjs} +40 -5
- package/cjs/migrations-BP4cYTGo.cjs.map +1 -0
- package/cjs/{options-CWqFC5__.cjs → options-B9FHbRAJ.cjs} +29 -5
- package/cjs/options-B9FHbRAJ.cjs.map +1 -0
- package/cjs/{panels-Rcmeitu3.cjs → panels-D1ITm-jc.cjs} +77 -11
- package/cjs/panels-D1ITm-jc.cjs.map +1 -0
- package/cjs/{process-panel-DEOnLxoT.cjs → process-panel-DskSA7Cm.cjs} +4 -4
- package/cjs/{process-panel-DEOnLxoT.cjs.map → process-panel-DskSA7Cm.cjs.map} +1 -1
- package/cjs/production/index.cjs +4 -4
- package/cjs/{server-ykxsOwob.cjs → server-D3XRbSSb.cjs} +8 -5
- package/cjs/server-D3XRbSSb.cjs.map +1 -0
- package/cjs/{src-UPtTCI2j.cjs → src-QcNghoYN.cjs} +52 -15
- package/cjs/src-QcNghoYN.cjs.map +1 -0
- package/cjs/{store-aq207T8v.cjs → store-CNFv3wVp.cjs} +2 -2
- package/cjs/{stream-route-CJTABkUy.cjs → stream-route-BqyAlfxQ.cjs} +92 -17
- package/cjs/stream-route-BqyAlfxQ.cjs.map +1 -0
- package/esm/app-versions.mjs +74 -0
- package/esm/app-versions.mjs.map +1 -0
- package/esm/devtools-connector.d.mts.map +1 -1
- package/esm/devtools-connector.mjs +10 -3
- package/esm/devtools-connector.mjs.map +1 -1
- package/esm/index.d.mts +3 -3
- package/esm/panel-errors.mjs +33 -0
- package/esm/panel-errors.mjs.map +1 -0
- package/esm/panels.mjs +73 -6
- package/esm/panels.mjs.map +1 -1
- package/esm/production/auth/helpers.mjs +8 -5
- package/esm/production/auth/helpers.mjs.map +1 -1
- package/esm/production/auth/service.mjs +15 -5
- package/esm/production/auth/service.mjs.map +1 -1
- package/esm/production/boot.mjs +5 -2
- package/esm/production/boot.mjs.map +1 -1
- package/esm/production/contracts.d.mts +75 -2
- package/esm/production/contracts.d.mts.map +1 -1
- package/esm/production/contracts.mjs +5 -1
- package/esm/production/contracts.mjs.map +1 -1
- package/esm/production/errors.d.mts +1 -1
- package/esm/production/errors.mjs +5 -3
- package/esm/production/errors.mjs.map +1 -1
- package/esm/production/http/access.mjs +6 -2
- package/esm/production/http/access.mjs.map +1 -1
- package/esm/production/http/constants.mjs +7 -1
- package/esm/production/http/constants.mjs.map +1 -1
- package/esm/production/http/context.mjs.map +1 -1
- package/esm/production/http/cookie.mjs +23 -2
- package/esm/production/http/cookie.mjs.map +1 -1
- package/esm/production/http/mount.mjs +25 -3
- package/esm/production/http/mount.mjs.map +1 -1
- package/esm/production/http/share-session.mjs +114 -0
- package/esm/production/http/share-session.mjs.map +1 -0
- package/esm/production/http/share.mjs +339 -0
- package/esm/production/http/share.mjs.map +1 -0
- package/esm/production/index.d.mts +2 -2
- package/esm/production/insights/writer.mjs +2 -1
- package/esm/production/insights/writer.mjs.map +1 -1
- package/esm/production/options.d.mts +10 -1
- package/esm/production/options.d.mts.map +1 -1
- package/esm/production/options.mjs +27 -3
- package/esm/production/options.mjs.map +1 -1
- package/esm/production/store/cascade-store.mjs +49 -2
- package/esm/production/store/cascade-store.mjs.map +1 -1
- package/esm/production/store/mapping.mjs +29 -1
- package/esm/production/store/mapping.mjs.map +1 -1
- package/esm/production/store/memory-store.mjs +62 -0
- package/esm/production/store/memory-store.mjs.map +1 -1
- package/esm/production/store/migrations.d.mts +2 -1
- package/esm/production/store/migrations.d.mts.map +1 -1
- package/esm/production/store/migrations.mjs +5 -2
- package/esm/production/store/migrations.mjs.map +1 -1
- package/esm/production/store/models/index.mjs +3 -1
- package/esm/production/store/models/share.migration.mjs +27 -0
- package/esm/production/store/models/share.migration.mjs.map +1 -0
- package/esm/production/store/models/share.model.mjs +13 -0
- package/esm/production/store/models/share.model.mjs.map +1 -0
- package/esm/server/ai-routes.mjs +20 -6
- package/esm/server/ai-routes.mjs.map +1 -1
- package/esm/server/panel-files.mjs +35 -0
- package/esm/server/panel-files.mjs.map +1 -0
- package/esm/server/panel-routes.mjs +27 -7
- package/esm/server/panel-routes.mjs.map +1 -1
- package/esm/server/session-routes.mjs +4 -1
- package/esm/server/session-routes.mjs.map +1 -1
- package/esm/sources/ai-source.d.mts.map +1 -1
- package/esm/sources/ai-source.mjs +75 -7
- package/esm/sources/ai-source.mjs.map +1 -1
- package/esm/types.d.mts +91 -3
- package/esm/types.d.mts.map +1 -1
- package/llms-full.txt +57 -19
- package/package.json +8 -8
- package/skills/SKILL.md +57 -19
- package/ui/dashboard/assets/app.css +1 -1
- package/ui/dashboard/assets/app.js +16 -16
- package/ui/dashboard/build-info.json +7 -7
- package/cjs/ai-source-DTpxumMA.cjs.map +0 -1
- package/cjs/auth-DzU0gHDG.cjs.map +0 -1
- package/cjs/boot-Dy5OqgTM.cjs.map +0 -1
- package/cjs/cascade-store-pHjKeSFm.cjs.map +0 -1
- package/cjs/contracts-CVmplkNb.cjs +0 -112
- package/cjs/contracts-CVmplkNb.cjs.map +0 -1
- package/cjs/errors-CyZp5yS-.cjs.map +0 -1
- package/cjs/http-DCfXQvw-.cjs.map +0 -1
- package/cjs/migrations-w7GMsrQw.cjs.map +0 -1
- package/cjs/options-CWqFC5__.cjs.map +0 -1
- package/cjs/panels-Rcmeitu3.cjs.map +0 -1
- package/cjs/rolldown-runtime-Zuuoy_Rh.cjs +0 -52
- package/cjs/server-ykxsOwob.cjs.map +0 -1
- package/cjs/src-UPtTCI2j.cjs.map +0 -1
- package/cjs/stream-route-CJTABkUy.cjs.map +0 -1
package/esm/types.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DevtoolsAgentTraceEvent } from "./sources/agent-trace-source.mjs";
|
|
2
2
|
import { DevtoolsAiEvent } from "./sources/ai-source.mjs";
|
|
3
|
-
import { DEVTOOLS_BUILT_IN_PANELS, DEVTOOLS_FAILURE_AUDIT_TYPES, DEVTOOLS_LATENCY_BUCKETS_MS, DevtoolsAccountView, DevtoolsApiErrorBody, DevtoolsAuditEntry, DevtoolsAuditType, DevtoolsAuthStepResult, DevtoolsBuiltInPanelId, DevtoolsCaptureCounters, DevtoolsCreatedInvite, DevtoolsErrorCode, DevtoolsErrorGroup, DevtoolsErrorsView, DevtoolsExplainResult, DevtoolsHealthReport, DevtoolsHealthView, DevtoolsHistogram, DevtoolsInstanceInfo, DevtoolsInstanceReport, DevtoolsInstancesView, DevtoolsInviteView, DevtoolsJobsReport, DevtoolsJobsView, DevtoolsLogRow, DevtoolsLoginInput, DevtoolsLogsView, DevtoolsMode, DevtoolsPanelInfo, DevtoolsPasswordSource, DevtoolsQueryShapeRow, DevtoolsQueryShapeStats, DevtoolsQueryStatsView, DevtoolsRecoveryCodes, DevtoolsReportLogEntry, DevtoolsResourcePoint, DevtoolsResourceSnapshot, DevtoolsResourcesView, DevtoolsRole, DevtoolsRoutePhaseStats, DevtoolsRouteStats, DevtoolsRouteStatsRow, DevtoolsRouteStatsView, DevtoolsSampleDetail, DevtoolsSampleQuery, DevtoolsSampleSummary, DevtoolsScheduleInfo, DevtoolsSessionInfo, DevtoolsSessionStage, DevtoolsSessionView, DevtoolsTotpEnrolment, DevtoolsUserListView } from "./production/contracts.mjs";
|
|
3
|
+
import { DEVTOOLS_BUILT_IN_PANELS, DEVTOOLS_FAILURE_AUDIT_TYPES, DEVTOOLS_LATENCY_BUCKETS_MS, DEVTOOLS_SHARE_LABEL_MAX, DevtoolsAccountView, DevtoolsApiErrorBody, DevtoolsAuditEntry, DevtoolsAuditType, DevtoolsAuthStepResult, DevtoolsBuiltInPanelId, DevtoolsCaptureCounters, DevtoolsCreatedInvite, DevtoolsCreatedShare, DevtoolsErrorCode, DevtoolsErrorGroup, DevtoolsErrorsView, DevtoolsExplainResult, DevtoolsHealthReport, DevtoolsHealthView, DevtoolsHistogram, DevtoolsInstanceInfo, DevtoolsInstanceReport, DevtoolsInstancesView, DevtoolsInviteView, DevtoolsJobsReport, DevtoolsJobsView, DevtoolsLogRow, DevtoolsLoginInput, DevtoolsLogsView, DevtoolsMode, DevtoolsPanelInfo, DevtoolsPasswordSource, DevtoolsQueryShapeRow, DevtoolsQueryShapeStats, DevtoolsQueryStatsView, DevtoolsRecoveryCodes, DevtoolsReportLogEntry, DevtoolsResourcePoint, DevtoolsResourceSnapshot, DevtoolsResourcesView, DevtoolsRole, DevtoolsRoutePhaseStats, DevtoolsRouteStats, DevtoolsRouteStatsRow, DevtoolsRouteStatsView, DevtoolsSampleDetail, DevtoolsSampleQuery, DevtoolsSampleSummary, DevtoolsScheduleInfo, DevtoolsSessionInfo, DevtoolsSessionStage, DevtoolsSessionView, DevtoolsShareCreateInput, DevtoolsShareList, DevtoolsShareOpenAnswer, DevtoolsShareStatus, DevtoolsShareView, DevtoolsTotpEnrolment, DevtoolsUserListView } from "./production/contracts.mjs";
|
|
4
4
|
import { RequestLogRecord } from "@warlock.js/core";
|
|
5
5
|
//#region ../../packages/devtools/src/types.d.ts
|
|
6
6
|
/**
|
|
@@ -181,10 +181,19 @@ export type DevtoolsProductionOptions = {
|
|
|
181
181
|
};
|
|
182
182
|
/**
|
|
183
183
|
* Who must use a second factor (an authenticator app or a passkey).
|
|
184
|
+
* `"off"` requires nobody: users may still add a factor, and an account
|
|
185
|
+
* that has one is always asked for it. Boot logs a warning when it is off.
|
|
184
186
|
*
|
|
185
187
|
* @default "admins"
|
|
186
188
|
*/
|
|
187
|
-
twoFactor?: "admins" | "everyone";
|
|
189
|
+
twoFactor?: "off" | "admins" | "everyone";
|
|
190
|
+
/** Password rules for accounts, invites and the first admin. */
|
|
191
|
+
passwords?: {
|
|
192
|
+
/** Shortest password, in characters; 8 or more. @default 8 */
|
|
193
|
+
minLength?: number;
|
|
194
|
+
/** Refuse passwords from the built-in common list. @default true */
|
|
195
|
+
rejectCommon?: boolean;
|
|
196
|
+
};
|
|
188
197
|
/** Failed sign-in limits, counted over the audit log in a sliding window. */
|
|
189
198
|
rateLimits?: {
|
|
190
199
|
/** @default 15 */
|
|
@@ -236,6 +245,18 @@ export type DevtoolsProductionOptions = {
|
|
|
236
245
|
/** The WebAuthn relying party id. @default the host of `origin`, else of the request */
|
|
237
246
|
rpId?: string;
|
|
238
247
|
};
|
|
248
|
+
/**
|
|
249
|
+
* Read-only share links: an admin creates a link to a panel that declares
|
|
250
|
+
* `share` (the Grimoire product map), and anyone holding the link sees that
|
|
251
|
+
* view without an account. Off unless `enabled` is `true`. Needs the
|
|
252
|
+
* `devtools_shares` table (in `devtoolsMigrations`).
|
|
253
|
+
*/
|
|
254
|
+
share?: {
|
|
255
|
+
/** @default false */
|
|
256
|
+
enabled?: boolean;
|
|
257
|
+
/** The longest life an admin may give a link, in days (1–365). @default 30 */
|
|
258
|
+
maxDays?: number;
|
|
259
|
+
};
|
|
239
260
|
};
|
|
240
261
|
/** `DevtoolsOptions` with every default applied. */
|
|
241
262
|
export type ResolvedDevtoolsOptions = Required<Pick<DevtoolsOptions, "path" | "maxRequests" | "nPlusOneThreshold">> & Pick<DevtoolsOptions, "allowedHosts" | "allowProxied" | "panels" | "production">;
|
|
@@ -249,6 +270,13 @@ export type DevtoolsPanelRequest = {
|
|
|
249
270
|
query: Readonly<Record<string, string | readonly string[]>>;
|
|
250
271
|
/** The parsed request body; `undefined` when there is none. */
|
|
251
272
|
body: unknown;
|
|
273
|
+
/**
|
|
274
|
+
* `true` when the request came through a read-only share link (no signed-in
|
|
275
|
+
* user). Only the routes listed in the panel's `share.routes` are reached
|
|
276
|
+
* this way; leave developer detail (file paths, code, test names) out of
|
|
277
|
+
* the answer. Absent for every other request.
|
|
278
|
+
*/
|
|
279
|
+
shared?: boolean;
|
|
252
280
|
};
|
|
253
281
|
/**
|
|
254
282
|
* One data route of a panel, served at `<path>/api/<panel id><route path>`
|
|
@@ -295,6 +323,61 @@ export type DevtoolsPanel = {
|
|
|
295
323
|
* `import "./graph.js"`. Names are plain file names (no folders).
|
|
296
324
|
*/
|
|
297
325
|
assets?: Readonly<Record<string, string | URL>>;
|
|
326
|
+
/**
|
|
327
|
+
* A folder of images the view shows, served at
|
|
328
|
+
* `<path>/panels/<id>/files/<path inside the folder>`. Only the listed
|
|
329
|
+
* extensions are served; a path that leaves the folder answers 404.
|
|
330
|
+
*/
|
|
331
|
+
files?: DevtoolsPanelFiles;
|
|
332
|
+
/**
|
|
333
|
+
* What a read-only share link of the panel opens (production monitor with
|
|
334
|
+
* `production.share.enabled`). Without it the panel cannot be shared.
|
|
335
|
+
*/
|
|
336
|
+
share?: DevtoolsPanelShare;
|
|
337
|
+
};
|
|
338
|
+
/** A panel's folder of images (`DevtoolsPanel.files`). */
|
|
339
|
+
export type DevtoolsPanelFiles = {
|
|
340
|
+
/** The folder: an absolute path or a `file:` URL. A missing folder serves nothing. */
|
|
341
|
+
dir: string | URL;
|
|
342
|
+
/**
|
|
343
|
+
* Lower-case extensions served.
|
|
344
|
+
*
|
|
345
|
+
* @default [".png", ".jpg", ".jpeg", ".webp", ".gif"]
|
|
346
|
+
*/
|
|
347
|
+
extensions?: readonly string[];
|
|
348
|
+
};
|
|
349
|
+
/** What a share link of a panel opens (`DevtoolsPanel.share`). */
|
|
350
|
+
export type DevtoolsPanelShare = {
|
|
351
|
+
/**
|
|
352
|
+
* The view module of the shared page: a browser ES module whose default
|
|
353
|
+
* export renders like `view`, called with `context.shared === true`.
|
|
354
|
+
*/
|
|
355
|
+
view: string | URL;
|
|
356
|
+
/**
|
|
357
|
+
* Paths of the panel's GET routes the shared page may call, as written in
|
|
358
|
+
* `routes` (`"/product"`, `"/product/features/:feature"`). Every other
|
|
359
|
+
* route answers 404 through a share link.
|
|
360
|
+
*/
|
|
361
|
+
routes: readonly string[];
|
|
362
|
+
/** Served names from `assets` the shared page may load. @default [] */
|
|
363
|
+
assets?: readonly string[];
|
|
364
|
+
/** Whether the shared page may load images from `files`. @default false */
|
|
365
|
+
files?: boolean;
|
|
366
|
+
};
|
|
367
|
+
/**
|
|
368
|
+
* One error group as a panel sees it: counts only, no message or stack
|
|
369
|
+
* (`DevtoolsPanelFactoryContext.errors`).
|
|
370
|
+
*/
|
|
371
|
+
export type DevtoolsPanelErrorSummary = {
|
|
372
|
+
/** The route pattern the error happened on (`/products/:id`), or `null` outside a request. */
|
|
373
|
+
route: string | null;
|
|
374
|
+
status: number | null;
|
|
375
|
+
/** The error class name when known (`TypeError`). */
|
|
376
|
+
name: string | null;
|
|
377
|
+
source: "request" | "log";
|
|
378
|
+
count: number;
|
|
379
|
+
firstSeen: number;
|
|
380
|
+
lastSeen: number;
|
|
298
381
|
};
|
|
299
382
|
/** One `panels` entry: a module specifier, a ready panel, or `[specifier, options]` to pass options to the module's factory. */
|
|
300
383
|
export type DevtoolsPanelEntry = string | DevtoolsPanel | readonly [specifier: string, options: Readonly<Record<string, unknown>>];
|
|
@@ -307,6 +390,11 @@ export type DevtoolsPanelFactoryContext = {
|
|
|
307
390
|
* or run anything costly per request. Absent means `development`.
|
|
308
391
|
*/
|
|
309
392
|
mode?: DevtoolsMode;
|
|
393
|
+
/**
|
|
394
|
+
* The captured error groups of the last hour (every instance in
|
|
395
|
+
* production), counts only. Absent when the monitor captures no errors.
|
|
396
|
+
*/
|
|
397
|
+
errors?: () => Promise<readonly DevtoolsPanelErrorSummary[]>;
|
|
310
398
|
};
|
|
311
399
|
/** One panel or several. */
|
|
312
400
|
export type DevtoolsPanels = DevtoolsPanel | readonly DevtoolsPanel[];
|
|
@@ -534,5 +622,5 @@ export type DevtoolsCollector = {
|
|
|
534
622
|
clear(): void;
|
|
535
623
|
};
|
|
536
624
|
//#endregion
|
|
537
|
-
export type { DEVTOOLS_BUILT_IN_PANELS, DEVTOOLS_FAILURE_AUDIT_TYPES, DEVTOOLS_LATENCY_BUCKETS_MS, DevtoolsAccountView, DevtoolsApiErrorBody, DevtoolsAuditEntry, DevtoolsAuditType, DevtoolsAuthStepResult, DevtoolsBuiltInPanelId, DevtoolsCaptureCounters, DevtoolsCreatedInvite, DevtoolsErrorCode, DevtoolsErrorGroup, DevtoolsErrorsView, DevtoolsExplainResult, DevtoolsHealthReport, DevtoolsHealthView, DevtoolsHistogram, DevtoolsInstanceInfo, DevtoolsInstanceReport, DevtoolsInstancesView, DevtoolsInviteView, DevtoolsJobsReport, DevtoolsJobsView, DevtoolsLogRow, DevtoolsLoginInput, DevtoolsLogsView, DevtoolsMode, DevtoolsPanelInfo, DevtoolsPasswordSource, DevtoolsQueryShapeRow, DevtoolsQueryShapeStats, DevtoolsQueryStatsView, DevtoolsRecoveryCodes, DevtoolsReportLogEntry, DevtoolsResourcePoint, DevtoolsResourceSnapshot, DevtoolsResourcesView, DevtoolsRole, DevtoolsRoutePhaseStats, DevtoolsRouteStats, DevtoolsRouteStatsRow, DevtoolsRouteStatsView, DevtoolsSampleDetail, DevtoolsSampleQuery, DevtoolsSampleSummary, DevtoolsScheduleInfo, DevtoolsSessionInfo, DevtoolsSessionStage, DevtoolsSessionView, DevtoolsTotpEnrolment, DevtoolsUserListView };
|
|
625
|
+
export type { DEVTOOLS_BUILT_IN_PANELS, DEVTOOLS_FAILURE_AUDIT_TYPES, DEVTOOLS_LATENCY_BUCKETS_MS, DEVTOOLS_SHARE_LABEL_MAX, DevtoolsAccountView, DevtoolsApiErrorBody, DevtoolsAuditEntry, DevtoolsAuditType, DevtoolsAuthStepResult, DevtoolsBuiltInPanelId, DevtoolsCaptureCounters, DevtoolsCreatedInvite, DevtoolsCreatedShare, DevtoolsErrorCode, DevtoolsErrorGroup, DevtoolsErrorsView, DevtoolsExplainResult, DevtoolsHealthReport, DevtoolsHealthView, DevtoolsHistogram, DevtoolsInstanceInfo, DevtoolsInstanceReport, DevtoolsInstancesView, DevtoolsInviteView, DevtoolsJobsReport, DevtoolsJobsView, DevtoolsLogRow, DevtoolsLoginInput, DevtoolsLogsView, DevtoolsMode, DevtoolsPanelInfo, DevtoolsPasswordSource, DevtoolsQueryShapeRow, DevtoolsQueryShapeStats, DevtoolsQueryStatsView, DevtoolsRecoveryCodes, DevtoolsReportLogEntry, DevtoolsResourcePoint, DevtoolsResourceSnapshot, DevtoolsResourcesView, DevtoolsRole, DevtoolsRoutePhaseStats, DevtoolsRouteStats, DevtoolsRouteStatsRow, DevtoolsRouteStatsView, DevtoolsSampleDetail, DevtoolsSampleQuery, DevtoolsSampleSummary, DevtoolsScheduleInfo, DevtoolsSessionInfo, DevtoolsSessionStage, DevtoolsSessionView, DevtoolsShareCreateInput, DevtoolsShareList, DevtoolsShareOpenAnswer, DevtoolsShareStatus, DevtoolsShareView, DevtoolsTotpEnrolment, DevtoolsUserListView };
|
|
538
626
|
//# sourceMappingURL=types.d.mts.map
|
package/esm/types.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.mts","names":[],"sources":["../../../../../../../packages/devtools/src/types.ts"],"mappings":";;;;;;;;;;;;;;YAiBY;;;;;;EAMV;;;;;;EAMA;;;;;;;EAOA;;;;;;;;;;EAUA;;;;;;;;;EASA;;;;;;;;;;;;EAYA,kBAAkB;;;;;;;;;;;EAWlB,aAAa;;;;;;;YAQH;;;;;;;EAOV;;;;;;;EAOA;;;;;;;EAOA;;;;;;EAMA;;;;;;;EAOA;;;;;;EAMA;;;;;;EAMA;;;;;;;EAOA;;;;;;;EAOA;;;;;;;;;EASA;;;;;;;EAOA;;;;;;;EAOA;;;;;;;;EAQA;;EAEA;;IAEE;;IAEA
|
|
1
|
+
{"version":3,"file":"types.d.mts","names":[],"sources":["../../../../../../../packages/devtools/src/types.ts"],"mappings":"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"}
|
package/llms-full.txt
CHANGED
|
@@ -105,8 +105,11 @@ An older core without the request log leaves the panel in-memory only.
|
|
|
105
105
|
## AI runs alongside HTTP requests
|
|
106
106
|
|
|
107
107
|
The **AI** tab and each request's **AI runs** section display completed traces
|
|
108
|
-
from optional `@warlock.js/ai-panoptic`. If
|
|
109
|
-
|
|
108
|
+
from optional `@warlock.js/ai-panoptic`. If the tab is empty it says why
|
|
109
|
+
(`/api/ai` answers `reason`: `ai-missing`, `panoptic-missing`, `panoptic-failed` with the load
|
|
110
|
+
error (absolute paths replaced) and versions, `observation-off`, or `not-collected` in the
|
|
111
|
+
production dashboard, which never collects AI runs) with a title, one line and a copyable command; the
|
|
112
|
+
other panels keep working.
|
|
110
113
|
|
|
111
114
|
```bash
|
|
112
115
|
warlock add devtools
|
|
@@ -282,7 +285,7 @@ Environment variables:
|
|
|
282
285
|
|
|
283
286
|
The accounts live in the app's database through Cascade. Roles are `viewer`
|
|
284
287
|
and `admin`. Admins invite users with a 24-hour single-use link. Two-factor is
|
|
285
|
-
required for admins by default (`twoFactor: "admins"`; or `"everyone"`): an
|
|
288
|
+
required for admins by default (`twoFactor: "admins"`; or `"everyone"`, or `"off"` for nobody, which logs a boot warning; an account that has a factor is always asked for it): an
|
|
286
289
|
authenticator app, or passkeys when `@simplewebauthn/server` is installed, plus
|
|
287
290
|
10 recovery codes. Every closed case answers the app's own 404.
|
|
288
291
|
|
|
@@ -292,7 +295,7 @@ Options under `production` (all optional, defaults in brackets):
|
|
|
292
295
|
`requestRetentionHours` [24], `maxStoredSamplesPerMinute` [120],
|
|
293
296
|
`reportIntervalMs` [10000], `trustedProxies` [[]], `requireHttps` [true],
|
|
294
297
|
`allowedIps` [[]], `origin`, `session.idleMinutes` [30], `session.maxHours` [8],
|
|
295
|
-
`twoFactor` ["admins"], `rateLimits.windowMinutes` [15], `rateLimits.account`
|
|
298
|
+
`twoFactor` ["admins"], `passwords.minLength` [8, from 8 to 72], `passwords.rejectCommon` [true], `rateLimits.windowMinutes` [15], `rateLimits.account`
|
|
296
299
|
[5], `rateLimits.ip` [20], `rateLimits.global` [100], `rateLimits.lockMinutes`
|
|
297
300
|
[15], `explain.executing` [false], `panels` [{}], `logLevels` [warn, error],
|
|
298
301
|
`auditRetentionDays` [90], `passkeys.rpName`, `passkeys.rpId`.
|
|
@@ -335,24 +338,38 @@ Options under `production` (all optional, defaults in brackets):
|
|
|
335
338
|
`panels: { id: true }`. A package panel needs `production: true` or the same.
|
|
336
339
|
- Panel writes in production need an admin and the `X-Devtools-Csrf` header
|
|
337
340
|
(`api()` adds it); they are audited.
|
|
341
|
+
- Share links: `production.share = { enabled: true, maxDays: 30 }` lets an
|
|
342
|
+
admin (Admin, Share links) give a read-only link to one panel that declares
|
|
343
|
+
`share`. The table `devtools_shares` is in `devtoolsMigrations` (`DT008`
|
|
344
|
+
names it when `share.enabled` and it is missing; `maxDays` is 1 to 365 or
|
|
345
|
+
`DT007`). The URL is `<origin><path>/#/share/<token>`: the token is in the
|
|
346
|
+
fragment, shown once, stored only as a SHA-256 hash, and the page removes it
|
|
347
|
+
from the address bar. Opening it sets the cookie `__Secure-warlock-devtools-share`
|
|
348
|
+
(at most 12 hours, HMAC-signed) that reaches only that panel's `share.routes`,
|
|
349
|
+
`share.assets` and images. A wrong, expired or revoked token, a bad cookie and
|
|
350
|
+
sharing being off all answer the uniform 404; a failed token is audited as
|
|
351
|
+
`share.failed` (counts toward `rateLimits.ip`); `share.created` and
|
|
352
|
+
`share.revoked` are audited too. A revoke reaches every instance within 5 s.
|
|
353
|
+
Not available in development. Tell people not to put the link in tickets or
|
|
354
|
+
chat they do not trust: anyone holding it can read the shared view.
|
|
338
355
|
|
|
339
356
|
### When something fails
|
|
340
357
|
|
|
341
358
|
The app refuses to boot with a `DevtoolsProductionConfigError`
|
|
342
359
|
(`DEVTOOLS_CONFIG_CODES` holds the messages):
|
|
343
360
|
|
|
344
|
-
| Code | Fix
|
|
345
|
-
| ------- |
|
|
346
|
-
| `DT001` | Set `DEVTOOLS_PATH` or `production.path`.
|
|
347
|
-
| `DT002` | Use a path of 8+ characters starting with `/`, with letters, digits and `- _ . ~ /` only; not `/__warlock`.
|
|
348
|
-
| `DT003` | No admin: set `DEVTOOLS_ADMIN_EMAIL` plus a password or setup token, or run `warlock devtools:reset-admin --email <email>`.
|
|
349
|
-
| `DT004` | The env password breaks the rules (
|
|
350
|
-
| `DT005` | Install `@warlock.js/cascade` and configure a database.
|
|
351
|
-
| `DT006` | Set `encryption.key` (64 hex characters).
|
|
352
|
-
| `DT007` | An option is invalid; the message names it.
|
|
353
|
-
| `DT008` | Add `devtoolsMigrations` to `database.migrations` and run `warlock migrate
|
|
354
|
-
| `DT009` | Set the password or the setup token, not both.
|
|
355
|
-
| `DT010` | The setup token needs 32+ characters (`openssl rand -base64 32`).
|
|
361
|
+
| Code | Fix |
|
|
362
|
+
| ------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
363
|
+
| `DT001` | Set `DEVTOOLS_PATH` or `production.path`. |
|
|
364
|
+
| `DT002` | Use a path of 8+ characters starting with `/`, with letters, digits and `- _ . ~ /` only; not `/__warlock`. |
|
|
365
|
+
| `DT003` | No admin: set `DEVTOOLS_ADMIN_EMAIL` plus a password or setup token, or run `warlock devtools:reset-admin --email <email>`. |
|
|
366
|
+
| `DT004` | The env password breaks the rules (`passwords.minLength`+ characters, at most 72 bytes, not common unless `rejectCommon` is false, not the email). |
|
|
367
|
+
| `DT005` | Install `@warlock.js/cascade` and configure a database. |
|
|
368
|
+
| `DT006` | Set `encryption.key` (64 hex characters). |
|
|
369
|
+
| `DT007` | An option is invalid (`share.maxDays` must be 1 to 365); the message names it. |
|
|
370
|
+
| `DT008` | Add `devtoolsMigrations` to `database.migrations` and run `warlock migrate` (`devtools_shares` when sharing is on). |
|
|
371
|
+
| `DT009` | Set the password or the setup token, not both. |
|
|
372
|
+
| `DT010` | The setup token needs 32+ characters (`openssl rand -base64 32`). |
|
|
356
373
|
|
|
357
374
|
Every dashboard URL gives a 404: check that `production.enabled` is true, the
|
|
358
375
|
dashboard is not disabled or locked (`warlock devtools:enable`), the request is
|
|
@@ -415,11 +432,27 @@ export default queuePanel;
|
|
|
415
432
|
headers; in production: sign-in). A reused id (the built-in `processes` included) or a dashboard id
|
|
416
433
|
such as `mail` is refused; devtools logs why and leaves the panel out.
|
|
417
434
|
|
|
435
|
+
- `files: { dir, extensions? }` serves a folder of images at
|
|
436
|
+
`/__warlock/panels/<id>/files/<path>` (default `.png .jpg .jpeg .webp .gif`;
|
|
437
|
+
`.svg`, `.html`, `.htm`, `.js` and `.mjs` are refused when the panel loads;
|
|
438
|
+
`..`, backslashes, absolute paths and links that leave the folder answer
|
|
439
|
+
404). The view builds the URL with `file("login/step-1.png")`.
|
|
440
|
+
- `share: { view, routes, assets?, files? }` (`DevtoolsPanelShare`) declares
|
|
441
|
+
the view a read-only share link opens. `routes` are paths of the panel's GET
|
|
442
|
+
routes; each such route gets `shared: true` in its `DevtoolsPanelRequest`
|
|
443
|
+
and must leave file paths, code, test names and error messages out of its
|
|
444
|
+
answer. The view context also has `shared` and `share` (`{ enabled,
|
|
445
|
+
manageHref }` for an admin when sharing is on, else `null`).
|
|
446
|
+
- The factory also receives `errors()`: the captured error groups of the last
|
|
447
|
+
hour as `DevtoolsPanelErrorSummary[]` (route, status, class name, source,
|
|
448
|
+
count, first and last seen; no message, no stack; every instance in
|
|
449
|
+
production). Call it per request.
|
|
450
|
+
|
|
418
451
|
A panel can set `production: true` when it is safe in the production monitor
|
|
419
452
|
(otherwise it needs `production.panels[id]: true`). The factory receives
|
|
420
|
-
`{ root, mode }`; `mode` is `"development"` or `"production"`, and a panel must
|
|
453
|
+
`{ root, mode, errors }`; `mode` is `"development"` or `"production"`, and a panel must
|
|
421
454
|
not write files in production. The ids `resources`, `health`, `errors`, `jobs`,
|
|
422
|
-
`instances`, `auth`, `account` and `
|
|
455
|
+
`instances`, `auth`, `account`, `admin` and `share` are reserved.
|
|
423
456
|
|
|
424
457
|
Full reference: the "Registering a panel" page of the devtools docs.
|
|
425
458
|
|
|
@@ -427,6 +460,11 @@ Panel styling: a package panel's CSS may use only the dashboard's variables (`DE
|
|
|
427
460
|
`@warlock.js/devtools`: `--background --foreground --card --muted --muted-foreground --accent --border --brand
|
|
428
461
|
--success --warning --info --destructive --chart-1..5` and the other shadcn names) plus variables it defines itself.
|
|
429
462
|
Never use another name (such as `--text` or `--surface`): the dashboard does not define it, and text can become
|
|
430
|
-
unreadable. The text tokens meet 4.5:1 contrast on `--background` and `--card` in both themes.
|
|
463
|
+
unreadable. The text tokens meet 4.5:1 contrast on `--background` and `--card` in both themes. In the light theme `--primary` is the
|
|
464
|
+
gold fill (dark `--primary-foreground` on it) and `--brand` is the deep amber for text; in the dark theme both are gold.
|
|
465
|
+
|
|
466
|
+
The dashboard shows the Warlock logo and installed core version at the top of the sidebar and the app's own
|
|
467
|
+
`package.json` name and version at the bottom. They come from `GET api/auth/session` (`warlockVersion`, `app`), read once
|
|
468
|
+
on the server, signed-in only, `null` when unknown.
|
|
431
469
|
|
|
432
470
|
|
package/package.json
CHANGED
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
},
|
|
7
7
|
"peerDependencies": {
|
|
8
8
|
"@simplewebauthn/server": "^13.1.0",
|
|
9
|
-
"@warlock.js/ai-panoptic": "5.
|
|
10
|
-
"@warlock.js/cache": "5.
|
|
11
|
-
"@warlock.js/cascade": "5.
|
|
12
|
-
"@warlock.js/core": "5.
|
|
13
|
-
"@warlock.js/logger": "5.
|
|
14
|
-
"@warlock.js/queue": "5.
|
|
15
|
-
"@warlock.js/scheduler": "5.
|
|
9
|
+
"@warlock.js/ai-panoptic": "5.59.0",
|
|
10
|
+
"@warlock.js/cache": "5.59.0",
|
|
11
|
+
"@warlock.js/cascade": "5.59.0",
|
|
12
|
+
"@warlock.js/core": "5.59.0",
|
|
13
|
+
"@warlock.js/logger": "5.59.0",
|
|
14
|
+
"@warlock.js/queue": "5.59.0",
|
|
15
|
+
"@warlock.js/scheduler": "5.59.0"
|
|
16
16
|
},
|
|
17
17
|
"peerDependenciesMeta": {
|
|
18
18
|
"@simplewebauthn/server": {
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
],
|
|
53
53
|
"author": "hassanzohdy",
|
|
54
54
|
"license": "MIT",
|
|
55
|
-
"version": "5.
|
|
55
|
+
"version": "5.59.0",
|
|
56
56
|
"main": "./cjs/index.cjs",
|
|
57
57
|
"module": "./esm/index.mjs",
|
|
58
58
|
"types": "./esm/index.d.mts",
|
package/skills/SKILL.md
CHANGED
|
@@ -97,8 +97,11 @@ An older core without the request log leaves the panel in-memory only.
|
|
|
97
97
|
## AI runs alongside HTTP requests
|
|
98
98
|
|
|
99
99
|
The **AI** tab and each request's **AI runs** section display completed traces
|
|
100
|
-
from optional `@warlock.js/ai-panoptic`. If
|
|
101
|
-
|
|
100
|
+
from optional `@warlock.js/ai-panoptic`. If the tab is empty it says why
|
|
101
|
+
(`/api/ai` answers `reason`: `ai-missing`, `panoptic-missing`, `panoptic-failed` with the load
|
|
102
|
+
error (absolute paths replaced) and versions, `observation-off`, or `not-collected` in the
|
|
103
|
+
production dashboard, which never collects AI runs) with a title, one line and a copyable command; the
|
|
104
|
+
other panels keep working.
|
|
102
105
|
|
|
103
106
|
```bash
|
|
104
107
|
warlock add devtools
|
|
@@ -274,7 +277,7 @@ Environment variables:
|
|
|
274
277
|
|
|
275
278
|
The accounts live in the app's database through Cascade. Roles are `viewer`
|
|
276
279
|
and `admin`. Admins invite users with a 24-hour single-use link. Two-factor is
|
|
277
|
-
required for admins by default (`twoFactor: "admins"`; or `"everyone"`): an
|
|
280
|
+
required for admins by default (`twoFactor: "admins"`; or `"everyone"`, or `"off"` for nobody, which logs a boot warning; an account that has a factor is always asked for it): an
|
|
278
281
|
authenticator app, or passkeys when `@simplewebauthn/server` is installed, plus
|
|
279
282
|
10 recovery codes. Every closed case answers the app's own 404.
|
|
280
283
|
|
|
@@ -284,7 +287,7 @@ Options under `production` (all optional, defaults in brackets):
|
|
|
284
287
|
`requestRetentionHours` [24], `maxStoredSamplesPerMinute` [120],
|
|
285
288
|
`reportIntervalMs` [10000], `trustedProxies` [[]], `requireHttps` [true],
|
|
286
289
|
`allowedIps` [[]], `origin`, `session.idleMinutes` [30], `session.maxHours` [8],
|
|
287
|
-
`twoFactor` ["admins"], `rateLimits.windowMinutes` [15], `rateLimits.account`
|
|
290
|
+
`twoFactor` ["admins"], `passwords.minLength` [8, from 8 to 72], `passwords.rejectCommon` [true], `rateLimits.windowMinutes` [15], `rateLimits.account`
|
|
288
291
|
[5], `rateLimits.ip` [20], `rateLimits.global` [100], `rateLimits.lockMinutes`
|
|
289
292
|
[15], `explain.executing` [false], `panels` [{}], `logLevels` [warn, error],
|
|
290
293
|
`auditRetentionDays` [90], `passkeys.rpName`, `passkeys.rpId`.
|
|
@@ -327,24 +330,38 @@ Options under `production` (all optional, defaults in brackets):
|
|
|
327
330
|
`panels: { id: true }`. A package panel needs `production: true` or the same.
|
|
328
331
|
- Panel writes in production need an admin and the `X-Devtools-Csrf` header
|
|
329
332
|
(`api()` adds it); they are audited.
|
|
333
|
+
- Share links: `production.share = { enabled: true, maxDays: 30 }` lets an
|
|
334
|
+
admin (Admin, Share links) give a read-only link to one panel that declares
|
|
335
|
+
`share`. The table `devtools_shares` is in `devtoolsMigrations` (`DT008`
|
|
336
|
+
names it when `share.enabled` and it is missing; `maxDays` is 1 to 365 or
|
|
337
|
+
`DT007`). The URL is `<origin><path>/#/share/<token>`: the token is in the
|
|
338
|
+
fragment, shown once, stored only as a SHA-256 hash, and the page removes it
|
|
339
|
+
from the address bar. Opening it sets the cookie `__Secure-warlock-devtools-share`
|
|
340
|
+
(at most 12 hours, HMAC-signed) that reaches only that panel's `share.routes`,
|
|
341
|
+
`share.assets` and images. A wrong, expired or revoked token, a bad cookie and
|
|
342
|
+
sharing being off all answer the uniform 404; a failed token is audited as
|
|
343
|
+
`share.failed` (counts toward `rateLimits.ip`); `share.created` and
|
|
344
|
+
`share.revoked` are audited too. A revoke reaches every instance within 5 s.
|
|
345
|
+
Not available in development. Tell people not to put the link in tickets or
|
|
346
|
+
chat they do not trust: anyone holding it can read the shared view.
|
|
330
347
|
|
|
331
348
|
### When something fails
|
|
332
349
|
|
|
333
350
|
The app refuses to boot with a `DevtoolsProductionConfigError`
|
|
334
351
|
(`DEVTOOLS_CONFIG_CODES` holds the messages):
|
|
335
352
|
|
|
336
|
-
| Code | Fix
|
|
337
|
-
| ------- |
|
|
338
|
-
| `DT001` | Set `DEVTOOLS_PATH` or `production.path`.
|
|
339
|
-
| `DT002` | Use a path of 8+ characters starting with `/`, with letters, digits and `- _ . ~ /` only; not `/__warlock`.
|
|
340
|
-
| `DT003` | No admin: set `DEVTOOLS_ADMIN_EMAIL` plus a password or setup token, or run `warlock devtools:reset-admin --email <email>`.
|
|
341
|
-
| `DT004` | The env password breaks the rules (
|
|
342
|
-
| `DT005` | Install `@warlock.js/cascade` and configure a database.
|
|
343
|
-
| `DT006` | Set `encryption.key` (64 hex characters).
|
|
344
|
-
| `DT007` | An option is invalid; the message names it.
|
|
345
|
-
| `DT008` | Add `devtoolsMigrations` to `database.migrations` and run `warlock migrate
|
|
346
|
-
| `DT009` | Set the password or the setup token, not both.
|
|
347
|
-
| `DT010` | The setup token needs 32+ characters (`openssl rand -base64 32`).
|
|
353
|
+
| Code | Fix |
|
|
354
|
+
| ------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
355
|
+
| `DT001` | Set `DEVTOOLS_PATH` or `production.path`. |
|
|
356
|
+
| `DT002` | Use a path of 8+ characters starting with `/`, with letters, digits and `- _ . ~ /` only; not `/__warlock`. |
|
|
357
|
+
| `DT003` | No admin: set `DEVTOOLS_ADMIN_EMAIL` plus a password or setup token, or run `warlock devtools:reset-admin --email <email>`. |
|
|
358
|
+
| `DT004` | The env password breaks the rules (`passwords.minLength`+ characters, at most 72 bytes, not common unless `rejectCommon` is false, not the email). |
|
|
359
|
+
| `DT005` | Install `@warlock.js/cascade` and configure a database. |
|
|
360
|
+
| `DT006` | Set `encryption.key` (64 hex characters). |
|
|
361
|
+
| `DT007` | An option is invalid (`share.maxDays` must be 1 to 365); the message names it. |
|
|
362
|
+
| `DT008` | Add `devtoolsMigrations` to `database.migrations` and run `warlock migrate` (`devtools_shares` when sharing is on). |
|
|
363
|
+
| `DT009` | Set the password or the setup token, not both. |
|
|
364
|
+
| `DT010` | The setup token needs 32+ characters (`openssl rand -base64 32`). |
|
|
348
365
|
|
|
349
366
|
Every dashboard URL gives a 404: check that `production.enabled` is true, the
|
|
350
367
|
dashboard is not disabled or locked (`warlock devtools:enable`), the request is
|
|
@@ -407,11 +424,27 @@ export default queuePanel;
|
|
|
407
424
|
headers; in production: sign-in). A reused id (the built-in `processes` included) or a dashboard id
|
|
408
425
|
such as `mail` is refused; devtools logs why and leaves the panel out.
|
|
409
426
|
|
|
427
|
+
- `files: { dir, extensions? }` serves a folder of images at
|
|
428
|
+
`/__warlock/panels/<id>/files/<path>` (default `.png .jpg .jpeg .webp .gif`;
|
|
429
|
+
`.svg`, `.html`, `.htm`, `.js` and `.mjs` are refused when the panel loads;
|
|
430
|
+
`..`, backslashes, absolute paths and links that leave the folder answer
|
|
431
|
+
404). The view builds the URL with `file("login/step-1.png")`.
|
|
432
|
+
- `share: { view, routes, assets?, files? }` (`DevtoolsPanelShare`) declares
|
|
433
|
+
the view a read-only share link opens. `routes` are paths of the panel's GET
|
|
434
|
+
routes; each such route gets `shared: true` in its `DevtoolsPanelRequest`
|
|
435
|
+
and must leave file paths, code, test names and error messages out of its
|
|
436
|
+
answer. The view context also has `shared` and `share` (`{ enabled,
|
|
437
|
+
manageHref }` for an admin when sharing is on, else `null`).
|
|
438
|
+
- The factory also receives `errors()`: the captured error groups of the last
|
|
439
|
+
hour as `DevtoolsPanelErrorSummary[]` (route, status, class name, source,
|
|
440
|
+
count, first and last seen; no message, no stack; every instance in
|
|
441
|
+
production). Call it per request.
|
|
442
|
+
|
|
410
443
|
A panel can set `production: true` when it is safe in the production monitor
|
|
411
444
|
(otherwise it needs `production.panels[id]: true`). The factory receives
|
|
412
|
-
`{ root, mode }`; `mode` is `"development"` or `"production"`, and a panel must
|
|
445
|
+
`{ root, mode, errors }`; `mode` is `"development"` or `"production"`, and a panel must
|
|
413
446
|
not write files in production. The ids `resources`, `health`, `errors`, `jobs`,
|
|
414
|
-
`instances`, `auth`, `account` and `
|
|
447
|
+
`instances`, `auth`, `account`, `admin` and `share` are reserved.
|
|
415
448
|
|
|
416
449
|
Full reference: the "Registering a panel" page of the devtools docs.
|
|
417
450
|
|
|
@@ -419,4 +452,9 @@ Panel styling: a package panel's CSS may use only the dashboard's variables (`DE
|
|
|
419
452
|
`@warlock.js/devtools`: `--background --foreground --card --muted --muted-foreground --accent --border --brand
|
|
420
453
|
--success --warning --info --destructive --chart-1..5` and the other shadcn names) plus variables it defines itself.
|
|
421
454
|
Never use another name (such as `--text` or `--surface`): the dashboard does not define it, and text can become
|
|
422
|
-
unreadable. The text tokens meet 4.5:1 contrast on `--background` and `--card` in both themes.
|
|
455
|
+
unreadable. The text tokens meet 4.5:1 contrast on `--background` and `--card` in both themes. In the light theme `--primary` is the
|
|
456
|
+
gold fill (dark `--primary-foreground` on it) and `--brand` is the deep amber for text; in the dark theme both are gold.
|
|
457
|
+
|
|
458
|
+
The dashboard shows the Warlock logo and installed core version at the top of the sidebar and the app's own
|
|
459
|
+
`package.json` name and version at the bottom. They come from `GET api/auth/session` (`warlockVersion`, `app`), read once
|
|
460
|
+
on the server, signed-in only, `null` when unknown.
|