lurqrun 0.1.6 → 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 (206) hide show
  1. package/README.md +18 -10
  2. package/dist/auditHandler-JCOJSUYW.js +23 -0
  3. package/dist/bin/lurq.js +3090 -23306
  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 +26 -21
  113. package/templates/agent-rules.md +4 -4
  114. package/templates/skill-instructions.md +13 -14
  115. package/dist/bin/lurq.js.map +0 -1
  116. package/dist/index.d.ts +0 -805
  117. package/dist/index.js +0 -23570
  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_uneven_thunderbird.sql +0 -1
  154. package/drizzle/0035_api_key_scopes.sql +0 -1
  155. package/drizzle/0036_policy_audit.sql +0 -21
  156. package/drizzle/0037_subscription_seats.sql +0 -1
  157. package/drizzle/0038_symbol_offsets.sql +0 -2
  158. package/drizzle/0039_mcp_runtime_scans.sql +0 -80
  159. package/drizzle/0040_subscription_overage_and_interval.sql +0 -4
  160. package/drizzle/0041_account_email.sql +0 -38
  161. package/drizzle/0042_alert_channels.sql +0 -21
  162. package/drizzle/meta/0000_snapshot.json +0 -370
  163. package/drizzle/meta/0001_snapshot.json +0 -482
  164. package/drizzle/meta/0002_snapshot.json +0 -575
  165. package/drizzle/meta/0003_snapshot.json +0 -667
  166. package/drizzle/meta/0004_snapshot.json +0 -769
  167. package/drizzle/meta/0005_snapshot.json +0 -864
  168. package/drizzle/meta/0006_snapshot.json +0 -882
  169. package/drizzle/meta/0007_snapshot.json +0 -876
  170. package/drizzle/meta/0008_snapshot.json +0 -882
  171. package/drizzle/meta/0009_snapshot.json +0 -948
  172. package/drizzle/meta/0010_snapshot.json +0 -969
  173. package/drizzle/meta/0011_snapshot.json +0 -1049
  174. package/drizzle/meta/0012_snapshot.json +0 -1115
  175. package/drizzle/meta/0013_snapshot.json +0 -1121
  176. package/drizzle/meta/0014_snapshot.json +0 -1190
  177. package/drizzle/meta/0015_snapshot.json +0 -1280
  178. package/drizzle/meta/0016_snapshot.json +0 -1683
  179. package/drizzle/meta/0017_snapshot.json +0 -1834
  180. package/drizzle/meta/0018_snapshot.json +0 -1834
  181. package/drizzle/meta/0019_snapshot.json +0 -1909
  182. package/drizzle/meta/0020_snapshot.json +0 -1921
  183. package/drizzle/meta/0021_snapshot.json +0 -2045
  184. package/drizzle/meta/0022_snapshot.json +0 -2246
  185. package/drizzle/meta/0023_snapshot.json +0 -2252
  186. package/drizzle/meta/0024_snapshot.json +0 -2375
  187. package/drizzle/meta/0025_snapshot.json +0 -2407
  188. package/drizzle/meta/0026_snapshot.json +0 -2413
  189. package/drizzle/meta/0027_snapshot.json +0 -2425
  190. package/drizzle/meta/0028_snapshot.json +0 -2438
  191. package/drizzle/meta/0029_snapshot.json +0 -2546
  192. package/drizzle/meta/0030_snapshot.json +0 -2586
  193. package/drizzle/meta/0031_snapshot.json +0 -2598
  194. package/drizzle/meta/0032_snapshot.json +0 -2699
  195. package/drizzle/meta/0033_snapshot.json +0 -2712
  196. package/drizzle/meta/0034_snapshot.json +0 -2719
  197. package/drizzle/meta/0035_snapshot.json +0 -2726
  198. package/drizzle/meta/0036_snapshot.json +0 -2876
  199. package/drizzle/meta/0037_snapshot.json +0 -2883
  200. package/drizzle/meta/0038_snapshot.json +0 -2895
  201. package/drizzle/meta/0039_snapshot.json +0 -3501
  202. package/drizzle/meta/0040_snapshot.json +0 -3527
  203. package/drizzle/meta/0041_snapshot.json +0 -3824
  204. package/drizzle/meta/0042_snapshot.json +0 -3960
  205. package/drizzle/meta/_journal.json +0 -307
  206. package/src/data/seed.json +0 -253
@@ -0,0 +1,733 @@
1
+ import { createRequire as __lurqCreateRequire } from 'node:module'; const require = __lurqCreateRequire(import.meta.url);
2
+ import {
3
+ loadStored,
4
+ rowsToSurface
5
+ } from "./chunk-DB2VF5UD.js";
6
+ import {
7
+ fetchServerManifest,
8
+ missingConfig
9
+ } from "./chunk-LEGPB7DO.js";
10
+ import {
11
+ SEVERITY_RANK
12
+ } from "./chunk-Q5VPF4WI.js";
13
+ import {
14
+ checkMcpStack,
15
+ isCrowded
16
+ } from "./chunk-VL2E5T2A.js";
17
+ import {
18
+ MCP_TIER,
19
+ contractOf
20
+ } from "./chunk-6EQ3ARXA.js";
21
+ import {
22
+ enqueueSurface
23
+ } from "./chunk-LO35HLQZ.js";
24
+ import {
25
+ assessVerdict
26
+ } from "./chunk-QSL6QN5X.js";
27
+ import {
28
+ queryVulnerableInstalls
29
+ } from "./chunk-LRD4GBYE.js";
30
+ import {
31
+ mcpChangeEvents,
32
+ mcpContracts,
33
+ mcpDeployments,
34
+ mcpObservations,
35
+ mcpPublicReports,
36
+ packages
37
+ } from "./chunk-LYMPYETA.js";
38
+ import {
39
+ require_semver
40
+ } from "./chunk-3GHJR7XR.js";
41
+ import {
42
+ logger
43
+ } from "./chunk-MYGSLK44.js";
44
+ import {
45
+ __toESM,
46
+ init_esm_shims
47
+ } from "./chunk-I3M2KJXB.js";
48
+
49
+ // src/mcp/auditHandler.ts
50
+ init_esm_shims();
51
+
52
+ // src/audit/accountScans.ts
53
+ init_esm_shims();
54
+
55
+ // src/db/mcpScans.ts
56
+ init_esm_shims();
57
+ import { and, desc, eq, inArray, isNull, sql } from "drizzle-orm";
58
+ async function putContract(db, row) {
59
+ await db.insert(mcpContracts).values(row).onConflictDoNothing();
60
+ }
61
+ async function getContract(db, contentHash) {
62
+ const [row] = await db.select().from(mcpContracts).where(eq(mcpContracts.contentHash, contentHash)).limit(1);
63
+ return row ?? null;
64
+ }
65
+ async function countDeployments(db, ownerId) {
66
+ const [row] = await db.select({ n: sql`count(*)::int` }).from(mcpDeployments).where(eq(mcpDeployments.ownerId, ownerId));
67
+ return row?.n ?? 0;
68
+ }
69
+ async function deploymentExists(db, ownerId, serverKey, configFingerprint) {
70
+ const [row] = await db.select({ id: mcpDeployments.id }).from(mcpDeployments).where(
71
+ and(
72
+ eq(mcpDeployments.ownerId, ownerId),
73
+ eq(mcpDeployments.serverKey, serverKey),
74
+ eq(mcpDeployments.configFingerprint, configFingerprint)
75
+ )
76
+ ).limit(1);
77
+ return !!row;
78
+ }
79
+ async function recordScan(db, input, diff) {
80
+ return db.transaction(async (tx) => {
81
+ const now = /* @__PURE__ */ new Date();
82
+ const inserted = await tx.insert(mcpDeployments).values({
83
+ ownerId: input.ownerId,
84
+ serverKey: input.serverKey,
85
+ configFingerprint: input.configFingerprint,
86
+ alias: input.alias,
87
+ registry: input.registry,
88
+ packageName: input.packageName,
89
+ transport: input.transport,
90
+ lastStatus: input.status,
91
+ firstSeenAt: now,
92
+ lastScannedAt: now
93
+ }).onConflictDoNothing({
94
+ target: [mcpDeployments.ownerId, mcpDeployments.serverKey, mcpDeployments.configFingerprint]
95
+ }).returning({ id: mcpDeployments.id });
96
+ const isFirst = inserted.length > 0;
97
+ const [dep] = await tx.select().from(mcpDeployments).where(
98
+ and(
99
+ eq(mcpDeployments.ownerId, input.ownerId),
100
+ eq(mcpDeployments.serverKey, input.serverKey),
101
+ eq(mcpDeployments.configFingerprint, input.configFingerprint)
102
+ )
103
+ ).for("update").limit(1);
104
+ if (!dep) throw new Error("deployment vanished inside its own transaction");
105
+ const [last] = await tx.select().from(mcpObservations).where(eq(mcpObservations.deploymentId, dep.id)).orderBy(desc(mcpObservations.id)).limit(1);
106
+ const same = last && last.status === input.status && last.contentHash === input.contentHash && last.serverVersion === input.serverVersion;
107
+ if (same) {
108
+ await tx.update(mcpObservations).set({ lastSeenAt: now, scanCount: sql`${mcpObservations.scanCount} + 1` }).where(eq(mcpObservations.id, last.id));
109
+ } else {
110
+ await tx.insert(mcpObservations).values({
111
+ deploymentId: dep.id,
112
+ ownerId: input.ownerId,
113
+ status: input.status,
114
+ contentHash: input.contentHash,
115
+ serverVersion: input.serverVersion,
116
+ error: input.error,
117
+ source: input.source,
118
+ firstSeenAt: now,
119
+ lastSeenAt: now
120
+ });
121
+ }
122
+ let change = isFirst ? "first" : "unchanged";
123
+ let event = null;
124
+ const moved = !isFirst && input.contentHash && dep.lastContentHash && input.contentHash !== dep.lastContentHash;
125
+ if (moved) {
126
+ const [previous] = await tx.select().from(mcpContracts).where(eq(mcpContracts.contentHash, dep.lastContentHash)).limit(1);
127
+ if (previous) {
128
+ const d = diff(previous);
129
+ await tx.insert(mcpChangeEvents).values({
130
+ deploymentId: dep.id,
131
+ ownerId: input.ownerId,
132
+ fromHash: dep.lastContentHash,
133
+ toHash: input.contentHash,
134
+ severity: d.severity,
135
+ summary: d.summary.slice(0, 1e3),
136
+ diff: d,
137
+ createdAt: now
138
+ }).onConflictDoUpdate({
139
+ target: [mcpChangeEvents.deploymentId, mcpChangeEvents.fromHash, mcpChangeEvents.toHash],
140
+ set: { createdAt: now, acknowledgedAt: null, severity: d.severity, summary: d.summary.slice(0, 1e3), diff: d }
141
+ });
142
+ change = "changed";
143
+ event = { at: now, severity: d.severity, summary: d.summary, rugPull: d.rugPull };
144
+ }
145
+ } else if (!isFirst && dep.lastStatus !== input.status) {
146
+ change = "status_changed";
147
+ }
148
+ await tx.update(mcpDeployments).set({
149
+ alias: input.alias,
150
+ transport: input.transport,
151
+ packageName: input.packageName,
152
+ lastStatus: input.status,
153
+ lastError: input.error,
154
+ lastScannedAt: now,
155
+ ...input.serverName !== null ? { serverName: input.serverName } : {},
156
+ ...input.serverVersion !== null ? { serverVersion: input.serverVersion } : {},
157
+ // A failed scan keeps the last contract that was read: "the server was
158
+ // unreachable today" must not erase what it exposed yesterday.
159
+ ...input.contentHash ? { lastContentHash: input.contentHash, worstSeverity: input.worstSeverity } : {},
160
+ ...moved || isFirst ? { lastChangedAt: now } : {}
161
+ }).where(eq(mcpDeployments.id, dep.id));
162
+ return { deploymentId: dep.id, change, event };
163
+ });
164
+ }
165
+ async function reportPublic(db, row) {
166
+ await db.insert(mcpPublicReports).values(row).onConflictDoNothing();
167
+ const [agree] = await db.select({ n: sql`count(distinct ${mcpPublicReports.ownerId})::int` }).from(mcpPublicReports).where(
168
+ and(
169
+ eq(mcpPublicReports.registry, row.registry),
170
+ eq(mcpPublicReports.packageName, row.packageName),
171
+ eq(mcpPublicReports.version, row.version),
172
+ eq(mcpPublicReports.contentHash, row.contentHash)
173
+ )
174
+ );
175
+ return agree?.n ?? 0;
176
+ }
177
+ var RANK = { critical: 0, high: 1, moderate: 2, low: 3, info: 4 };
178
+ async function listDeployments(db, ownerId) {
179
+ const rows = await db.select({ d: mcpDeployments, c: { toolCount: mcpContracts.toolCount, analysis: mcpContracts.analysis } }).from(mcpDeployments).leftJoin(mcpContracts, eq(mcpContracts.contentHash, mcpDeployments.lastContentHash)).where(eq(mcpDeployments.ownerId, ownerId)).orderBy(desc(mcpDeployments.lastScannedAt)).limit(500);
180
+ if (rows.length === 0) return [];
181
+ const open = await db.select({ deploymentId: mcpChangeEvents.deploymentId, severity: mcpChangeEvents.severity }).from(mcpChangeEvents).where(
182
+ and(
183
+ eq(mcpChangeEvents.ownerId, ownerId),
184
+ isNull(mcpChangeEvents.acknowledgedAt),
185
+ inArray(
186
+ mcpChangeEvents.deploymentId,
187
+ rows.map((r) => r.d.id)
188
+ )
189
+ )
190
+ );
191
+ const byDep = /* @__PURE__ */ new Map();
192
+ for (const e of open) {
193
+ const cur = byDep.get(e.deploymentId) ?? { n: 0, worst: null };
194
+ cur.n++;
195
+ if (!cur.worst || RANK[e.severity] < RANK[cur.worst]) cur.worst = e.severity;
196
+ byDep.set(e.deploymentId, cur);
197
+ }
198
+ return rows.map(({ d, c }) => ({
199
+ ...d,
200
+ toolCount: c?.toolCount ?? null,
201
+ writes: c?.analysis?.stats.writes ?? null,
202
+ destroys: c?.analysis?.stats.destroys ?? null,
203
+ capabilities: c?.analysis?.stats.capabilities ?? {},
204
+ findings: c?.analysis?.findings.filter((f) => f.severity !== "info").length ?? 0,
205
+ openEvents: byDep.get(d.id)?.n ?? 0,
206
+ openWorst: byDep.get(d.id)?.worst ?? null
207
+ }));
208
+ }
209
+ async function getDeploymentDetail(db, ownerId, id) {
210
+ const [deployment] = await db.select().from(mcpDeployments).where(and(eq(mcpDeployments.id, id), eq(mcpDeployments.ownerId, ownerId))).limit(1);
211
+ if (!deployment) return null;
212
+ const [contract, observations, events] = await Promise.all([
213
+ deployment.lastContentHash ? getContract(db, deployment.lastContentHash) : Promise.resolve(null),
214
+ db.select().from(mcpObservations).where(and(eq(mcpObservations.deploymentId, id), eq(mcpObservations.ownerId, ownerId))).orderBy(desc(mcpObservations.id)).limit(60),
215
+ db.select().from(mcpChangeEvents).where(and(eq(mcpChangeEvents.deploymentId, id), eq(mcpChangeEvents.ownerId, ownerId))).orderBy(desc(mcpChangeEvents.createdAt)).limit(50)
216
+ ]);
217
+ return { deployment, contract, observations, events };
218
+ }
219
+ async function listChangeEvents(db, ownerId, opts = {}) {
220
+ const rows = await db.select({ e: mcpChangeEvents, alias: mcpDeployments.alias, serverKey: mcpDeployments.serverKey }).from(mcpChangeEvents).innerJoin(mcpDeployments, eq(mcpDeployments.id, mcpChangeEvents.deploymentId)).where(
221
+ and(eq(mcpChangeEvents.ownerId, ownerId), opts.openOnly ? isNull(mcpChangeEvents.acknowledgedAt) : void 0)
222
+ ).orderBy(desc(mcpChangeEvents.createdAt)).limit(Math.min(opts.limit ?? 50, 200));
223
+ return rows.map((r) => ({ ...r.e, alias: r.alias, serverKey: r.serverKey }));
224
+ }
225
+ async function acknowledgeEvent(db, ownerId, eventId) {
226
+ const rows = await db.update(mcpChangeEvents).set({ acknowledgedAt: /* @__PURE__ */ new Date() }).where(and(eq(mcpChangeEvents.id, eventId), eq(mcpChangeEvents.ownerId, ownerId))).returning({ id: mcpChangeEvents.id });
227
+ return rows.length > 0;
228
+ }
229
+ async function listAccountDeployments(db, ownerId) {
230
+ const summaries = await listDeployments(db, ownerId);
231
+ const hashes = [...new Set(summaries.map((s) => s.lastContentHash).filter((h) => !!h))];
232
+ const analyses = hashes.length ? await db.select({ hash: mcpContracts.contentHash, analysis: mcpContracts.analysis }).from(mcpContracts).where(inArray(mcpContracts.contentHash, hashes)) : [];
233
+ const byHash = new Map(analyses.map((a) => [a.hash, a.analysis]));
234
+ return summaries.map((s) => ({
235
+ serverKey: s.serverKey,
236
+ alias: s.alias,
237
+ lastStatus: s.lastStatus,
238
+ lastError: s.lastError,
239
+ lastContentHash: s.lastContentHash,
240
+ lastScannedAt: s.lastScannedAt,
241
+ analysis: s.lastContentHash ? byHash.get(s.lastContentHash) ?? null : null,
242
+ openEvents: s.openEvents,
243
+ openWorst: s.openWorst
244
+ }));
245
+ }
246
+
247
+ // src/audit/accountScans.ts
248
+ var STALE_AFTER_DAYS = 14;
249
+ var MAX_TOOL_FINDINGS = 5;
250
+ var DAY_MS = 864e5;
251
+ function matchDeployment(s, deployments) {
252
+ const host = s.endpoint?.toLowerCase();
253
+ const candidates = deployments.filter((d) => {
254
+ if (s.packageName) return d.serverKey === `npm:${s.packageName}`;
255
+ if (s.kind === "remote" && host) return d.serverKey === `remote:${host}` || d.serverKey.startsWith(`remote:${host}/`);
256
+ return d.alias === s.alias;
257
+ });
258
+ return candidates.sort((a, b) => b.lastScannedAt.getTime() - a.lastScannedAt.getTime())[0] ?? null;
259
+ }
260
+ var toolFinding = (f) => ({
261
+ kind: "tool-safety",
262
+ severity: f.severity,
263
+ detail: `${f.tool ? `${f.tool}: ` : ""}${f.detail}${f.evidence ? ` (${f.evidence.slice(0, 120)})` : ""}`
264
+ });
265
+ function enrich(item, d, now) {
266
+ const age = Math.floor((now.getTime() - d.lastScannedAt.getTime()) / DAY_MS);
267
+ if (d.lastStatus === "needs_config" || d.lastStatus === "auth_required") {
268
+ item.findings.push({
269
+ kind: "needs-config",
270
+ severity: "moderate",
271
+ detail: `your last scan could not connect: ${d.lastError ?? d.lastStatus}`
272
+ });
273
+ } else if (d.lastStatus !== "ok" && d.lastStatus !== "partial") {
274
+ item.findings.push({
275
+ kind: "contract-drift",
276
+ severity: "low",
277
+ detail: `your last scan failed (${d.lastStatus}${d.lastError ? `: ${d.lastError}` : ""})`
278
+ });
279
+ }
280
+ if (!d.lastContentHash || !d.analysis) return;
281
+ if (item.status !== "answered") {
282
+ item.status = "answered";
283
+ delete item.skipReason;
284
+ item.findings = item.findings.filter((f) => !(f.kind === "contract-drift" && f.severity === "info"));
285
+ }
286
+ if (age > STALE_AFTER_DAYS) {
287
+ item.findings.push({
288
+ kind: "contract-drift",
289
+ severity: "info",
290
+ detail: `answered from your own scan ${age} days ago; run \`lurq mcp-scan\` for a current read`
291
+ });
292
+ }
293
+ if (d.openEvents > 0) {
294
+ item.findings.push({
295
+ kind: "contract-drift",
296
+ severity: d.openWorst ?? "low",
297
+ detail: `${d.openEvents} unacknowledged change(s) to what this server tells your agent; review them in the dashboard`
298
+ });
299
+ }
300
+ const serious = d.analysis.findings.filter((f) => SEVERITY_RANK[f.severity] <= SEVERITY_RANK.moderate).sort((a, b) => SEVERITY_RANK[a.severity] - SEVERITY_RANK[b.severity]);
301
+ item.findings.push(...serious.slice(0, MAX_TOOL_FINDINGS).map(toolFinding));
302
+ if (serious.length > MAX_TOOL_FINDINGS) {
303
+ item.findings.push({
304
+ kind: "tool-safety",
305
+ severity: "info",
306
+ detail: `${serious.length - MAX_TOOL_FINDINGS} more tool finding(s) in the dashboard`
307
+ });
308
+ }
309
+ const { tools, writes, destroys } = d.analysis.stats;
310
+ if (destroys > 0 && !item.findings.some((f) => f.kind === "privilege")) {
311
+ item.findings.push({
312
+ kind: "privilege",
313
+ severity: "low",
314
+ detail: `${writes} of ${tools} tools can modify something and ${destroys} can destroy, by their own annotations`
315
+ });
316
+ }
317
+ }
318
+ function applyAccountScans(report, servers, deployments, now = /* @__PURE__ */ new Date()) {
319
+ if (!deployments.length || !servers.length) return { report, answered: 0 };
320
+ const mcpItems = report.items.filter((i) => i.unit === "mcp");
321
+ if (mcpItems.length !== servers.length) return { report, answered: 0 };
322
+ let answered = 0;
323
+ servers.forEach((s, i) => {
324
+ const d = matchDeployment(s, deployments);
325
+ if (!d) return;
326
+ const item = mcpItems[i];
327
+ const before = item.status;
328
+ enrich(item, d, now);
329
+ if (before !== "answered" && item.status === "answered") answered++;
330
+ });
331
+ if (answered) {
332
+ const declared = report.items.filter((i) => i.unit !== "transitive");
333
+ report.coverage = {
334
+ ...report.coverage,
335
+ answered: declared.filter((i) => i.status === "answered").length,
336
+ queued: declared.filter((i) => i.status === "queued").length,
337
+ skipped: declared.filter((i) => i.status === "skipped").length
338
+ };
339
+ report.notes = [...report.notes, `${answered} MCP server(s) answered from your own live scans`];
340
+ }
341
+ return { report, answered };
342
+ }
343
+ async function withAccountScans(db, ownerId, report, servers) {
344
+ if (!ownerId || !servers.length) return report;
345
+ try {
346
+ return applyAccountScans(report, servers, await listAccountDeployments(db, ownerId)).report;
347
+ } catch {
348
+ return report;
349
+ }
350
+ }
351
+
352
+ // src/audit/assess.ts
353
+ init_esm_shims();
354
+ var import_semver = __toESM(require_semver(), 1);
355
+ import { inArray as inArray2 } from "drizzle-orm";
356
+ var NAME_CHUNK = 500;
357
+ async function loadIndexed(db, names) {
358
+ const out = /* @__PURE__ */ new Map();
359
+ for (let i = 0; i < names.length; i += NAME_CHUNK) {
360
+ const chunk = names.slice(i, i + NAME_CHUNK);
361
+ const rows = await db.select({
362
+ name: packages.name,
363
+ latestVersion: packages.latestVersion,
364
+ deprecated: packages.deprecated,
365
+ advisories: packages.advisories
366
+ }).from(packages).where(inArray2(packages.name, chunk));
367
+ for (const r of rows) out.set(r.name, r);
368
+ }
369
+ return out;
370
+ }
371
+ function drift(installed, latest) {
372
+ const a = import_semver.default.coerce(installed);
373
+ const b = import_semver.default.coerce(latest);
374
+ if (!a || !b || import_semver.default.gte(a, b)) return null;
375
+ const majors = b.major - a.major;
376
+ if (majors > 0) {
377
+ return {
378
+ kind: "outdated",
379
+ severity: majors >= 2 ? "moderate" : "low",
380
+ detail: `${installed} \u2192 ${latest} (${majors} major version${majors > 1 ? "s" : ""} behind; run \`lurq usage\` for the exact API delta before upgrading)`
381
+ };
382
+ }
383
+ if (b.minor > a.minor) {
384
+ return {
385
+ kind: "outdated",
386
+ severity: "info",
387
+ detail: `${installed} \u2192 ${latest} (minor versions behind)`
388
+ };
389
+ }
390
+ return {
391
+ kind: "outdated",
392
+ severity: "info",
393
+ detail: `${installed} \u2192 ${latest} (patches behind)`
394
+ };
395
+ }
396
+ var OSV_SEVERITY = "high";
397
+ function assessPackage(pkg, idx, vulns, vulnLookupComplete) {
398
+ const item = {
399
+ name: pkg.name,
400
+ unit: "npm",
401
+ installed: pkg.installed,
402
+ latest: idx?.latestVersion ?? null,
403
+ status: "answered",
404
+ findings: []
405
+ };
406
+ const verdict = assessVerdict({
407
+ exists: true,
408
+ // Null, not `[]`: an unindexed package has not been analysed, and saying
409
+ // "no advisories" about it would be inventing an all-clear.
410
+ advisories: idx ? idx.advisories ?? null : null,
411
+ deprecated: idx?.deprecated ?? false,
412
+ versionVulns: vulns ?? null,
413
+ vulnLookupComplete,
414
+ // The audit is always about what is INSTALLED, never about latest. Saying
415
+ // so is what keeps it from reading as a contradiction of `verify`, which
416
+ // answers about the newest release.
417
+ subjectVersion: pkg.installed,
418
+ subjectInstalled: true
419
+ });
420
+ item.verdict = verdict;
421
+ if (vulns?.length) {
422
+ item.findings.push({
423
+ kind: "vulnerable",
424
+ severity: OSV_SEVERITY,
425
+ detail: `${pkg.installed} is affected by ${vulns.length} advisory(ies): ${vulns.slice(0, 4).join(", ")}${vulns.length > 4 ? ", \u2026" : ""}`
426
+ });
427
+ }
428
+ if (!idx) {
429
+ item.status = "queued";
430
+ item.skipReason = "not-in-index";
431
+ return item;
432
+ }
433
+ if (idx.deprecated) {
434
+ item.findings.push({
435
+ kind: "deprecated",
436
+ severity: "moderate",
437
+ detail: "the publisher has marked this package deprecated"
438
+ });
439
+ }
440
+ if (!pkg.installed && (idx.advisories?.length ?? 0) > 0) {
441
+ item.findings.push({
442
+ kind: "vulnerable",
443
+ severity: "moderate",
444
+ detail: `${idx.advisories.length} advisory(ies) recorded against this package; nothing is installed, so no exact-version check was possible`
445
+ });
446
+ }
447
+ if (pkg.installed && idx.latestVersion) {
448
+ const d = drift(pkg.installed, idx.latestVersion);
449
+ if (d) item.findings.push(d);
450
+ } else if (!pkg.installed) {
451
+ item.status = "skipped";
452
+ item.skipReason = "not-installed";
453
+ }
454
+ return item;
455
+ }
456
+ function privilegeSummary(tools) {
457
+ return {
458
+ writes: tools.filter((t) => !t.annotations.readOnlyHint).length,
459
+ destroys: tools.filter((t) => t.annotations.destructiveHint).length
460
+ };
461
+ }
462
+ async function assessMcpServer(db, s, idx) {
463
+ const name = s.packageName ?? s.endpoint ?? s.alias;
464
+ const item = {
465
+ name,
466
+ unit: "mcp",
467
+ installed: s.version,
468
+ latest: null,
469
+ status: "answered",
470
+ findings: []
471
+ };
472
+ if (s.kind !== "npm-stdio" || !s.packageName) {
473
+ item.status = "skipped";
474
+ item.skipReason = "not-npm";
475
+ item.findings.push({
476
+ kind: "contract-drift",
477
+ severity: "info",
478
+ detail: s.kind === "remote" ? `hosted at ${s.endpoint ?? "an endpoint"}; there is no package to install, so lurq's stdio probe does not apply and its contract can change with no version to observe` : s.kind === "other-registry" ? "launched from a registry lurq does not index (PyPI or similar)" : "launched from a local path, so there is no published artifact to compare against"
479
+ });
480
+ return item;
481
+ }
482
+ const manifest = await fetchServerManifest(s.packageName).catch(() => null);
483
+ const missing = missingConfig(manifest);
484
+ if (missing.length) {
485
+ item.findings.push({
486
+ kind: "needs-config",
487
+ severity: "moderate",
488
+ detail: `needs ${missing.map((m) => m.name).join(", ")} before it will start${missing.some((m) => m.secret) ? " (at least one is a credential \u2014 ask the user, never guess)" : ""}`
489
+ });
490
+ }
491
+ item.latest = idx?.latestVersion ?? null;
492
+ if (idx?.deprecated) {
493
+ item.findings.push({
494
+ kind: "deprecated",
495
+ severity: "moderate",
496
+ detail: "the publisher has marked this server deprecated"
497
+ });
498
+ }
499
+ if ((idx?.advisories?.length ?? 0) > 0) {
500
+ item.findings.push({
501
+ kind: "vulnerable",
502
+ severity: "high",
503
+ detail: `${idx.advisories.length} advisory(ies) recorded against this server`
504
+ });
505
+ }
506
+ if (s.version && idx?.latestVersion) {
507
+ const d = drift(s.version, idx.latestVersion);
508
+ if (d) {
509
+ item.findings.push({
510
+ ...d,
511
+ detail: `${s.version} \u2192 ${idx.latestVersion}; run \`lurq mcp-drift ${s.packageName} --from ${s.version} --to ${idx.latestVersion}\` for the contract delta`
512
+ });
513
+ }
514
+ } else if (!idx) {
515
+ item.skipReason ??= "not-in-index";
516
+ }
517
+ const stored = await loadStored(db, s.packageName, s.version, 0, "mcp_server");
518
+ if (!stored || stored.rows.length === 0) {
519
+ await enqueueSurface(db, s.packageName, s.version, "mcp_server").catch(() => {
520
+ });
521
+ item.status = "queued";
522
+ item.skipReason = "never-probed";
523
+ return item;
524
+ }
525
+ if (stored.verdict === "verified_false") {
526
+ item.findings.push({
527
+ kind: "contract-drift",
528
+ severity: "high",
529
+ detail: "probed and it did not complete the MCP handshake in a clean install"
530
+ });
531
+ return item;
532
+ }
533
+ const surface = rowsToSurface(s.packageName, s.version, stored.rows, MCP_TIER);
534
+ const annotated = surface.symbols.map((sym) => ({
535
+ annotations: contractOf(sym)?.annotations ?? {
536
+ readOnlyHint: false,
537
+ destructiveHint: true,
538
+ idempotentHint: false,
539
+ openWorldHint: true
540
+ }
541
+ }));
542
+ const { writes, destroys } = privilegeSummary(annotated);
543
+ if (destroys > 0) {
544
+ item.findings.push({
545
+ kind: "privilege",
546
+ severity: "low",
547
+ detail: `${surface.symbols.length} tool(s); ${writes} can write and ${destroys} declare destructive effects`
548
+ });
549
+ }
550
+ if (!s.version) {
551
+ item.skipReason = "unpinned";
552
+ item.findings.push({
553
+ kind: "contract-drift",
554
+ severity: "moderate",
555
+ detail: "launched unpinned, so every start may fetch a different build; lurq cannot tell you what changed because your config never named a version. Pin it to make drift observable."
556
+ });
557
+ }
558
+ return item;
559
+ }
560
+ async function assessInventory(db, inv, opts = {}) {
561
+ const lookup = opts.vulnLookup ?? queryVulnerableInstalls;
562
+ const names = [
563
+ ...inv.packages.map((p) => p.name),
564
+ ...inv.mcpServers.map((s) => s.packageName).filter((n) => Boolean(n))
565
+ ];
566
+ const indexed = await loadIndexed(db, names);
567
+ const installs = [
568
+ ...inv.packages.filter((p) => p.installed !== null).map((p) => ({ name: p.name, version: p.installed })),
569
+ ...inv.transitives.map((t) => ({ name: t.name, version: t.version }))
570
+ ];
571
+ let affected = /* @__PURE__ */ new Map();
572
+ let vulnComplete = true;
573
+ try {
574
+ const res = await lookup(installs);
575
+ affected = res.affected;
576
+ vulnComplete = res.complete;
577
+ } catch (err) {
578
+ vulnComplete = false;
579
+ logger.warn({ err: String(err) }, "audit: vulnerability lookup failed");
580
+ }
581
+ const items = [];
582
+ for (const p of inv.packages) {
583
+ const item = assessPackage(
584
+ p,
585
+ indexed.get(p.name),
586
+ p.installed ? affected.get(`${p.name}@${p.installed}`) : void 0,
587
+ vulnComplete
588
+ );
589
+ items.push(item);
590
+ }
591
+ for (const t of inv.transitives) {
592
+ const vulns = affected.get(`${t.name}@${t.version}`);
593
+ if (!vulns?.length) continue;
594
+ items.push({
595
+ name: t.name,
596
+ unit: "transitive",
597
+ installed: t.version,
598
+ latest: null,
599
+ status: "answered",
600
+ via: t.via,
601
+ findings: [
602
+ {
603
+ kind: "vulnerable",
604
+ severity: OSV_SEVERITY,
605
+ detail: `${t.version} is affected by ${vulns.length} advisory(ies): ${vulns.slice(0, 4).join(", ")}${vulns.length > 4 ? ", \u2026" : ""}` + // Without this the finding is unactionable: nobody installed the
606
+ // transitive on purpose, so the fix is always at a direct dep.
607
+ (t.via.length ? ` \u2014 pulled in via ${t.via.slice(0, 3).join(", ")}${t.via.length > 3 ? ` and ${t.via.length - 3} more` : ""}` : " \u2014 no path recorded in the lockfile")
608
+ }
609
+ ]
610
+ });
611
+ }
612
+ for (const s of inv.mcpServers) {
613
+ items.push(
614
+ await assessMcpServer(db, s, s.packageName ? indexed.get(s.packageName) : void 0)
615
+ );
616
+ }
617
+ const declared = items.filter((i) => i.unit !== "transitive");
618
+ const stackNotes = [];
619
+ const stdioServers = inv.mcpServers.filter((s) => s.kind === "npm-stdio" && s.packageName);
620
+ if (stdioServers.length > 1) {
621
+ const stack = await checkMcpStack(
622
+ db,
623
+ stdioServers.map((s) => ({ server: s.packageName, version: s.version }))
624
+ ).catch(() => null);
625
+ for (const c of stack?.collisions ?? []) {
626
+ for (const server of c.servers) {
627
+ const item = items.find((i) => i.unit === "mcp" && i.name === server);
628
+ item?.findings.push({
629
+ kind: "contract-drift",
630
+ severity: c.writes ? "high" : "moderate",
631
+ detail: `tool name "${c.tool}" is also exposed by ${c.servers.filter((x) => x !== server).join(", ")}; the agent cannot say which it means` + (c.writes ? " \u2014 and at least one of them can modify something" : "")
632
+ });
633
+ }
634
+ }
635
+ if (stack && isCrowded(stack)) {
636
+ stackNotes.push(
637
+ `${stack.totalTools} MCP tools across ${stdioServers.length} servers (~${stack.estimatedContextTokens.toLocaleString()} tokens of schema in every request) \u2014 worth trimming`
638
+ );
639
+ }
640
+ if (stack?.unread.length) {
641
+ stackNotes.push(
642
+ `tool-name collisions were only checked across the ${stdioServers.length - stack.unread.length} probed server(s); ${stack.unread.length} unprobed`
643
+ );
644
+ }
645
+ }
646
+ const coverage = {
647
+ discovered: declared.length,
648
+ answered: declared.filter((i) => i.status === "answered").length,
649
+ queued: declared.filter((i) => i.status === "queued").length,
650
+ skipped: declared.filter((i) => i.status === "skipped").length,
651
+ transitivesChecked: inv.transitives.length,
652
+ treeRead: inv.transitives.length > 0,
653
+ vulnComplete
654
+ };
655
+ const notes = [...inv.notes, ...stackNotes];
656
+ if (!vulnComplete) {
657
+ notes.push(
658
+ "the vulnerability lookup did not complete, so vulnerability results are PARTIAL \u2014 absence of a finding here is not an all-clear"
659
+ );
660
+ }
661
+ if (coverage.queued) {
662
+ notes.push(
663
+ `${coverage.queued} item(s) are not in the index yet and have been queued; re-run shortly for a complete answer`
664
+ );
665
+ }
666
+ return { root: inv.root, items, coverage, notes, dataAsOf: (/* @__PURE__ */ new Date()).toISOString() };
667
+ }
668
+ async function queueUnknown(db, report, ownerId = null) {
669
+ const names = report.items.filter((i) => i.unit !== "transitive" && i.skipReason === "not-in-index").map((i) => i.name);
670
+ if (names.length === 0) return 0;
671
+ try {
672
+ const { enqueueIngest } = await import("./ingestQueue-VKN4KBIF.js");
673
+ for (const name of names) enqueueIngest(db, name, ownerId);
674
+ } catch (err) {
675
+ logger.debug(`audit: untracked-dep enqueue failed: ${String(err)}`);
676
+ return 0;
677
+ }
678
+ return names.length;
679
+ }
680
+
681
+ // src/mcp/auditHandler.ts
682
+ var MAX = 600;
683
+ async function handleAudit(db, input, ownerId = null) {
684
+ const notes = [...input.notes ?? []];
685
+ const pkgs = (input.packages ?? []).slice(0, MAX);
686
+ const servers = (input.mcpServers ?? []).slice(0, Math.max(0, MAX - pkgs.length));
687
+ if ((input.packages?.length ?? 0) + (input.mcpServers?.length ?? 0) > MAX) {
688
+ notes.push(`inventory exceeded ${MAX} items; the remainder were not assessed`);
689
+ }
690
+ const inv = {
691
+ root: "",
692
+ packages: pkgs.map((p) => ({
693
+ name: p.name,
694
+ range: p.range ?? "*",
695
+ installed: p.installed ?? null,
696
+ sources: []
697
+ })),
698
+ mcpServers: servers.map((s) => ({
699
+ alias: s.alias ?? s.packageName ?? "server",
700
+ // Trust but bound: an unknown kind is treated as the least capable case
701
+ // rather than assumed probeable, so a bad client cannot make lurq claim
702
+ // it read something it did not.
703
+ kind: s.kind === "npm-stdio" || s.kind === "remote" || s.kind === "local" || s.kind === "other-registry" ? s.kind : "local",
704
+ packageName: s.packageName ?? null,
705
+ version: s.version ?? null,
706
+ endpoint: s.endpoint ?? null,
707
+ sources: []
708
+ })),
709
+ transitives: (input.transitives ?? []).slice(0, 4e3).map((t) => ({
710
+ name: t.name,
711
+ version: t.version,
712
+ via: t.via ?? []
713
+ })),
714
+ filesRead: [],
715
+ notes
716
+ };
717
+ const report = await withAccountScans(db, ownerId, await assessInventory(db, inv), inv.mcpServers);
718
+ await queueUnknown(db, report);
719
+ return { ...report, root: null };
720
+ }
721
+
722
+ export {
723
+ putContract,
724
+ countDeployments,
725
+ deploymentExists,
726
+ recordScan,
727
+ reportPublic,
728
+ listDeployments,
729
+ getDeploymentDetail,
730
+ listChangeEvents,
731
+ acknowledgeEvent,
732
+ handleAudit
733
+ };