lurqrun 0.0.5 → 0.0.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 (35) hide show
  1. package/README.md +71 -13
  2. package/dist/bin/lurq.js +8762 -4825
  3. package/dist/bin/lurq.js.map +1 -1
  4. package/dist/index.d.ts +143 -4
  5. package/dist/index.js +8685 -4741
  6. package/dist/index.js.map +1 -1
  7. package/drizzle/0011_compat_provenance_closures.sql +11 -0
  8. package/drizzle/0012_api_surfaces.sql +9 -0
  9. package/drizzle/0013_nice_thanos.sql +1 -0
  10. package/drizzle/0014_luxuriant_malcolm_colcord.sql +10 -0
  11. package/drizzle/0015_past_fat_cobra.sql +11 -0
  12. package/drizzle/0016_futuristic_junta.sql +50 -0
  13. package/drizzle/0017_absent_grandmaster.sql +20 -0
  14. package/drizzle/0018_rainy_proemial_gods.sql +1 -0
  15. package/drizzle/0019_dashing_korvac.sql +11 -0
  16. package/drizzle/0020_normal_vulture.sql +3 -0
  17. package/drizzle/0021_dazzling_blue_shield.sql +17 -0
  18. package/drizzle/0022_massive_ghost_rider.sql +24 -0
  19. package/drizzle/0023_next_shatterstar.sql +1 -0
  20. package/drizzle/meta/0011_snapshot.json +1049 -0
  21. package/drizzle/meta/0012_snapshot.json +1115 -0
  22. package/drizzle/meta/0013_snapshot.json +1121 -0
  23. package/drizzle/meta/0014_snapshot.json +1190 -0
  24. package/drizzle/meta/0015_snapshot.json +1280 -0
  25. package/drizzle/meta/0016_snapshot.json +1683 -0
  26. package/drizzle/meta/0017_snapshot.json +1834 -0
  27. package/drizzle/meta/0018_snapshot.json +1834 -0
  28. package/drizzle/meta/0019_snapshot.json +1909 -0
  29. package/drizzle/meta/0020_snapshot.json +1921 -0
  30. package/drizzle/meta/0021_snapshot.json +2045 -0
  31. package/drizzle/meta/0022_snapshot.json +2246 -0
  32. package/drizzle/meta/0023_snapshot.json +2252 -0
  33. package/drizzle/meta/_journal.json +91 -0
  34. package/package.json +14 -5
  35. package/templates/skill-instructions.md +38 -16
package/dist/index.d.ts CHANGED
@@ -35,6 +35,16 @@ type Confidence = 'proven' | 'emerging' | 'promising' | 'unproven';
35
35
  type Runtime = 'browser' | 'node' | 'both';
36
36
  /** Result of co-installing two package versions in the sandbox (compat matrix). */
37
37
  type CompatStatus = 'compatible' | 'conflict';
38
+ /**
39
+ * Evidence class behind a compat edge (§3, §4B). Ordered weakest→strongest for
40
+ * upsert precedence: a mined `observed` must never overwrite a sandbox `verified`
41
+ * or `conflict`. `declared` = Tier-0 peer/engine semver; `observed` = co-resolved
42
+ * in N real dependency graphs; `verified` = sandbox co-install passed; `conflict`
43
+ * = declared conflict or a sandbox co-install failed.
44
+ */
45
+ type CompatProvenance = 'declared' | 'observed' | 'verified' | 'conflict';
46
+ /** Upsert precedence: higher wins, so mining can't erase a proven verdict. */
47
+ declare const PROVENANCE_RANK: Record<CompatProvenance, number>;
38
48
  /** Coarse post-install result an agent reports back via `report_outcome` — never
39
49
  * source code, just whether the recommended package installed / compiled /
40
50
  * passed tests, or failed. Feeds the recommendation→outcome flywheel (§3.1). */
@@ -61,6 +71,48 @@ interface CompatConflict {
61
71
  /** The packages involved in the conflict. */
62
72
  packages: string[];
63
73
  detail: string;
74
+ /** The same fact as `detail`, structured, so a consumer can lay it out without
75
+ * parsing prose. Present on peer-range violations; absent for engine and
76
+ * sandbox conflicts, which aren't about a single declared range. */
77
+ requirement?: {
78
+ /** The peer being asked for. */
79
+ peer: string;
80
+ /** The range the requirer declares. */
81
+ range: string;
82
+ /** What the set actually resolves that peer to, when it is in the set. */
83
+ resolved: string | null;
84
+ };
85
+ }
86
+ /**
87
+ * One unordered pair among the checked members.
88
+ *
89
+ * A verdict belongs to a pair, not to a package: the same package can sit in a
90
+ * held pair and a conflicting one, so grading packages would either contradict
91
+ * itself or paint the whole set red. `held` means no declared constraint between
92
+ * the two was violated — it does not mean the pair was executed. Nothing here
93
+ * has been executed.
94
+ */
95
+ interface CompatPair {
96
+ a: string;
97
+ b: string;
98
+ status: 'held' | 'conflict';
99
+ /** Only on `conflict` — the conflict's own detail string. */
100
+ detail?: string;
101
+ /** Only on `conflict`, and only for peer-range violations. */
102
+ requirement?: CompatConflict['requirement'];
103
+ }
104
+ /** One stored compat edge surfaced to agents, with its evidence class (§4B). */
105
+ interface CompatEvidence {
106
+ packages: [string, string];
107
+ versions: [string, string];
108
+ status: CompatStatus;
109
+ provenance: CompatProvenance;
110
+ /** Distinct resolved graphs an `observed` edge was witnessed in (0 otherwise).
111
+ * Only a newly-fetched closure accrues one; the daily re-mine re-reads closures
112
+ * it has already counted and deliberately does not. NOTE: rows minted before
113
+ * that fix carry an inflated count (one per sync run, ~16× on average) and are
114
+ * only corrected by a backfill, which has not been run. */
115
+ witnessCount: number;
64
116
  }
65
117
  /**
66
118
  * `compat` output: whole-architecture compatibility for a set of packages.
@@ -68,7 +120,13 @@ interface CompatConflict {
68
120
  */
69
121
  interface CompatOutput {
70
122
  packages: string[];
71
- overall: 'compatible' | 'conflict' | 'unknown';
123
+ /** Evidence-graded verdict:
124
+ * - `conflict` — a proven incompatibility (peer-range violation or conflict edge).
125
+ * - `compatible` — every pair is *positively evidenced* (verified/observed edge).
126
+ * - `likely` — no conflict found, but not proven; absence of a declared
127
+ * conflict is not proof, so an unverified set is never `compatible`.
128
+ * - `unknown` — a member has no metadata yet (not ingested). */
129
+ overall: 'compatible' | 'likely' | 'conflict' | 'unknown';
72
130
  conflicts: CompatConflict[];
73
131
  /** Packages lurq has no compatibility metadata for (counted toward `unknown`). */
74
132
  unverified: string[];
@@ -78,6 +136,60 @@ interface CompatOutput {
78
136
  name: string;
79
137
  version: string | null;
80
138
  }[];
139
+ /** Stored edges among these packages with their evidence strength (§4B) — lets
140
+ * agents (and metrics) see *why* a pair is called compatible, not just that. */
141
+ evidence: CompatEvidence[];
142
+ /** Every unordered pair among `checked`, each with its own verdict — exactly
143
+ * n(n−1)/2 entries. `conflicts` lists only what went wrong; this lists what
144
+ * was compared, which is what lets a caller show coverage rather than just
145
+ * failures. */
146
+ pairs: CompatPair[];
147
+ }
148
+ /** Kind of an exported symbol, from its `.d.ts` declaration. */
149
+ type ExportKind = 'function' | 'class' | 'interface' | 'type' | 'enum' | 'variable' | 'namespace' | 'unknown';
150
+ /** One normalized exported symbol of a package version's public API surface. */
151
+ interface ExportSymbol {
152
+ name: string;
153
+ kind: ExportKind;
154
+ /** Single-line normalized signature (params/return for functions, etc.), or
155
+ * null when the declaration carries no useful signature. */
156
+ signature: string | null;
157
+ }
158
+ /** What changed between two API surfaces (§4D). Deltas are computed, not guessed. */
159
+ interface SurfaceDelta {
160
+ added: ExportSymbol[];
161
+ removed: ExportSymbol[];
162
+ /** A symbol that disappeared and a near-identical one that appeared — inferred
163
+ * by signature similarity, so an agent sees a rename, not remove+add. */
164
+ renamed: {
165
+ from: ExportSymbol;
166
+ to: ExportSymbol;
167
+ }[];
168
+ /** Same name, changed signature. */
169
+ changed: {
170
+ name: string;
171
+ before: string | null;
172
+ after: string | null;
173
+ }[];
174
+ }
175
+ /** `usage` tool output: version-exact API surface + optional delta from a known
176
+ * version the agent was trained/working on (§4D). */
177
+ interface UsageOutput {
178
+ package: string;
179
+ version: string | null;
180
+ /** Extracted export list, or null when types are unavailable (falls back to
181
+ * the README, which is already fetched). */
182
+ surface: ExportSymbol[] | null;
183
+ available: boolean;
184
+ /** Declared `engines` for this exact version (e.g. `{ node: ">=20" }`), or null
185
+ * when the manifest declares none. Independent of `available` — the runtime
186
+ * floor matters even for untyped packages. */
187
+ engines: Record<string, string> | null;
188
+ /** Present when a `knownVersion` was supplied and both surfaces resolved. */
189
+ delta?: SurfaceDelta & {
190
+ fromVersion: string;
191
+ };
192
+ note?: string;
81
193
  }
82
194
  type AdvisorySeverity = 'critical' | 'high' | 'moderate' | 'low' | 'info';
83
195
  interface Advisory {
@@ -178,7 +290,7 @@ declare const SERVER_NAME = "lurq";
178
290
  * Keep in sync with package.json "name". */
179
291
  declare const PACKAGE_NAME = "lurqrun";
180
292
  /** Keep in sync with package.json "version". */
181
- declare const VERSION = "0.0.5";
293
+ declare const VERSION = "0.0.7";
182
294
  /** Default hosted endpoint the install wizard writes into agent configs. The
183
295
  * marketing site is `lurq.run`; the MCP service lives on the `api.` subdomain.
184
296
  * Overridable per-invocation with `lurq install --url …` or `LURQ_ENDPOINT`. */
@@ -201,7 +313,15 @@ declare const CACHE_TTL: {
201
313
  readonly bundlephobia: number;
202
314
  };
203
315
 
204
- /** Load `.env` into process.env exactly once. Safe to call repeatedly. */
316
+ /**
317
+ * Load env into process.env exactly once. Safe to call repeatedly.
318
+ *
319
+ * Layering: if `LURQ_ENV_FILE` is set (e.g. `.env.production`), that file loads
320
+ * *first* so its values win, then `.env` fills in the rest (dotenv never
321
+ * overrides an already-set key). This is how the explicit prod path works —
322
+ * `LURQ_ENV_FILE=.env.production` supplies the prod DATABASE_URL while `.env`
323
+ * still provides shared secrets — without prod ever being the ambient default.
324
+ */
205
325
  declare function loadEnv(): void;
206
326
  declare const EnvSchema: z.ZodObject<{
207
327
  DATABASE_URL: z.ZodOptional<z.ZodString>;
@@ -215,6 +335,12 @@ declare const EnvSchema: z.ZodObject<{
215
335
  SUMMARY_MODEL: z.ZodDefault<z.ZodString>;
216
336
  SUMMARY_BASE_URL: z.ZodDefault<z.ZodString>;
217
337
  LURQ_SYNC_CONCURRENCY: z.ZodDefault<z.ZodNumber>;
338
+ /** Stalest non-seed packages the daily sync refreshes on top of the seed list.
339
+ * This is the rotation rate for everything discovery ingested: index size /
340
+ * this = days to come all the way around. Raise it if the sync finishes well
341
+ * inside the cron window; lower it if npm starts rate-limiting. 0 disables
342
+ * the rotation (seeds only, the pre-rotation behaviour). */
343
+ LURQ_SYNC_REFRESH_CAP: z.ZodDefault<z.ZodNumber>;
218
344
  LOG_LEVEL: z.ZodDefault<z.ZodEnum<["error", "warn", "info", "debug"]>>;
219
345
  PORT: z.ZodDefault<z.ZodNumber>;
220
346
  /** Per-API-key rate limit: max requests per window. */
@@ -229,10 +355,15 @@ declare const EnvSchema: z.ZodObject<{
229
355
  * authenticated web app presents it to mint a key for a signed-in user. Unset
230
356
  * → the endpoint is disabled (404). Keep it server-side, never in the client. */
231
357
  LURQ_ISSUER_SECRET: z.ZodOptional<z.ZodString>;
358
+ /** Numeric App ID from the GitHub App settings page. */
359
+ LURQ_GITHUB_APP_ID: z.ZodOptional<z.ZodString>;
360
+ /** PEM private key. Accepts literal newlines or `\n` escapes (Railway/Vercel). */
361
+ LURQ_GITHUB_APP_PRIVATE_KEY: z.ZodOptional<z.ZodString>;
232
362
  LURQ_ENDPOINT: z.ZodOptional<z.ZodString>;
233
363
  LURQ_API_KEY: z.ZodOptional<z.ZodString>;
234
364
  E2B_API_KEY: z.ZodOptional<z.ZodString>;
235
365
  E2B_TEMPLATE: z.ZodOptional<z.ZodString>;
366
+ USE_LIVE_API: z.ZodOptional<z.ZodString>;
236
367
  }, "strip", z.ZodTypeAny, {
237
368
  EMBEDDING_PROVIDER: "openai" | "local";
238
369
  EMBEDDING_MODEL: string;
@@ -241,6 +372,7 @@ declare const EnvSchema: z.ZodObject<{
241
372
  SUMMARY_MODEL: string;
242
373
  SUMMARY_BASE_URL: string;
243
374
  LURQ_SYNC_CONCURRENCY: number;
375
+ LURQ_SYNC_REFRESH_CAP: number;
244
376
  LOG_LEVEL: "info" | "error" | "warn" | "debug";
245
377
  PORT: number;
246
378
  LURQ_RATE_LIMIT_MAX: number;
@@ -252,10 +384,13 @@ declare const EnvSchema: z.ZodObject<{
252
384
  SUMMARY_API_KEY?: string | undefined;
253
385
  LURQ_METRICS_TOKEN?: string | undefined;
254
386
  LURQ_ISSUER_SECRET?: string | undefined;
387
+ LURQ_GITHUB_APP_ID?: string | undefined;
388
+ LURQ_GITHUB_APP_PRIVATE_KEY?: string | undefined;
255
389
  LURQ_ENDPOINT?: string | undefined;
256
390
  LURQ_API_KEY?: string | undefined;
257
391
  E2B_API_KEY?: string | undefined;
258
392
  E2B_TEMPLATE?: string | undefined;
393
+ USE_LIVE_API?: string | undefined;
259
394
  }, {
260
395
  DATABASE_URL?: string | undefined;
261
396
  GITHUB_TOKEN?: string | undefined;
@@ -268,6 +403,7 @@ declare const EnvSchema: z.ZodObject<{
268
403
  SUMMARY_MODEL?: string | undefined;
269
404
  SUMMARY_BASE_URL?: string | undefined;
270
405
  LURQ_SYNC_CONCURRENCY?: number | undefined;
406
+ LURQ_SYNC_REFRESH_CAP?: number | undefined;
271
407
  LOG_LEVEL?: "info" | "error" | "warn" | "debug" | undefined;
272
408
  PORT?: number | undefined;
273
409
  LURQ_RATE_LIMIT_MAX?: number | undefined;
@@ -275,10 +411,13 @@ declare const EnvSchema: z.ZodObject<{
275
411
  LURQ_RATE_LIMIT_WINDOW_MS?: number | undefined;
276
412
  LURQ_METRICS_TOKEN?: string | undefined;
277
413
  LURQ_ISSUER_SECRET?: string | undefined;
414
+ LURQ_GITHUB_APP_ID?: string | undefined;
415
+ LURQ_GITHUB_APP_PRIVATE_KEY?: string | undefined;
278
416
  LURQ_ENDPOINT?: string | undefined;
279
417
  LURQ_API_KEY?: string | undefined;
280
418
  E2B_API_KEY?: string | undefined;
281
419
  E2B_TEMPLATE?: string | undefined;
420
+ USE_LIVE_API?: string | undefined;
282
421
  }>;
283
422
  type Config = z.infer<typeof EnvSchema>;
284
423
  declare class ConfigError extends Error {
@@ -309,4 +448,4 @@ declare const logger: {
309
448
 
310
449
  declare function buildProgram(): Command;
311
450
 
312
- export { API_KEY_PREFIX, type Advisory, type AdvisorySeverity, type BuildSignal, type BuildVerified, CACHE_TTL, CATEGORIES, type Candidate, type Category, type CategorySource, type CompatConflict, type CompatOutput, type CompatStatus, type Confidence, type Config, ConfigError, DEFAULT_ENDPOINT, type DependencyRanges, type DiscoverySource, type DiscoveryStatus, EMBEDDING_DIM, type EvaluateOutput, FRONTEND_CATEGORIES, PACKAGE_NAME, type PeerMeta, type RiskLevel, type Runtime, SERVER_NAME, STALENESS_DAYS, type ScoreBreakdown, type UsageGuide, VERSION, type VerifyOutput, buildProgram, getConfig, isCategory, isFrontendCategory, loadEnv, logger, requireConfig };
451
+ export { API_KEY_PREFIX, type Advisory, type AdvisorySeverity, type BuildSignal, type BuildVerified, CACHE_TTL, CATEGORIES, type Candidate, type Category, type CategorySource, type CompatConflict, type CompatEvidence, type CompatOutput, type CompatPair, type CompatProvenance, type CompatStatus, type Confidence, type Config, ConfigError, DEFAULT_ENDPOINT, type DependencyRanges, type DiscoverySource, type DiscoveryStatus, EMBEDDING_DIM, type EvaluateOutput, type ExportKind, type ExportSymbol, FRONTEND_CATEGORIES, PACKAGE_NAME, PROVENANCE_RANK, type PeerMeta, type RiskLevel, type Runtime, SERVER_NAME, STALENESS_DAYS, type ScoreBreakdown, type SurfaceDelta, type UsageGuide, type UsageOutput, VERSION, type VerifyOutput, buildProgram, getConfig, isCategory, isFrontendCategory, loadEnv, logger, requireConfig };