lurqrun 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +105 -0
- package/dist/bin/lurq.js +2848 -0
- package/dist/bin/lurq.js.map +1 -0
- package/dist/index.d.ts +185 -0
- package/dist/index.js +2860 -0
- package/dist/index.js.map +1 -0
- package/drizzle/0000_confused_fabian_cortez.sql +54 -0
- package/drizzle/meta/0000_snapshot.json +370 -0
- package/drizzle/meta/_journal.json +13 -0
- package/package.json +76 -0
- package/src/data/seed.json +253 -0
- package/templates/skill-instructions.md +32 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Command } from 'commander';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Shared domain types and the v1 category taxonomy (§8.3).
|
|
6
|
+
* These are the stable contracts the rest of the system builds on.
|
|
7
|
+
*/
|
|
8
|
+
/** Category taxonomy for the JS/TS web stack (§8.3). `other` is the fallback. */
|
|
9
|
+
declare const CATEGORIES: readonly ["framework", "meta-framework", "state-management", "routing", "orm", "database-client", "ui-component-library", "styling", "forms", "validation", "data-fetching", "http-client", "auth", "testing", "build-tool", "bundler", "linting", "date-time", "animation", "charts", "i18n", "utility", "other"];
|
|
10
|
+
type Category = (typeof CATEGORIES)[number];
|
|
11
|
+
declare function isCategory(value: string): value is Category;
|
|
12
|
+
/**
|
|
13
|
+
* Categories for which bundle size is meaningful and Bundlephobia is consulted
|
|
14
|
+
* (§9.5). Backend-only categories get a null bundle size, and their efficiency
|
|
15
|
+
* weight is redistributed (§10, see scoring).
|
|
16
|
+
*/
|
|
17
|
+
declare const FRONTEND_CATEGORIES: readonly ["ui-component-library", "styling", "state-management", "forms", "validation", "data-fetching", "charts", "animation", "date-time", "utility"];
|
|
18
|
+
declare function isFrontendCategory(category: Category | null | undefined): boolean;
|
|
19
|
+
/** Evidence-trustworthiness label, independent of the numeric score (§10). */
|
|
20
|
+
type Confidence = 'proven' | 'emerging' | 'unproven';
|
|
21
|
+
type Runtime = 'browser' | 'node' | 'both';
|
|
22
|
+
type AdvisorySeverity = 'critical' | 'high' | 'moderate' | 'low' | 'info';
|
|
23
|
+
interface Advisory {
|
|
24
|
+
id: string;
|
|
25
|
+
severity: AdvisorySeverity;
|
|
26
|
+
summary: string;
|
|
27
|
+
}
|
|
28
|
+
/** Sub-scores composing the health score (§10). `efficiency` is null when not
|
|
29
|
+
* size-based (backend categories) — its weight is redistributed. */
|
|
30
|
+
interface ScoreBreakdown {
|
|
31
|
+
maintenance: number;
|
|
32
|
+
adoption: number;
|
|
33
|
+
reliability: number;
|
|
34
|
+
efficiency: number | null;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Structured usage guide generated at ingest (product refinement: lurq explains,
|
|
38
|
+
* not just ranks). Grounded in the package README/description — never fabricated.
|
|
39
|
+
* Exact current API specifics are deferred to Context7 via `context7Hint`.
|
|
40
|
+
*/
|
|
41
|
+
interface UsageGuide {
|
|
42
|
+
whatItIs: string;
|
|
43
|
+
whenToUse: string;
|
|
44
|
+
whenNotToUse?: string;
|
|
45
|
+
whereItFits: string;
|
|
46
|
+
howToWireIn?: string;
|
|
47
|
+
context7Hint?: string;
|
|
48
|
+
}
|
|
49
|
+
/** A single recommendation candidate (§12.3.1). Intentionally compact. */
|
|
50
|
+
interface Candidate {
|
|
51
|
+
name: string;
|
|
52
|
+
category: Category | null;
|
|
53
|
+
healthScore: number;
|
|
54
|
+
confidence: Confidence;
|
|
55
|
+
why: string;
|
|
56
|
+
latestVersion: string | null;
|
|
57
|
+
weeklyDownloads: number | null;
|
|
58
|
+
lastReleaseAt: string | null;
|
|
59
|
+
repoUrl: string | null;
|
|
60
|
+
}
|
|
61
|
+
/** Full evidence read for one package (§12.3.2). */
|
|
62
|
+
interface EvaluateOutput {
|
|
63
|
+
dataAsOf: string;
|
|
64
|
+
stale?: boolean;
|
|
65
|
+
name: string;
|
|
66
|
+
category: Category | null;
|
|
67
|
+
healthScore: number;
|
|
68
|
+
confidence: Confidence;
|
|
69
|
+
scoreBreakdown: ScoreBreakdown;
|
|
70
|
+
latestVersion: string | null;
|
|
71
|
+
lastReleaseAt: string | null;
|
|
72
|
+
weeklyDownloads: number | null;
|
|
73
|
+
downloadGrowth90d: number | null;
|
|
74
|
+
dependentsCount: number | null;
|
|
75
|
+
scorecard: number | null;
|
|
76
|
+
bundleMinGzipKb: number | null;
|
|
77
|
+
deprecated: boolean;
|
|
78
|
+
archived: boolean;
|
|
79
|
+
advisories: Advisory[];
|
|
80
|
+
summary: string | null;
|
|
81
|
+
usageGuide: UsageGuide | null;
|
|
82
|
+
repoUrl: string | null;
|
|
83
|
+
}
|
|
84
|
+
/** `verify` output (§12.3.4). */
|
|
85
|
+
interface VerifyOutput {
|
|
86
|
+
exists: boolean;
|
|
87
|
+
tracked: boolean;
|
|
88
|
+
deprecated: boolean;
|
|
89
|
+
archived: boolean;
|
|
90
|
+
latestVersion: string | null;
|
|
91
|
+
weeklyDownloads: number | null;
|
|
92
|
+
riskFlags: string[];
|
|
93
|
+
confidence: Confidence | null;
|
|
94
|
+
advisoryCount: number;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** Static identifiers shared across the CLI and MCP server. */
|
|
98
|
+
declare const SERVER_NAME = "lurq";
|
|
99
|
+
/** Published npm package name (the CLI command and MCP nickname stay `lurq`).
|
|
100
|
+
* Keep in sync with package.json "name". */
|
|
101
|
+
declare const PACKAGE_NAME = "lurqrun";
|
|
102
|
+
/** Keep in sync with package.json "version". */
|
|
103
|
+
declare const VERSION = "0.0.1";
|
|
104
|
+
/** Embedding vector dimensionality (OpenAI text-embedding-3-small). The local
|
|
105
|
+
* fallback embedder produces vectors of the same length so the DB column and
|
|
106
|
+
* pgvector index never need to change. */
|
|
107
|
+
declare const EMBEDDING_DIM = 1536;
|
|
108
|
+
/** A package row is flagged `stale: true` in tool responses once its data is
|
|
109
|
+
* older than this (§17). */
|
|
110
|
+
declare const STALENESS_DAYS = 7;
|
|
111
|
+
/** Per-source persistent-cache TTLs (§17). */
|
|
112
|
+
declare const CACHE_TTL: {
|
|
113
|
+
readonly npmRegistry: number;
|
|
114
|
+
readonly npmDownloads: number;
|
|
115
|
+
readonly github: number;
|
|
116
|
+
readonly depsDev: number;
|
|
117
|
+
readonly bundlephobia: number;
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
/** Load `.env` into process.env exactly once. Safe to call repeatedly. */
|
|
121
|
+
declare function loadEnv(): void;
|
|
122
|
+
declare const EnvSchema: z.ZodObject<{
|
|
123
|
+
DATABASE_URL: z.ZodOptional<z.ZodString>;
|
|
124
|
+
GITHUB_TOKEN: z.ZodOptional<z.ZodString>;
|
|
125
|
+
EMBEDDING_PROVIDER: z.ZodDefault<z.ZodEnum<["openai", "local"]>>;
|
|
126
|
+
EMBEDDING_API_KEY: z.ZodOptional<z.ZodString>;
|
|
127
|
+
EMBEDDING_MODEL: z.ZodDefault<z.ZodString>;
|
|
128
|
+
SUMMARY_PROVIDER: z.ZodDefault<z.ZodEnum<["openai", "none"]>>;
|
|
129
|
+
SUMMARY_API_KEY: z.ZodOptional<z.ZodString>;
|
|
130
|
+
SUMMARY_MODEL: z.ZodDefault<z.ZodString>;
|
|
131
|
+
LURQ_SYNC_CONCURRENCY: z.ZodDefault<z.ZodNumber>;
|
|
132
|
+
LOG_LEVEL: z.ZodDefault<z.ZodEnum<["error", "warn", "info", "debug"]>>;
|
|
133
|
+
}, "strip", z.ZodTypeAny, {
|
|
134
|
+
EMBEDDING_PROVIDER: "openai" | "local";
|
|
135
|
+
EMBEDDING_MODEL: string;
|
|
136
|
+
SUMMARY_PROVIDER: "openai" | "none";
|
|
137
|
+
SUMMARY_MODEL: string;
|
|
138
|
+
LURQ_SYNC_CONCURRENCY: number;
|
|
139
|
+
LOG_LEVEL: "info" | "error" | "warn" | "debug";
|
|
140
|
+
DATABASE_URL?: string | undefined;
|
|
141
|
+
GITHUB_TOKEN?: string | undefined;
|
|
142
|
+
EMBEDDING_API_KEY?: string | undefined;
|
|
143
|
+
SUMMARY_API_KEY?: string | undefined;
|
|
144
|
+
}, {
|
|
145
|
+
DATABASE_URL?: string | undefined;
|
|
146
|
+
GITHUB_TOKEN?: string | undefined;
|
|
147
|
+
EMBEDDING_PROVIDER?: "openai" | "local" | undefined;
|
|
148
|
+
EMBEDDING_API_KEY?: string | undefined;
|
|
149
|
+
EMBEDDING_MODEL?: string | undefined;
|
|
150
|
+
SUMMARY_PROVIDER?: "openai" | "none" | undefined;
|
|
151
|
+
SUMMARY_API_KEY?: string | undefined;
|
|
152
|
+
SUMMARY_MODEL?: string | undefined;
|
|
153
|
+
LURQ_SYNC_CONCURRENCY?: number | undefined;
|
|
154
|
+
LOG_LEVEL?: "info" | "error" | "warn" | "debug" | undefined;
|
|
155
|
+
}>;
|
|
156
|
+
type Config = z.infer<typeof EnvSchema>;
|
|
157
|
+
declare class ConfigError extends Error {
|
|
158
|
+
constructor(message: string);
|
|
159
|
+
}
|
|
160
|
+
/** Parse + validate the environment. Throws ConfigError on malformed values. */
|
|
161
|
+
declare function getConfig(): Config;
|
|
162
|
+
/**
|
|
163
|
+
* Return the config but fail fast if any of the named required keys are absent.
|
|
164
|
+
* Use in command handlers that genuinely need them (e.g. sync needs DATABASE_URL).
|
|
165
|
+
*/
|
|
166
|
+
declare function requireConfig<K extends keyof Config>(keys: K[]): Config;
|
|
167
|
+
|
|
168
|
+
declare const logger: {
|
|
169
|
+
error: (...args: unknown[]) => void;
|
|
170
|
+
warn: (...args: unknown[]) => void;
|
|
171
|
+
info: (...args: unknown[]) => void;
|
|
172
|
+
debug: (...args: unknown[]) => void;
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* CLI command wiring (§13). Built with commander. Each command mirrors an MCP
|
|
177
|
+
* tool or an operational task. Handlers are filled in across milestones M1–M7;
|
|
178
|
+
* the command/option surface here is the final, stable shape.
|
|
179
|
+
*
|
|
180
|
+
* Every command supports `--json` for machine-readable output.
|
|
181
|
+
*/
|
|
182
|
+
|
|
183
|
+
declare function buildProgram(): Command;
|
|
184
|
+
|
|
185
|
+
export { type Advisory, type AdvisorySeverity, CACHE_TTL, CATEGORIES, type Candidate, type Category, type Confidence, type Config, ConfigError, EMBEDDING_DIM, type EvaluateOutput, FRONTEND_CATEGORIES, PACKAGE_NAME, type Runtime, SERVER_NAME, STALENESS_DAYS, type ScoreBreakdown, type UsageGuide, VERSION, type VerifyOutput, buildProgram, getConfig, isCategory, isFrontendCategory, loadEnv, logger, requireConfig };
|