@warlock.js/devtools 5.58.0 → 5.60.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.
Files changed (162) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/cjs/app-versions-C_ZyzuvD.cjs +138 -0
  3. package/cjs/app-versions-C_ZyzuvD.cjs.map +1 -0
  4. package/cjs/attach-D5aMqUnA.cjs +1342 -0
  5. package/cjs/attach-D5aMqUnA.cjs.map +1 -0
  6. package/cjs/{auth-DV2GA1A9.cjs → auth-ChHh5E7j.cjs} +20 -13
  7. package/cjs/auth-ChHh5E7j.cjs.map +1 -0
  8. package/cjs/{boot-CyeHPFtk.cjs → boot-Dg5YZGGR.cjs} +78 -14
  9. package/cjs/boot-Dg5YZGGR.cjs.map +1 -0
  10. package/cjs/{capture-DcyBhdqw.cjs → capture-CBgONYhk.cjs} +4 -4
  11. package/cjs/{capture-DcyBhdqw.cjs.map → capture-CBgONYhk.cjs.map} +1 -1
  12. package/cjs/{cascade-store-DEGxAFDI.cjs → cascade-store-DUT2Laha.cjs} +3 -3
  13. package/cjs/cascade-store-DUT2Laha.cjs.map +1 -0
  14. package/cjs/{current-request-id-BoJJb3y7.cjs → current-request-id-Badec-TH.cjs} +3 -3
  15. package/cjs/{current-request-id-BoJJb3y7.cjs.map → current-request-id-Badec-TH.cjs.map} +1 -1
  16. package/cjs/{errors-DEqdWaqm.cjs → errors-DNQ-g49I.cjs} +201 -4
  17. package/cjs/errors-DNQ-g49I.cjs.map +1 -0
  18. package/cjs/extract-8kaX_cUV.cjs +1103 -0
  19. package/cjs/extract-8kaX_cUV.cjs.map +1 -0
  20. package/cjs/{helpers-7k_Q-abk.cjs → helpers-BcMBFy9v.cjs} +9 -6
  21. package/cjs/{helpers-7k_Q-abk.cjs.map → helpers-BcMBFy9v.cjs.map} +1 -1
  22. package/cjs/{histogram-BRV5eHcp.cjs → histogram-CkoVizdf.cjs} +6 -6
  23. package/cjs/{histogram-BRV5eHcp.cjs.map → histogram-CkoVizdf.cjs.map} +1 -1
  24. package/cjs/{http-XNLYU2vS.cjs → http-DCVCf44M.cjs} +26 -9
  25. package/cjs/http-DCVCf44M.cjs.map +1 -0
  26. package/cjs/index.cjs +1 -1
  27. package/cjs/{insights-BBZnUpWO.cjs → insights-CFof59kF.cjs} +6 -6
  28. package/cjs/{insights-BBZnUpWO.cjs.map → insights-CFof59kF.cjs.map} +1 -1
  29. package/cjs/migrations-BQdNOL5_.cjs +30 -0
  30. package/cjs/migrations-BQdNOL5_.cjs.map +1 -0
  31. package/cjs/{migrations-DTTzCNpR.cjs → models-DF1agAm4.cjs} +107 -25
  32. package/cjs/models-DF1agAm4.cjs.map +1 -0
  33. package/cjs/{process-panel-DEOnLxoT.cjs → process-panel-D3D9Y_dc.cjs} +5 -5
  34. package/cjs/{process-panel-DEOnLxoT.cjs.map → process-panel-D3D9Y_dc.cjs.map} +1 -1
  35. package/cjs/production/index.cjs +4 -4
  36. package/cjs/runs-DECWPGnq.cjs +390 -0
  37. package/cjs/runs-DECWPGnq.cjs.map +1 -0
  38. package/cjs/{server-C8JfggQU.cjs → server-CC5DpObz.cjs} +10 -7
  39. package/cjs/server-CC5DpObz.cjs.map +1 -0
  40. package/cjs/{src-DjOUdhKc.cjs → src-VyOjEEAo.cjs} +179 -24
  41. package/cjs/src-VyOjEEAo.cjs.map +1 -0
  42. package/cjs/{store-C06KO_A1.cjs → store-EFn4wp0T.cjs} +2 -2
  43. package/cjs/{stream-route-D4k-sJvW.cjs → stream-route-DFHuIWgg.cjs} +125 -19
  44. package/cjs/stream-route-DFHuIWgg.cjs.map +1 -0
  45. package/esm/ai/attach.mjs +92 -0
  46. package/esm/ai/attach.mjs.map +1 -0
  47. package/esm/ai/options.mjs +31 -0
  48. package/esm/ai/options.mjs.map +1 -0
  49. package/esm/ai/reports/aggregate.mjs +330 -0
  50. package/esm/ai/reports/aggregate.mjs.map +1 -0
  51. package/esm/ai/reports/evaluate.mjs +108 -0
  52. package/esm/ai/reports/evaluate.mjs.map +1 -0
  53. package/esm/ai/reports/range.mjs +121 -0
  54. package/esm/ai/reports/range.mjs.map +1 -0
  55. package/esm/ai/reports/runs.d.mts +2 -0
  56. package/esm/ai/reports/runs.mjs +212 -0
  57. package/esm/ai/reports/runs.mjs.map +1 -0
  58. package/esm/ai/reports/service.mjs +132 -0
  59. package/esm/ai/reports/service.mjs.map +1 -0
  60. package/esm/ai/rollup/cascade-store.mjs +84 -0
  61. package/esm/ai/rollup/cascade-store.mjs.map +1 -0
  62. package/esm/ai/rollup/categories.mjs +67 -0
  63. package/esm/ai/rollup/categories.mjs.map +1 -0
  64. package/esm/ai/rollup/extract.mjs +225 -0
  65. package/esm/ai/rollup/extract.mjs.map +1 -0
  66. package/esm/ai/rollup/file-store.mjs +147 -0
  67. package/esm/ai/rollup/file-store.mjs.map +1 -0
  68. package/esm/ai/rollup/histogram.mjs +42 -0
  69. package/esm/ai/rollup/histogram.mjs.map +1 -0
  70. package/esm/ai/rollup/increment-error.mjs +19 -0
  71. package/esm/ai/rollup/increment-error.mjs.map +1 -0
  72. package/esm/ai/rollup/index.mjs +9 -0
  73. package/esm/ai/rollup/mapping.mjs +69 -0
  74. package/esm/ai/rollup/mapping.mjs.map +1 -0
  75. package/esm/ai/rollup/memory-store.mjs +26 -0
  76. package/esm/ai/rollup/memory-store.mjs.map +1 -0
  77. package/esm/ai/rollup/writer.mjs +113 -0
  78. package/esm/ai/rollup/writer.mjs.map +1 -0
  79. package/esm/ai/types.d.mts +29 -0
  80. package/esm/ai/types.d.mts.map +1 -0
  81. package/esm/app-versions.mjs +74 -0
  82. package/esm/app-versions.mjs.map +1 -0
  83. package/esm/devtools-connector.d.mts.map +1 -1
  84. package/esm/devtools-connector.mjs +54 -2
  85. package/esm/devtools-connector.mjs.map +1 -1
  86. package/esm/index.d.mts +3 -2
  87. package/esm/options.mjs +4 -0
  88. package/esm/options.mjs.map +1 -1
  89. package/esm/production/auth/helpers.mjs +8 -5
  90. package/esm/production/auth/helpers.mjs.map +1 -1
  91. package/esm/production/auth/service.mjs +14 -6
  92. package/esm/production/auth/service.mjs.map +1 -1
  93. package/esm/production/boot.mjs +70 -3
  94. package/esm/production/boot.mjs.map +1 -1
  95. package/esm/production/contracts.d.mts +378 -2
  96. package/esm/production/contracts.d.mts.map +1 -1
  97. package/esm/production/contracts.mjs +64 -2
  98. package/esm/production/contracts.mjs.map +1 -1
  99. package/esm/production/errors.d.mts +1 -1
  100. package/esm/production/errors.mjs +11 -3
  101. package/esm/production/errors.mjs.map +1 -1
  102. package/esm/production/http/access.mjs +6 -0
  103. package/esm/production/http/access.mjs.map +1 -1
  104. package/esm/production/http/mount.mjs +13 -0
  105. package/esm/production/http/mount.mjs.map +1 -1
  106. package/esm/production/http/share-session.mjs.map +1 -1
  107. package/esm/production/index.d.mts +2 -2
  108. package/esm/production/insights/writer.mjs.map +1 -1
  109. package/esm/production/options.d.mts +5 -1
  110. package/esm/production/options.d.mts.map +1 -1
  111. package/esm/production/options.mjs +13 -1
  112. package/esm/production/options.mjs.map +1 -1
  113. package/esm/production/store/memory-store.mjs.map +1 -1
  114. package/esm/production/store/migrations.d.mts +1 -1
  115. package/esm/production/store/migrations.d.mts.map +1 -1
  116. package/esm/production/store/migrations.mjs +4 -2
  117. package/esm/production/store/migrations.mjs.map +1 -1
  118. package/esm/production/store/models/ai-rollup.migration.mjs +48 -0
  119. package/esm/production/store/models/ai-rollup.migration.mjs.map +1 -0
  120. package/esm/production/store/models/ai-rollup.model.mjs +13 -0
  121. package/esm/production/store/models/ai-rollup.model.mjs.map +1 -0
  122. package/esm/production/store/models/index.mjs +3 -1
  123. package/esm/server/ai-report-routes.mjs +72 -0
  124. package/esm/server/ai-report-routes.mjs.map +1 -0
  125. package/esm/server/ai-routes.mjs +41 -6
  126. package/esm/server/ai-routes.mjs.map +1 -1
  127. package/esm/server/index.mjs +2 -0
  128. package/esm/server/index.mjs.map +1 -1
  129. package/esm/server/session-routes.mjs +3 -1
  130. package/esm/server/session-routes.mjs.map +1 -1
  131. package/esm/sources/agent-trace-source.d.mts.map +1 -1
  132. package/esm/sources/agent-trace-source.mjs.map +1 -1
  133. package/esm/sources/ai-source.d.mts +2 -0
  134. package/esm/sources/ai-source.d.mts.map +1 -1
  135. package/esm/sources/ai-source.mjs +120 -11
  136. package/esm/sources/ai-source.mjs.map +1 -1
  137. package/esm/types.d.mts +23 -4
  138. package/esm/types.d.mts.map +1 -1
  139. package/llms-full.txt +79 -32
  140. package/package.json +8 -8
  141. package/skills/SKILL.md +79 -32
  142. package/ui/dashboard/assets/app.css +1 -1
  143. package/ui/dashboard/assets/app.js +23 -16
  144. package/ui/dashboard/build-info.json +7 -7
  145. package/cjs/ai-source-DTpxumMA.cjs +0 -381
  146. package/cjs/ai-source-DTpxumMA.cjs.map +0 -1
  147. package/cjs/auth-DV2GA1A9.cjs.map +0 -1
  148. package/cjs/boot-CyeHPFtk.cjs.map +0 -1
  149. package/cjs/cascade-store-DEGxAFDI.cjs.map +0 -1
  150. package/cjs/contracts-CDuY-ahl.cjs +0 -116
  151. package/cjs/contracts-CDuY-ahl.cjs.map +0 -1
  152. package/cjs/errors-DEqdWaqm.cjs.map +0 -1
  153. package/cjs/http-XNLYU2vS.cjs.map +0 -1
  154. package/cjs/migrations-DTTzCNpR.cjs.map +0 -1
  155. package/cjs/options-CHhmQJic.cjs +0 -193
  156. package/cjs/options-CHhmQJic.cjs.map +0 -1
  157. package/cjs/panels-CHd20RK5.cjs +0 -385
  158. package/cjs/panels-CHd20RK5.cjs.map +0 -1
  159. package/cjs/rolldown-runtime-Zuuoy_Rh.cjs +0 -52
  160. package/cjs/server-C8JfggQU.cjs.map +0 -1
  161. package/cjs/src-DjOUdhKc.cjs.map +0 -1
  162. package/cjs/stream-route-D4k-sJvW.cjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -4,6 +4,38 @@ All notable changes to `@warlock.js/devtools` are documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). `@warlock.js/*` packages are released in lockstep — every package shares the same version number, so a version below may list only the changes that affected this package.
6
6
 
7
+ ## 5.60.0 - 2026-11-19
8
+
9
+ ### Added
10
+
11
+ - An AI sidebar group with six pages: Reports, Runs, Agents, Models, Errors and Evaluate. Reports, Models and Errors show estimated cost, tokens, error rate and latency over 24 hours, 7 days, 30 days or a custom range, with accessible charts (keyboard tooltips, table view) that keep each model's colour while filters change. Cost is an estimate from model pricing: runs of models without pricing are counted next to every cost (a model priced at 0 counts as priced), a model whose runs used no tokens shows "No tokens used", and a comparison whose previous period is older than the kept history reads "No earlier data". Custom ranges longer than 8 days use daily columns from local midnight to midnight.
12
+ - Runs gains search, status, type, exact HTTP request id and group-by filters, summary tiles (the estimated cost says how many unpriced runs it leaves out) and a cost tint on the span tree by each span's own cost; Errors lists recent failed runs inside the chosen range and filters; Agents shows the last 24 hours per agent; Evaluate grades a system prompt with the configured judge model and shows the score, issues and judge.
13
+ - AI report API: `GET /api/ai/reports`, `/models`, `/errors` (range, timezone, agent, model and provider filters, previous-period comparison, 15 s cache), `GET /api/ai/runs` (filter, `requestId`, group, stats) and `GET`/`POST /api/ai/evaluate`.
14
+ - Hourly AI rollups per hour, agent, model and provider (runs, tokens, estimated cost, errors by category, latency histogram), stored in the app database (`devtools_ai_rollups`, part of `devtoolsMigrations`), in JSON files in development and in memory in specs. A write that fails part-way retries only the totals it did not save, so nothing is counted twice.
15
+ - `devtools.ai` options: `reports`, `retentionDays` (30 in development, 90 in production, 1 to 400) and `flushIntervalMs` (default 60000, minimum 5000).
16
+ - Specific error codes for AI routes: `ai.range-invalid`, `ai.evaluate-unavailable`, `ai.prompt-not-found` and `ai.evaluate-failed`.
17
+ - Devtools publishes where it is mounted so other packages can point to it. In production, Reports, Models and Errors are listed only when Panoptic is installed.
18
+
19
+ ### Changed
20
+
21
+ - Upgrade note: in production, the Reports, Models and Errors tabs are on by default once Panoptic loads. Run `warlock migrate` to create `devtools_ai_rollups`; until then each process logs one warning at boot and the pages show "AI reports need their table". Turning all three tabs off with `production.panels` also stops the totals from being written.
22
+ - The `ai` tab keeps its id (and `production.panels.ai`) and is titled "Runs", inside the AI sidebar group.
23
+
24
+ ## 5.59.0 - 2026-11-19
25
+
26
+ ### Added
27
+
28
+ - The dashboard uses the Warlock gold palette and logo, in the light and the dark theme, and shows the Warlock.js version in the sidebar header and the app's name and version in its footer. `DevtoolsSessionView` gains `warlockVersion` and `app`; both are `null` when signed out or not found, and only the app's own `package.json` name and version are read.
29
+ - Production option `twoFactor: "off"` requires no second factor (an account that has one is still asked for it); boot logs a warning when it is off.
30
+ - Production option `passwords: { minLength, rejectCommon }` sets the password rules for accounts, invites and the first admin (`minLength` is 8 or more, `rejectCommon` defaults to `true`).
31
+ - The AI tab tells which of four reasons it is empty: `@warlock.js/ai` is missing, `@warlock.js/ai-panoptic` is missing, Panoptic failed to load (with the load error and both versions), or observation is off. Each shows a title, one line and the command to run.
32
+ - A reconnect banner shows while the app is unreachable and panels refetch when it returns.
33
+
34
+ ### Changed
35
+
36
+ - The `/ai` answer carries `reason`, `title`, `command` and `detail` when unavailable; `message` stays.
37
+ - A too-short password answers with the configured minimum length.
38
+
7
39
  ## 5.58.0 - 2026-11-18
8
40
 
9
41
  ### Added
@@ -0,0 +1,138 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __exportAll = (all, no_symbols) => {
9
+ let target = {};
10
+ for (var name in all) {
11
+ __defProp(target, name, {
12
+ get: all[name],
13
+ enumerable: true
14
+ });
15
+ }
16
+ if (!no_symbols) {
17
+ __defProp(target, Symbol.toStringTag, { value: "Module" });
18
+ }
19
+ return target;
20
+ };
21
+ var __copyProps = (to, from, except, desc) => {
22
+ if (from && typeof from === "object" || typeof from === "function") {
23
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
24
+ key = keys[i];
25
+ if (!__hasOwnProp.call(to, key) && key !== except) {
26
+ __defProp(to, key, {
27
+ get: ((k) => from[k]).bind(null, key),
28
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
29
+ });
30
+ }
31
+ }
32
+ }
33
+ return to;
34
+ };
35
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
36
+ value: mod,
37
+ enumerable: true
38
+ }) : target, mod));
39
+
40
+ //#endregion
41
+ let node_fs = require("node:fs");
42
+ let node_path = require("node:path");
43
+ node_path = __toESM(node_path, 1);
44
+ let node_url = require("node:url");
45
+
46
+ //#region ../../packages/devtools/src/app-versions.ts
47
+ /** The `version` of a `package.json` named `name`, or `null` when the file is not that package's. */
48
+ function versionIn(file, name) {
49
+ try {
50
+ const manifest = JSON.parse((0, node_fs.readFileSync)(file, "utf8"));
51
+ return manifest.name === name && typeof manifest.version === "string" ? manifest.version : null;
52
+ } catch {
53
+ return null;
54
+ }
55
+ }
56
+ /**
57
+ * The installed version of a package, read from its `package.json` without
58
+ * going through its `exports` (published `@warlock.js/core` exports neither
59
+ * `./package.json` nor a `require` condition). It resolves the package's entry
60
+ * and walks up to the `package.json` with that name; when the entry cannot be
61
+ * resolved, it looks in each `node_modules` above `from`. `null` when unknown.
62
+ */
63
+ function installedVersion(name, from, resolve) {
64
+ try {
65
+ const entry = resolve?.(name);
66
+ if (entry !== void 0) {
67
+ let folder = node_path.default.dirname(entry.startsWith("file:") ? (0, node_url.fileURLToPath)(entry) : entry);
68
+ for (;;) {
69
+ const version = versionIn(node_path.default.join(folder, "package.json"), name);
70
+ if (version !== null) return version;
71
+ const parent = node_path.default.dirname(folder);
72
+ if (parent === folder) break;
73
+ folder = parent;
74
+ }
75
+ }
76
+ } catch {}
77
+ for (let folder = from;; folder = node_path.default.dirname(folder)) {
78
+ const version = versionIn(node_path.default.join(folder, "node_modules", ...name.split("/"), "package.json"), name);
79
+ if (version !== null) return version;
80
+ if (node_path.default.dirname(folder) === folder) return null;
81
+ }
82
+ }
83
+ /**
84
+ * The app's `name` and `version` from the `package.json` in `root`. Only these
85
+ * two strings are read; `null` when the file is missing, unreadable or lacks
86
+ * either one.
87
+ */
88
+ function readAppInfo(root) {
89
+ try {
90
+ const manifest = JSON.parse((0, node_fs.readFileSync)(node_path.default.join(root, "package.json"), "utf8"));
91
+ if (typeof manifest.name !== "string" || typeof manifest.version !== "string" || manifest.name === "" || manifest.version === "") return null;
92
+ return {
93
+ name: manifest.name.slice(0, 100),
94
+ version: manifest.version.slice(0, 50)
95
+ };
96
+ } catch {
97
+ return null;
98
+ }
99
+ }
100
+ let cached;
101
+ /**
102
+ * The installed `@warlock.js/core` version and the app's name and version,
103
+ * read once per process (`root` defaults to the working directory) and kept.
104
+ */
105
+ function readVersions(root = process.cwd()) {
106
+ cached ??= {
107
+ warlockVersion: installedVersion("@warlock.js/core", root, typeof {}.resolve === "function" ? (specifier) => ({}).resolve(specifier) : void 0),
108
+ app: readAppInfo(root)
109
+ };
110
+ return cached;
111
+ }
112
+
113
+ //#endregion
114
+ Object.defineProperty(exports, "__exportAll", {
115
+ enumerable: true,
116
+ get: function () {
117
+ return __exportAll;
118
+ }
119
+ });
120
+ Object.defineProperty(exports, "__toESM", {
121
+ enumerable: true,
122
+ get: function () {
123
+ return __toESM;
124
+ }
125
+ });
126
+ Object.defineProperty(exports, "installedVersion", {
127
+ enumerable: true,
128
+ get: function () {
129
+ return installedVersion;
130
+ }
131
+ });
132
+ Object.defineProperty(exports, "readVersions", {
133
+ enumerable: true,
134
+ get: function () {
135
+ return readVersions;
136
+ }
137
+ });
138
+ //# sourceMappingURL=app-versions-C_ZyzuvD.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-versions-C_ZyzuvD.cjs","names":["readFileSync","path","fileURLToPath"],"sources":["../../../../../../../packages/devtools/src/app-versions.ts"],"sourcesContent":["import { readFileSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\n/** The app's own name and version, as the dashboard shows them at the bottom of the sidebar. */\nexport type DevtoolsAppInfo = { name: string; version: string };\n\n/** The `version` of a `package.json` named `name`, or `null` when the file is not that package's. */\nfunction versionIn(file: string, name: string): string | null {\n try {\n const manifest = JSON.parse(readFileSync(file, \"utf8\")) as {\n name?: unknown;\n version?: unknown;\n };\n\n return manifest.name === name && typeof manifest.version === \"string\" ? manifest.version : null;\n } catch {\n return null;\n }\n}\n\n/**\n * The installed version of a package, read from its `package.json` without\n * going through its `exports` (published `@warlock.js/core` exports neither\n * `./package.json` nor a `require` condition). It resolves the package's entry\n * and walks up to the `package.json` with that name; when the entry cannot be\n * resolved, it looks in each `node_modules` above `from`. `null` when unknown.\n */\nexport function installedVersion(\n name: string,\n from: string,\n resolve: ((specifier: string) => string) | undefined,\n): string | null {\n try {\n const entry = resolve?.(name);\n\n if (entry !== undefined) {\n let folder = path.dirname(entry.startsWith(\"file:\") ? fileURLToPath(entry) : entry);\n\n for (;;) {\n const version = versionIn(path.join(folder, \"package.json\"), name);\n\n if (version !== null) return version;\n\n const parent = path.dirname(folder);\n\n if (parent === folder) break;\n\n folder = parent;\n }\n }\n } catch {\n // Not resolvable from here: look in the node_modules folders below.\n }\n\n for (let folder = from; ; folder = path.dirname(folder)) {\n const version = versionIn(\n path.join(folder, \"node_modules\", ...name.split(\"/\"), \"package.json\"),\n name,\n );\n\n if (version !== null) return version;\n if (path.dirname(folder) === folder) return null;\n }\n}\n\n/**\n * The app's `name` and `version` from the `package.json` in `root`. Only these\n * two strings are read; `null` when the file is missing, unreadable or lacks\n * either one.\n */\nexport function readAppInfo(root: string): DevtoolsAppInfo | null {\n try {\n const manifest = JSON.parse(readFileSync(path.join(root, \"package.json\"), \"utf8\")) as {\n name?: unknown;\n version?: unknown;\n };\n\n if (\n typeof manifest.name !== \"string\" ||\n typeof manifest.version !== \"string\" ||\n manifest.name === \"\" ||\n manifest.version === \"\"\n ) {\n return null;\n }\n\n return { name: manifest.name.slice(0, 100), version: manifest.version.slice(0, 50) };\n } catch {\n return null;\n }\n}\n\ntype Versions = { warlockVersion: string | null; app: DevtoolsAppInfo | null };\n\nlet cached: Versions | undefined;\n\n/**\n * The installed `@warlock.js/core` version and the app's name and version,\n * read once per process (`root` defaults to the working directory) and kept.\n */\nexport function readVersions(root: string = process.cwd()): Versions {\n cached ??= {\n warlockVersion: installedVersion(\n \"@warlock.js/core\",\n root,\n typeof import.meta.resolve === \"function\"\n ? (specifier: string) => import.meta.resolve(specifier)\n : undefined,\n ),\n app: readAppInfo(root),\n };\n\n return cached;\n}\n\n/** Forgets the cached versions (for tests). */\nexport function resetVersionsCache(): void {\n cached = undefined;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,SAAS,UAAU,MAAc,MAA6B;CAC5D,IAAI;EACF,MAAM,WAAW,KAAK,UAAMA,sBAAa,MAAM,MAAM,CAAC;EAKtD,OAAO,SAAS,SAAS,QAAQ,OAAO,SAAS,YAAY,WAAW,SAAS,UAAU;CAC7F,QAAQ;EACN,OAAO;CACT;AACF;;;;;;;;AASA,SAAgB,iBACd,MACA,MACA,SACe;CACf,IAAI;EACF,MAAM,QAAQ,UAAU,IAAI;EAE5B,IAAI,UAAU,QAAW;GACvB,IAAI,SAASC,kBAAK,QAAQ,MAAM,WAAW,OAAO,QAAIC,wBAAc,KAAK,IAAI,KAAK;GAElF,SAAS;IACP,MAAM,UAAU,UAAUD,kBAAK,KAAK,QAAQ,cAAc,GAAG,IAAI;IAEjE,IAAI,YAAY,MAAM,OAAO;IAE7B,MAAM,SAASA,kBAAK,QAAQ,MAAM;IAElC,IAAI,WAAW,QAAQ;IAEvB,SAAS;GACX;EACF;CACF,QAAQ,CAER;CAEA,KAAK,IAAI,SAAS,OAAQ,SAASA,kBAAK,QAAQ,MAAM,GAAG;EACvD,MAAM,UAAU,UACdA,kBAAK,KAAK,QAAQ,gBAAgB,GAAG,KAAK,MAAM,GAAG,GAAG,cAAc,GACpE,IACF;EAEA,IAAI,YAAY,MAAM,OAAO;EAC7B,IAAIA,kBAAK,QAAQ,MAAM,MAAM,QAAQ,OAAO;CAC9C;AACF;;;;;;AAOA,SAAgB,YAAY,MAAsC;CAChE,IAAI;EACF,MAAM,WAAW,KAAK,UAAMD,sBAAaC,kBAAK,KAAK,MAAM,cAAc,GAAG,MAAM,CAAC;EAKjF,IACE,OAAO,SAAS,SAAS,YACzB,OAAO,SAAS,YAAY,YAC5B,SAAS,SAAS,MAClB,SAAS,YAAY,IAErB,OAAO;EAGT,OAAO;GAAE,MAAM,SAAS,KAAK,MAAM,GAAG,GAAG;GAAG,SAAS,SAAS,QAAQ,MAAM,GAAG,EAAE;EAAE;CACrF,QAAQ;EACN,OAAO;CACT;AACF;AAIA,IAAI;;;;;AAMJ,SAAgB,aAAa,OAAe,QAAQ,IAAI,GAAa;CACnE,WAAW;EACT,gBAAgB,iBACd,oBACA,MACA,UAAmB,YAAY,cAC1B,mBAAkC,QAAQ,SAAS,IACpD,MACN;EACA,KAAK,YAAY,IAAI;CACvB;CAEA,OAAO;AACT"}