lurqrun 0.1.5 → 0.1.7

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 (192) hide show
  1. package/README.md +23 -13
  2. package/dist/auditHandler-JCOJSUYW.js +23 -0
  3. package/dist/bin/lurq.js +3085 -17723
  4. package/dist/browserAuth-B6G27USY.js +95 -0
  5. package/dist/cache-DKI34SVS.js +12 -0
  6. package/dist/check-2FDGUOV7.js +192 -0
  7. package/dist/checkUpgrade-F2WESBPM.js +103 -0
  8. package/dist/chunk-2VMOWSRY.js +300 -0
  9. package/dist/chunk-3GHJR7XR.js +2049 -0
  10. package/dist/chunk-3N3Q3DSW.js +214 -0
  11. package/dist/chunk-4ESO33J6.js +34 -0
  12. package/dist/chunk-4F7ZESPO.js +132 -0
  13. package/dist/chunk-4KCPOMG6.js +68 -0
  14. package/dist/chunk-4ZYCIMY4.js +155 -0
  15. package/dist/chunk-63MUJNZL.js +318 -0
  16. package/dist/chunk-6AAEVQ7I.js +6336 -0
  17. package/dist/chunk-6EQ3ARXA.js +304 -0
  18. package/dist/chunk-6L3U7DZ5.js +23 -0
  19. package/dist/chunk-AHBP533R.js +220 -0
  20. package/dist/chunk-B43LCXBM.js +223 -0
  21. package/dist/chunk-BCANRN5B.js +33 -0
  22. package/dist/chunk-BUALU27S.js +123 -0
  23. package/dist/chunk-BULZAX2U.js +1554 -0
  24. package/dist/chunk-BV32UNLL.js +154 -0
  25. package/dist/chunk-C6GLE626.js +160 -0
  26. package/dist/chunk-CIDWNUAP.js +145 -0
  27. package/dist/chunk-CUP36ND3.js +2126 -0
  28. package/dist/chunk-CW5HJ3LX.js +96 -0
  29. package/dist/chunk-DB2VF5UD.js +315 -0
  30. package/dist/chunk-DWAGCNEL.js +210 -0
  31. package/dist/chunk-EA3DP5HG.js +293 -0
  32. package/dist/chunk-ELGCAM7P.js +184 -0
  33. package/dist/chunk-FW6BD2NO.js +1915 -0
  34. package/dist/chunk-GE37NVLN.js +15 -0
  35. package/dist/chunk-GPTKSNR6.js +171 -0
  36. package/dist/chunk-GRJXQBQZ.js +793 -0
  37. package/dist/chunk-HWBBVLOT.js +92 -0
  38. package/dist/chunk-I2JUKN6Z.js +24 -0
  39. package/dist/chunk-I3M2KJXB.js +56 -0
  40. package/dist/chunk-IQ4SDKKY.js +733 -0
  41. package/dist/chunk-J5FZYN4A.js +116 -0
  42. package/dist/chunk-L6N4JFW2.js +263 -0
  43. package/dist/chunk-LBFGSSF2.js +126 -0
  44. package/dist/chunk-LEGPB7DO.js +81 -0
  45. package/dist/chunk-LO35HLQZ.js +219 -0
  46. package/dist/chunk-LRD4GBYE.js +73 -0
  47. package/dist/chunk-LUAKDHLZ.js +40 -0
  48. package/dist/chunk-LYMPYETA.js +965 -0
  49. package/dist/chunk-M6NYEXCW.js +38 -0
  50. package/dist/chunk-MHUEVBVO.js +35 -0
  51. package/dist/chunk-MYGSLK44.js +37 -0
  52. package/dist/chunk-NH5I4KHH.js +201 -0
  53. package/dist/chunk-OQS4GUSI.js +1391 -0
  54. package/dist/chunk-PSX3GIAN.js +176 -0
  55. package/dist/chunk-Q5VPF4WI.js +26 -0
  56. package/dist/chunk-QKGYDMWB.js +7409 -0
  57. package/dist/chunk-QSL6QN5X.js +115 -0
  58. package/dist/chunk-SHCEBP3J.js +107 -0
  59. package/dist/chunk-SJOVFF7B.js +201 -0
  60. package/dist/chunk-ST2X2GYN.js +373 -0
  61. package/dist/chunk-TNTXWSYA.js +19 -0
  62. package/dist/chunk-U5AT3TD4.js +2128 -0
  63. package/dist/chunk-UDVNA7EA.js +483 -0
  64. package/dist/chunk-VL2E5T2A.js +109 -0
  65. package/dist/chunk-VLRHFMGJ.js +58 -0
  66. package/dist/chunk-WHX2ZFCG.js +4048 -0
  67. package/dist/chunk-WQ23REYT.js +37 -0
  68. package/dist/chunk-XBIDMHSK.js +15425 -0
  69. package/dist/chunk-Y5GI7RL3.js +66 -0
  70. package/dist/client-IRKAMDYZ.js +15 -0
  71. package/dist/commands-FIL5ET6P.js +911 -0
  72. package/dist/compat-R3UTFQ5Q.js +201 -0
  73. package/dist/dashboardIssue-WYYMBFIB.js +192 -0
  74. package/dist/diff-GZA2774U.js +13 -0
  75. package/dist/dist-4XXIXHHZ.js +12945 -0
  76. package/dist/e2b-FVPHDULZ.js +172 -0
  77. package/dist/extract-NKGKLIVT.js +444 -0
  78. package/dist/fetch-QYTUJVG2.js +22 -0
  79. package/dist/firstTouch-QQTJH4QX.js +55 -0
  80. package/dist/handlers-GEJAVZDK.js +53 -0
  81. package/dist/http-ETPYMBGD.js +5360 -0
  82. package/dist/ingestQueue-VKN4KBIF.js +35 -0
  83. package/dist/install-EK3W2COX.js +20 -0
  84. package/dist/installSkill-VQJWJVCL.js +52 -0
  85. package/dist/inventory-5AWSLJYU.js +31 -0
  86. package/dist/local-XPZMRH5R.js +13 -0
  87. package/dist/mcp-3JHD5SUZ.js +472 -0
  88. package/dist/mcpHandlers-QFN4MCFL.js +22 -0
  89. package/dist/mcpScan-QZHWENIP.js +1871 -0
  90. package/dist/mcpScanWorkflow-JPYCBGC4.js +81 -0
  91. package/dist/mcpStack-BYJCZNIV.js +20 -0
  92. package/dist/packages-THVFMWFP.js +42 -0
  93. package/dist/plan-V4OEI3J4.js +463 -0
  94. package/dist/planView-JRXGCG2N.js +79 -0
  95. package/dist/policy-3P6BGRDN.js +115 -0
  96. package/dist/references-6N7VEPHT.js +14 -0
  97. package/dist/release-4U4ABNSJ.js +128 -0
  98. package/dist/remote-YGCXYI4V.js +32 -0
  99. package/dist/reportRuns-CKQQYLY4.js +64 -0
  100. package/dist/sandbox-MEZLAODF.js +39 -0
  101. package/dist/server-KFUD5X57.js +55 -0
  102. package/dist/surface-V62GE554.js +141 -0
  103. package/dist/surface-YL6O67W3.js +36 -0
  104. package/dist/surfaceHandlers-X2IZKA3E.js +20 -0
  105. package/dist/typecheck-X7U5ELMR.js +268 -0
  106. package/dist/types-M5JP2W3D.js +10 -0
  107. package/dist/uninstall-P7RGBX6G.js +174 -0
  108. package/dist/upgrade-NQ5IWFZB.js +596 -0
  109. package/dist/upgradePlan-A4LRKLEG.js +146 -0
  110. package/dist/userConfig-Z3GQE776.js +20 -0
  111. package/dist/watch-DGFMWUDL.js +214 -0
  112. package/package.json +41 -26
  113. package/templates/agent-rules.md +4 -4
  114. package/templates/skill-instructions.md +18 -14
  115. package/dist/bin/lurq.js.map +0 -1
  116. package/dist/index.d.ts +0 -764
  117. package/dist/index.js +0 -17992
  118. package/dist/index.js.map +0 -1
  119. package/drizzle/0000_confused_fabian_cortez.sql +0 -54
  120. package/drizzle/0001_aspiring_timeslip.sql +0 -15
  121. package/drizzle/0002_lyrical_lila_cheney.sql +0 -14
  122. package/drizzle/0003_violet_giant_girl.sql +0 -14
  123. package/drizzle/0004_slim_valeria_richards.sql +0 -15
  124. package/drizzle/0005_petite_luke_cage.sql +0 -12
  125. package/drizzle/0006_calm_nighthawk.sql +0 -3
  126. package/drizzle/0007_slimy_naoko.sql +0 -1
  127. package/drizzle/0008_peaceful_tigra.sql +0 -1
  128. package/drizzle/0009_smooth_harrier.sql +0 -10
  129. package/drizzle/0010_curved_amphibian.sql +0 -2
  130. package/drizzle/0011_compat_provenance_closures.sql +0 -11
  131. package/drizzle/0012_api_surfaces.sql +0 -9
  132. package/drizzle/0013_nice_thanos.sql +0 -1
  133. package/drizzle/0014_luxuriant_malcolm_colcord.sql +0 -10
  134. package/drizzle/0015_past_fat_cobra.sql +0 -11
  135. package/drizzle/0016_futuristic_junta.sql +0 -50
  136. package/drizzle/0017_absent_grandmaster.sql +0 -20
  137. package/drizzle/0018_rainy_proemial_gods.sql +0 -1
  138. package/drizzle/0019_dashing_korvac.sql +0 -11
  139. package/drizzle/0020_normal_vulture.sql +0 -3
  140. package/drizzle/0021_dazzling_blue_shield.sql +0 -17
  141. package/drizzle/0022_massive_ghost_rider.sql +0 -24
  142. package/drizzle/0023_next_shatterstar.sql +0 -1
  143. package/drizzle/0024_dusty_maelstrom.sql +0 -15
  144. package/drizzle/0025_gifted_harpoon.sql +0 -5
  145. package/drizzle/0026_awesome_mordo.sql +0 -1
  146. package/drizzle/0027_charming_ulik.sql +0 -2
  147. package/drizzle/0028_romantic_loners.sql +0 -2
  148. package/drizzle/0029_busy_korvac.sql +0 -16
  149. package/drizzle/0030_steady_mathemanic.sql +0 -6
  150. package/drizzle/0031_redundant_maginty.sql +0 -2
  151. package/drizzle/0032_stack_resolutions.sql +0 -14
  152. package/drizzle/0033_graceful_tyger_tiger.sql +0 -3
  153. package/drizzle/0034_api_key_scopes.sql +0 -1
  154. package/drizzle/0035_policy_audit.sql +0 -21
  155. package/drizzle/meta/0000_snapshot.json +0 -370
  156. package/drizzle/meta/0001_snapshot.json +0 -482
  157. package/drizzle/meta/0002_snapshot.json +0 -575
  158. package/drizzle/meta/0003_snapshot.json +0 -667
  159. package/drizzle/meta/0004_snapshot.json +0 -769
  160. package/drizzle/meta/0005_snapshot.json +0 -864
  161. package/drizzle/meta/0006_snapshot.json +0 -882
  162. package/drizzle/meta/0007_snapshot.json +0 -876
  163. package/drizzle/meta/0008_snapshot.json +0 -882
  164. package/drizzle/meta/0009_snapshot.json +0 -948
  165. package/drizzle/meta/0010_snapshot.json +0 -969
  166. package/drizzle/meta/0011_snapshot.json +0 -1049
  167. package/drizzle/meta/0012_snapshot.json +0 -1115
  168. package/drizzle/meta/0013_snapshot.json +0 -1121
  169. package/drizzle/meta/0014_snapshot.json +0 -1190
  170. package/drizzle/meta/0015_snapshot.json +0 -1280
  171. package/drizzle/meta/0016_snapshot.json +0 -1683
  172. package/drizzle/meta/0017_snapshot.json +0 -1834
  173. package/drizzle/meta/0018_snapshot.json +0 -1834
  174. package/drizzle/meta/0019_snapshot.json +0 -1909
  175. package/drizzle/meta/0020_snapshot.json +0 -1921
  176. package/drizzle/meta/0021_snapshot.json +0 -2045
  177. package/drizzle/meta/0022_snapshot.json +0 -2246
  178. package/drizzle/meta/0023_snapshot.json +0 -2252
  179. package/drizzle/meta/0024_snapshot.json +0 -2375
  180. package/drizzle/meta/0025_snapshot.json +0 -2407
  181. package/drizzle/meta/0026_snapshot.json +0 -2413
  182. package/drizzle/meta/0027_snapshot.json +0 -2425
  183. package/drizzle/meta/0028_snapshot.json +0 -2438
  184. package/drizzle/meta/0029_snapshot.json +0 -2546
  185. package/drizzle/meta/0030_snapshot.json +0 -2586
  186. package/drizzle/meta/0031_snapshot.json +0 -2598
  187. package/drizzle/meta/0032_snapshot.json +0 -2699
  188. package/drizzle/meta/0033_snapshot.json +0 -2712
  189. package/drizzle/meta/0034_snapshot.json +0 -2719
  190. package/drizzle/meta/0035_snapshot.json +0 -2869
  191. package/drizzle/meta/_journal.json +0 -258
  192. package/src/data/seed.json +0 -253
@@ -0,0 +1,115 @@
1
+ import { createRequire as __lurqCreateRequire } from 'node:module'; const require = __lurqCreateRequire(import.meta.url);
2
+ import {
3
+ validateSelectionPolicy
4
+ } from "./chunk-LBFGSSF2.js";
5
+ import {
6
+ describeRules,
7
+ diffPolicies
8
+ } from "./chunk-PSX3GIAN.js";
9
+ import {
10
+ getPolicy,
11
+ getPolicyDecisions,
12
+ getPolicyHistory,
13
+ putPolicy
14
+ } from "./chunk-4ZYCIMY4.js";
15
+ import {
16
+ resolveApiKey
17
+ } from "./chunk-Y5GI7RL3.js";
18
+ import "./chunk-GPTKSNR6.js";
19
+ import {
20
+ init_esm_shims
21
+ } from "./chunk-I3M2KJXB.js";
22
+
23
+ // src/cli/policy.ts
24
+ init_esm_shims();
25
+ import { readFileSync, writeFileSync } from "fs";
26
+ async function runPolicyPull(file, opts) {
27
+ const text = `${JSON.stringify(await getPolicy(opts), null, 2)}
28
+ `;
29
+ if (!file) {
30
+ process.stdout.write(text);
31
+ return;
32
+ }
33
+ writeFileSync(file, text);
34
+ console.log(`wrote ${file}`);
35
+ }
36
+ function readPolicyFile(file) {
37
+ let raw;
38
+ try {
39
+ raw = JSON.parse(readFileSync(file, "utf8"));
40
+ } catch (err) {
41
+ console.error(`${file}: ${err instanceof Error ? err.message : String(err)}`);
42
+ return null;
43
+ }
44
+ const result = validateSelectionPolicy(raw);
45
+ if ("error" in result) {
46
+ console.error(`${file}: ${result.error}`);
47
+ return null;
48
+ }
49
+ return result.policy;
50
+ }
51
+ function indent(lines, empty) {
52
+ return lines.length ? lines.map((line) => ` ${line}`).join("\n") : ` ${empty}`;
53
+ }
54
+ async function runPolicyPush(file, opts) {
55
+ const policy = readPolicyFile(file);
56
+ if (!policy) {
57
+ process.exitCode = 1;
58
+ return;
59
+ }
60
+ if (opts.check) {
61
+ console.log(`${file} is a valid policy.`);
62
+ if (!resolveApiKey(opts.apiKey)) {
63
+ console.log(indent(describeRules(policy), "no rules enforced."));
64
+ return;
65
+ }
66
+ console.log("pushing it would change:");
67
+ console.log(indent(diffPolicies(await getPolicy(opts), policy), "nothing."));
68
+ return;
69
+ }
70
+ const { previous } = await putPolicy(policy, opts);
71
+ console.log("policy replaced.");
72
+ console.log(
73
+ previous ? indent(diffPolicies(previous, policy), "no rule changes.") : indent(describeRules(policy), "no rules enforced.")
74
+ );
75
+ }
76
+ async function runPolicyHistory(opts) {
77
+ const changes = await getPolicyHistory(opts);
78
+ if (opts.json) {
79
+ console.log(JSON.stringify(changes, null, 2));
80
+ return;
81
+ }
82
+ if (!changes.length) {
83
+ console.log("no policy changes recorded yet.");
84
+ return;
85
+ }
86
+ for (const change of changes) {
87
+ console.log(`${change.at.slice(0, 16).replace("T", " ")} UTC ${change.actor}`);
88
+ console.log(indent(change.changes, "saved with no rule changes."));
89
+ }
90
+ }
91
+ async function runPolicyLog(opts) {
92
+ const days = opts.days === void 0 ? 30 : Number(opts.days);
93
+ const decisions = await getPolicyDecisions(days, opts);
94
+ if (opts.json) {
95
+ console.log(JSON.stringify(decisions, null, 2));
96
+ return;
97
+ }
98
+ if (!decisions.length) {
99
+ console.log(`nothing refused or warned about in the last ${days} days.`);
100
+ return;
101
+ }
102
+ const width = Math.max(...decisions.map((d) => d.packageName.length));
103
+ for (const d of decisions) {
104
+ console.log(
105
+ `${d.packageName.padEnd(width)} ${d.action.padEnd(7)} ${d.rule.padEnd(10)} ${String(d.count).padStart(4)}x last ${d.lastDay}`
106
+ );
107
+ }
108
+ }
109
+ export {
110
+ readPolicyFile,
111
+ runPolicyHistory,
112
+ runPolicyLog,
113
+ runPolicyPull,
114
+ runPolicyPush
115
+ };
@@ -0,0 +1,14 @@
1
+ import { createRequire as __lurqCreateRequire } from 'node:module'; const require = __lurqCreateRequire(import.meta.url);
2
+ import {
3
+ SURFACE_CLAIM_KINDS,
4
+ isRootSpecifier,
5
+ packageOfSpecifier,
6
+ scanReferences
7
+ } from "./chunk-ST2X2GYN.js";
8
+ import "./chunk-I3M2KJXB.js";
9
+ export {
10
+ SURFACE_CLAIM_KINDS,
11
+ isRootSpecifier,
12
+ packageOfSpecifier,
13
+ scanReferences
14
+ };
@@ -0,0 +1,128 @@
1
+ import { createRequire as __lurqCreateRequire } from 'node:module'; const require = __lurqCreateRequire(import.meta.url);
2
+ import {
3
+ diffSurfaces
4
+ } from "./chunk-SHCEBP3J.js";
5
+ import {
6
+ readManifest
7
+ } from "./chunk-ELGCAM7P.js";
8
+ import {
9
+ fetchAndExtract
10
+ } from "./chunk-BV32UNLL.js";
11
+ import "./chunk-AHBP533R.js";
12
+ import "./chunk-SJOVFF7B.js";
13
+ import {
14
+ require_semver
15
+ } from "./chunk-3GHJR7XR.js";
16
+ import "./chunk-MYGSLK44.js";
17
+ import "./chunk-GPTKSNR6.js";
18
+ import {
19
+ __toESM,
20
+ init_esm_shims
21
+ } from "./chunk-I3M2KJXB.js";
22
+
23
+ // src/surface/release.ts
24
+ init_esm_shims();
25
+ var import_semver = __toESM(require_semver(), 1);
26
+ var RANK = { patch: 0, minor: 1, major: 2 };
27
+ function declaredBump(from, to) {
28
+ if (!import_semver.default.gt(to, from)) return null;
29
+ if (import_semver.default.major(to) !== import_semver.default.major(from)) return "major";
30
+ if (import_semver.default.minor(to) !== import_semver.default.minor(from)) return "minor";
31
+ return "patch";
32
+ }
33
+ function covers(declared, required, baselineMajor) {
34
+ if (baselineMajor === 0 && required === "major") return RANK[declared] >= RANK.minor;
35
+ return RANK[declared] >= RANK[required];
36
+ }
37
+ function releaseVerdict(publishedVersion, localVersion, diff) {
38
+ const required = diff.removed.length || diff.arityChanged.length || diff.typeOnlyRemoved.length ? "major" : diff.added.length ? "minor" : "patch";
39
+ const declared = declaredBump(publishedVersion, localVersion);
40
+ const verdict = declared !== null && covers(declared, required, import_semver.default.major(publishedVersion)) ? "ok" : "understated";
41
+ return { declared, required, verdict };
42
+ }
43
+ var inconclusive = (base, reason) => ({
44
+ ...base,
45
+ declared: null,
46
+ required: "patch",
47
+ verdict: "inconclusive",
48
+ removed: [],
49
+ arityChanged: [],
50
+ typeOnlyRemoved: [],
51
+ added: [],
52
+ inconclusive: reason
53
+ });
54
+ async function checkRelease(dir, opts = {}) {
55
+ const manifest = readManifest(dir);
56
+ const name = manifest?.name;
57
+ const base = {
58
+ package: name ?? dir,
59
+ publishedVersion: null,
60
+ localVersion: manifest?.version ?? null
61
+ };
62
+ if (!name) return inconclusive(base, `no readable package.json in ${dir}`);
63
+ if (!manifest.version) return inconclusive(base, "package.json has no version field");
64
+ const { extractSurface } = await import("./extract-NKGKLIVT.js");
65
+ const local = extractSurface(dir, { manifest });
66
+ if (local.undeclaredReason) {
67
+ return inconclusive(base, `${local.undeclaredReason} \u2014 build the package first`);
68
+ }
69
+ const published = await fetchAndExtract(name, opts.against ?? "latest", {
70
+ fetchImpl: opts.fetchImpl
71
+ });
72
+ if (!published) {
73
+ return inconclusive(base, `${name} has no published version to compare against`);
74
+ }
75
+ const withVersion = { ...base, publishedVersion: published.resolvedVersion };
76
+ const diff = diffSurfaces(published.surface, local);
77
+ if (diff.inconclusive) return inconclusive(withVersion, diff.inconclusive);
78
+ return {
79
+ ...withVersion,
80
+ ...releaseVerdict(published.resolvedVersion, manifest.version, diff),
81
+ removed: diff.removed.map((s) => s.path),
82
+ arityChanged: diff.arityChanged,
83
+ typeOnlyRemoved: diff.typeOnlyRemoved.map((s) => s.path),
84
+ added: diff.added.map((s) => s.path)
85
+ };
86
+ }
87
+ var LIST_CAP = 12;
88
+ var list = (label, items) => {
89
+ if (!items.length) return [];
90
+ const shown = items.slice(0, LIST_CAP);
91
+ const more = items.length - shown.length;
92
+ return [
93
+ ` ${label} (${items.length}):`,
94
+ ...shown.map((s) => ` \xB7 ${s}`),
95
+ ...more > 0 ? [` \u2026 ${more} more`] : []
96
+ ];
97
+ };
98
+ function formatReleaseCheck(c) {
99
+ const out = [`lurq, release check \u2014 ${c.package}`, ""];
100
+ if (c.verdict === "inconclusive") {
101
+ out.push(`INCONCLUSIVE ${c.inconclusive}`, "", "No verdict. This is not a pass.");
102
+ return out.join("\n");
103
+ }
104
+ const from = c.publishedVersion ?? "?";
105
+ const to = c.localVersion ?? "?";
106
+ out.push(
107
+ c.verdict === "ok" ? c.declared === c.required ? `OK ${from} \u2192 ${to} is a ${c.declared}, which is what this API change needs.` : `OK ${from} \u2192 ${to} is a ${c.declared}; this API change only needed a ${c.required}.` : c.declared === null ? `UNDERSTATED ${to} is not ahead of the published ${from}.` : `UNDERSTATED ${from} \u2192 ${to} is tagged ${c.declared}, but this API change is a ${c.required}.`,
108
+ ""
109
+ );
110
+ out.push(...list("Removed exports", c.removed));
111
+ if (c.arityChanged.length) {
112
+ out.push(` Parameter count changed (${c.arityChanged.length}):`);
113
+ for (const a of c.arityChanged.slice(0, LIST_CAP)) {
114
+ out.push(` \xB7 ${a.path} ${a.from} \u2192 ${a.to}`);
115
+ }
116
+ }
117
+ out.push(...list("Removed types (breaks tsc, not node)", c.typeOnlyRemoved));
118
+ out.push(...list("Added exports", c.added));
119
+ if (!c.removed.length && !c.arityChanged.length && !c.typeOnlyRemoved.length && !c.added.length) {
120
+ out.push(" No change to the exported surface.");
121
+ }
122
+ return out.join("\n");
123
+ }
124
+ export {
125
+ checkRelease,
126
+ formatReleaseCheck,
127
+ releaseVerdict
128
+ };
@@ -0,0 +1,32 @@
1
+ import { createRequire as __lurqCreateRequire } from 'node:module'; const require = __lurqCreateRequire(import.meta.url);
2
+ import {
3
+ MissingKeyError,
4
+ RemoteError,
5
+ apiKey,
6
+ callTool,
7
+ endpoint,
8
+ fetchUpgradePlan,
9
+ getPolicy,
10
+ getPolicyDecisions,
11
+ getPolicyHistory,
12
+ putPolicy,
13
+ reportUpgradeRuns,
14
+ uploadMcpScan
15
+ } from "./chunk-4ZYCIMY4.js";
16
+ import "./chunk-Y5GI7RL3.js";
17
+ import "./chunk-GPTKSNR6.js";
18
+ import "./chunk-I3M2KJXB.js";
19
+ export {
20
+ MissingKeyError,
21
+ RemoteError,
22
+ apiKey,
23
+ callTool,
24
+ endpoint,
25
+ fetchUpgradePlan,
26
+ getPolicy,
27
+ getPolicyDecisions,
28
+ getPolicyHistory,
29
+ putPolicy,
30
+ reportUpgradeRuns,
31
+ uploadMcpScan
32
+ };
@@ -0,0 +1,64 @@
1
+ import { createRequire as __lurqCreateRequire } from 'node:module'; const require = __lurqCreateRequire(import.meta.url);
2
+ import {
3
+ init_esm_shims
4
+ } from "./chunk-I3M2KJXB.js";
5
+
6
+ // src/cli/reportRuns.ts
7
+ init_esm_shims();
8
+ var MAX_RUNS = 100;
9
+ function findingRefs(finding) {
10
+ return [
11
+ ...finding.symbolsRemoved.flatMap((s) => s.refs),
12
+ ...finding.arityChanged.flatMap((a) => a.refs),
13
+ ...finding.typeErrors ?? [],
14
+ ...(finding.entriesRemoved ?? []).flatMap((e) => e.refs),
15
+ ...finding.moduleFormat?.broken ?? [],
16
+ ...finding.moduleFormat?.olderNode ?? []
17
+ ];
18
+ }
19
+ function buildRunReports(report, targets, ctx) {
20
+ const versions = new Map(targets.map((t) => [t.package, t]));
21
+ const base = (pkg) => {
22
+ const target = versions.get(pkg);
23
+ return {
24
+ repoFullName: ctx.repoFullName,
25
+ packageName: pkg,
26
+ fromVersion: target?.fromVersion ?? "",
27
+ toVersion: target?.toVersion ?? "",
28
+ status: "checked",
29
+ runUrl: ctx.runUrl
30
+ };
31
+ };
32
+ const rows = [];
33
+ for (const finding of report.breaking) {
34
+ const refs = findingRefs(finding);
35
+ rows.push({
36
+ ...base(finding.package),
37
+ // The finding carries its own versions; prefer them over the target map.
38
+ fromVersion: finding.fromVersion,
39
+ toVersion: finding.toVersion,
40
+ severity: finding.severity,
41
+ symbolsAffected: [
42
+ ...finding.symbolsRemoved.map((s) => s.symbol),
43
+ ...finding.arityChanged.map((a) => a.symbol),
44
+ ...(finding.entriesRemoved ?? []).map((e) => e.specifier)
45
+ ],
46
+ callSites: refs.length,
47
+ callSiteFiles: [...new Set(refs.map((r) => r.file))]
48
+ });
49
+ }
50
+ for (const pkg of report.ok) rows.push({ ...base(pkg), severity: "ok" });
51
+ for (const u of report.unverified) rows.push({ ...base(u.package), severity: "unverified" });
52
+ return rows.filter((r) => r.fromVersion && r.toVersion).slice(0, MAX_RUNS);
53
+ }
54
+ function runContextFromEnv(env = process.env) {
55
+ const repoFullName = env.GITHUB_REPOSITORY?.trim();
56
+ if (!repoFullName) return null;
57
+ const server = env.GITHUB_SERVER_URL?.trim() || "https://github.com";
58
+ const runId = env.GITHUB_RUN_ID?.trim();
59
+ return { repoFullName, runUrl: runId ? `${server}/${repoFullName}/actions/runs/${runId}` : "" };
60
+ }
61
+ export {
62
+ buildRunReports,
63
+ runContextFromEnv
64
+ };
@@ -0,0 +1,39 @@
1
+ import { createRequire as __lurqCreateRequire } from 'node:module'; const require = __lurqCreateRequire(import.meta.url);
2
+ import {
3
+ getSandbox
4
+ } from "./chunk-I2JUKN6Z.js";
5
+ import "./chunk-C6GLE626.js";
6
+ import "./chunk-GE37NVLN.js";
7
+ import {
8
+ storeVerificationRun
9
+ } from "./chunk-6L3U7DZ5.js";
10
+ import "./chunk-LYMPYETA.js";
11
+ import "./chunk-GRJXQBQZ.js";
12
+ import "./chunk-WHX2ZFCG.js";
13
+ import "./chunk-GPTKSNR6.js";
14
+ import {
15
+ init_esm_shims
16
+ } from "./chunk-I3M2KJXB.js";
17
+
18
+ // src/pipeline/sandbox.ts
19
+ init_esm_shims();
20
+ async function verifyPackageInSandbox(db, pkg, version, opts = {}) {
21
+ const result = await (await getSandbox()).verify(pkg, version, opts);
22
+ await storeVerificationRun(db, {
23
+ packageName: pkg,
24
+ version: version ?? "latest",
25
+ driver: result.driver,
26
+ moduleSystem: result.moduleSystem,
27
+ installed: result.installed,
28
+ imported: result.imported,
29
+ ranScripts: result.ranScripts,
30
+ durationMs: result.durationMs,
31
+ error: result.error,
32
+ ranAt: /* @__PURE__ */ new Date()
33
+ }).catch(() => {
34
+ });
35
+ return result;
36
+ }
37
+ export {
38
+ verifyPackageInSandbox
39
+ };
@@ -0,0 +1,55 @@
1
+ import { createRequire as __lurqCreateRequire } from 'node:module'; const require = __lurqCreateRequire(import.meta.url);
2
+ import {
3
+ SERVE_NEEDS_DATABASE,
4
+ buildMcpServer,
5
+ exactVersion,
6
+ npmName,
7
+ startMcpServer
8
+ } from "./chunk-CUP36ND3.js";
9
+ import "./chunk-IQ4SDKKY.js";
10
+ import "./chunk-XBIDMHSK.js";
11
+ import "./chunk-L6N4JFW2.js";
12
+ import "./chunk-3N3Q3DSW.js";
13
+ import "./chunk-DB2VF5UD.js";
14
+ import "./chunk-6AAEVQ7I.js";
15
+ import "./chunk-LEGPB7DO.js";
16
+ import "./chunk-Q5VPF4WI.js";
17
+ import "./chunk-VL2E5T2A.js";
18
+ import "./chunk-6EQ3ARXA.js";
19
+ import "./chunk-SHCEBP3J.js";
20
+ import "./chunk-LO35HLQZ.js";
21
+ import "./chunk-4F7ZESPO.js";
22
+ import "./chunk-BULZAX2U.js";
23
+ import "./chunk-QSL6QN5X.js";
24
+ import "./chunk-M6NYEXCW.js";
25
+ import "./chunk-6L3U7DZ5.js";
26
+ import "./chunk-J5FZYN4A.js";
27
+ import "./chunk-PSX3GIAN.js";
28
+ import "./chunk-FW6BD2NO.js";
29
+ import "./chunk-BUALU27S.js";
30
+ import "./chunk-LRD4GBYE.js";
31
+ import "./chunk-BCANRN5B.js";
32
+ import "./chunk-2VMOWSRY.js";
33
+ import "./chunk-4ESO33J6.js";
34
+ import "./chunk-CW5HJ3LX.js";
35
+ import "./chunk-AHBP533R.js";
36
+ import "./chunk-SJOVFF7B.js";
37
+ import "./chunk-HWBBVLOT.js";
38
+ import "./chunk-NH5I4KHH.js";
39
+ import "./chunk-VLRHFMGJ.js";
40
+ import "./chunk-WQ23REYT.js";
41
+ import "./chunk-LYMPYETA.js";
42
+ import "./chunk-3GHJR7XR.js";
43
+ import "./chunk-GRJXQBQZ.js";
44
+ import "./chunk-WHX2ZFCG.js";
45
+ import "./chunk-LUAKDHLZ.js";
46
+ import "./chunk-MYGSLK44.js";
47
+ import "./chunk-GPTKSNR6.js";
48
+ import "./chunk-I3M2KJXB.js";
49
+ export {
50
+ SERVE_NEEDS_DATABASE,
51
+ buildMcpServer,
52
+ exactVersion,
53
+ npmName,
54
+ startMcpServer
55
+ };
@@ -0,0 +1,141 @@
1
+ import { createRequire as __lurqCreateRequire } from 'node:module'; const require = __lurqCreateRequire(import.meta.url);
2
+ import {
3
+ formatError
4
+ } from "./chunk-MHUEVBVO.js";
5
+ import {
6
+ bumpSurfaceAttempt,
7
+ dropSurfaceQueue,
8
+ enqueuePreviousSurface,
9
+ enqueueSurface,
10
+ getPackagesMissingGraphSurface,
11
+ getPendingSurfaces,
12
+ isExtractionCached,
13
+ storeSurface,
14
+ surfaceRef
15
+ } from "./chunk-LO35HLQZ.js";
16
+ import {
17
+ fetchAndExtract
18
+ } from "./chunk-BV32UNLL.js";
19
+ import {
20
+ getPackagesWithSurface
21
+ } from "./chunk-M6NYEXCW.js";
22
+ import "./chunk-AHBP533R.js";
23
+ import "./chunk-SJOVFF7B.js";
24
+ import {
25
+ getPackageVersions
26
+ } from "./chunk-NH5I4KHH.js";
27
+ import "./chunk-VLRHFMGJ.js";
28
+ import "./chunk-LYMPYETA.js";
29
+ import {
30
+ logger
31
+ } from "./chunk-MYGSLK44.js";
32
+ import "./chunk-GPTKSNR6.js";
33
+ import {
34
+ init_esm_shims
35
+ } from "./chunk-I3M2KJXB.js";
36
+
37
+ // src/pipeline/surface.ts
38
+ init_esm_shims();
39
+ var VERSION_LOOKBACK = 50;
40
+ var EXTRACTOR_VERSION = "2";
41
+ var MAX_ATTEMPTS = 3;
42
+ async function extractAndStore(db, pkg, version) {
43
+ const fetched = await fetchAndExtract(pkg, version);
44
+ if (!fetched) return { outcome: "missing", version: null };
45
+ const resolved = fetched.resolvedVersion;
46
+ const ref = surfaceRef(pkg, resolved);
47
+ if (await isExtractionCached(db, ref, fetched.artifactHash, EXTRACTOR_VERSION))
48
+ return { outcome: "cached", version: resolved };
49
+ const res = await storeSurface(db, fetched.surface, {
50
+ artifactHash: fetched.artifactHash,
51
+ extractorVersion: EXTRACTOR_VERSION
52
+ });
53
+ return {
54
+ outcome: res.verdict === "undeclared" ? "undeclared" : "stored",
55
+ version: resolved
56
+ };
57
+ }
58
+ async function drainSurfaceQueue(db, opts = {}) {
59
+ const pending = await getPendingSurfaces(db, opts.limit ?? 10);
60
+ const s = {
61
+ drained: 0,
62
+ stored: 0,
63
+ cached: 0,
64
+ undeclared: 0,
65
+ failed: 0,
66
+ backfilled: 0
67
+ };
68
+ for (const item of pending) {
69
+ s.drained++;
70
+ try {
71
+ const { outcome, version } = await extractAndStore(db, item.packageName, item.version);
72
+ if (outcome === "stored") s.stored++;
73
+ else if (outcome === "cached") s.cached++;
74
+ else if (outcome === "undeclared") s.undeclared++;
75
+ if (version && (outcome === "stored" || outcome === "cached")) {
76
+ await enqueuePreviousSurface(
77
+ db,
78
+ item.packageName,
79
+ version,
80
+ await getPackageVersions(db, item.packageName, VERSION_LOOKBACK)
81
+ ).then(
82
+ (queued) => {
83
+ if (queued) s.backfilled++;
84
+ },
85
+ (err) => logger.warn(
86
+ { pkg: item.packageName, version, err: formatError(err) },
87
+ "surface: previous-version backfill could not be queued"
88
+ )
89
+ );
90
+ }
91
+ await dropSurfaceQueue(db, item.id);
92
+ } catch (err) {
93
+ s.failed++;
94
+ if (item.attempts + 1 >= MAX_ATTEMPTS) await dropSurfaceQueue(db, item.id);
95
+ else await bumpSurfaceAttempt(db, item.id);
96
+ logger.warn(
97
+ { spec: item.specKey, attempts: item.attempts + 1, err: formatError(err) },
98
+ "surface extraction failed"
99
+ );
100
+ }
101
+ }
102
+ return s;
103
+ }
104
+ async function backfillSurfaces(db, opts = {}) {
105
+ const limit = opts.limit ?? 500;
106
+ const s = { scanned: 0, queuedLatest: 0, queuedPrevious: 0 };
107
+ const missing = await getPackagesMissingGraphSurface(db, limit, { byDownloads: opts.byDownloads });
108
+ for (const row of missing) {
109
+ s.scanned++;
110
+ await enqueueSurface(db, row.name, row.version).then(
111
+ () => {
112
+ s.queuedLatest++;
113
+ },
114
+ (err) => logger.warn({ pkg: row.name, err: formatError(err) }, "backfill: could not queue latest")
115
+ );
116
+ }
117
+ const withSurface = await getPackagesWithSurface(db, limit);
118
+ for (const row of withSurface) {
119
+ s.scanned++;
120
+ await enqueuePreviousSurface(
121
+ db,
122
+ row.name,
123
+ row.version,
124
+ await getPackageVersions(db, row.name, VERSION_LOOKBACK)
125
+ ).then(
126
+ (queued) => {
127
+ if (queued) s.queuedPrevious++;
128
+ },
129
+ (err) => logger.warn(
130
+ { pkg: row.name, err: formatError(err) },
131
+ "backfill: could not queue predecessor"
132
+ )
133
+ );
134
+ }
135
+ return s;
136
+ }
137
+ export {
138
+ backfillSurfaces,
139
+ drainSurfaceQueue,
140
+ extractAndStore
141
+ };
@@ -0,0 +1,36 @@
1
+ import { createRequire as __lurqCreateRequire } from 'node:module'; const require = __lurqCreateRequire(import.meta.url);
2
+ import {
3
+ bumpSurfaceAttempt,
4
+ dropSurfaceQueue,
5
+ enqueuePreviousSurface,
6
+ enqueueSurface,
7
+ getMcpServerNames,
8
+ getPackagesMissingGraphSurface,
9
+ getPendingSurfaces,
10
+ hasStoredSurface,
11
+ isExtractionCached,
12
+ mcpSurfaceRef,
13
+ previousVersion,
14
+ specKey,
15
+ storeSurface,
16
+ surfaceRef
17
+ } from "./chunk-LO35HLQZ.js";
18
+ import "./chunk-LYMPYETA.js";
19
+ import "./chunk-GPTKSNR6.js";
20
+ import "./chunk-I3M2KJXB.js";
21
+ export {
22
+ bumpSurfaceAttempt,
23
+ dropSurfaceQueue,
24
+ enqueuePreviousSurface,
25
+ enqueueSurface,
26
+ getMcpServerNames,
27
+ getPackagesMissingGraphSurface,
28
+ getPendingSurfaces,
29
+ hasStoredSurface,
30
+ isExtractionCached,
31
+ mcpSurfaceRef,
32
+ previousVersion,
33
+ specKey,
34
+ storeSurface,
35
+ surfaceRef
36
+ };
@@ -0,0 +1,20 @@
1
+ import { createRequire as __lurqCreateRequire } from 'node:module'; const require = __lurqCreateRequire(import.meta.url);
2
+ import {
3
+ handleDiffSurface,
4
+ handleResolveSurface,
5
+ loadStored,
6
+ rowsToSurface
7
+ } from "./chunk-DB2VF5UD.js";
8
+ import "./chunk-SHCEBP3J.js";
9
+ import "./chunk-LO35HLQZ.js";
10
+ import "./chunk-HWBBVLOT.js";
11
+ import "./chunk-LYMPYETA.js";
12
+ import "./chunk-MYGSLK44.js";
13
+ import "./chunk-GPTKSNR6.js";
14
+ import "./chunk-I3M2KJXB.js";
15
+ export {
16
+ handleDiffSurface,
17
+ handleResolveSurface,
18
+ loadStored,
19
+ rowsToSurface
20
+ };