prelude-context 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -0
- package/dist/bin/prelude.js +2 -0
- package/dist/bin/prelude.js.map +1 -1
- package/dist/src/commands/query.d.ts +3 -0
- package/dist/src/commands/query.d.ts.map +1 -0
- package/dist/src/commands/query.js +59 -0
- package/dist/src/commands/query.js.map +1 -0
- package/dist/src/core/query-engine.d.ts +18 -0
- package/dist/src/core/query-engine.d.ts.map +1 -0
- package/dist/src/core/query-engine.js +364 -0
- package/dist/src/core/query-engine.js.map +1 -0
- package/package.json +11 -10
package/README.md
CHANGED
|
@@ -143,6 +143,26 @@ prelude decision "Use Drizzle ORM instead of Prisma"
|
|
|
143
143
|
# Opens editor for you to document the decision and rationale
|
|
144
144
|
```
|
|
145
145
|
|
|
146
|
+
### `prelude query <topic> [options]`
|
|
147
|
+
Scoped context lookup — search and filter your project context without exporting everything:
|
|
148
|
+
```bash
|
|
149
|
+
prelude query "error handling" # topic search across everything
|
|
150
|
+
prelude query --scope src/api/ # architecture + constraints for a directory
|
|
151
|
+
prelude query --type constraints # just constraints
|
|
152
|
+
prelude query "prisma" --type decisions --format json # combined filters
|
|
153
|
+
prelude query --type stack --max-tokens 500 # budget-capped output
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
| Flag | Description |
|
|
157
|
+
|------|-------------|
|
|
158
|
+
| `<topic>` | Deep-search keyword across all context files |
|
|
159
|
+
| `--scope <path>` | Filter to architecture/constraints relevant to a directory |
|
|
160
|
+
| `--type <type>` | Return only one context type: `project`, `stack`, `architecture`, `constraints`, or `decisions` |
|
|
161
|
+
| `--format <md\|json>` | Output format (default: `md`) |
|
|
162
|
+
| `--max-tokens <n>` | Truncate output to fit a token budget |
|
|
163
|
+
|
|
164
|
+
Output goes to stdout (pipe-friendly), token estimate to stderr. At least one filter (topic, scope, or type) is required.
|
|
165
|
+
|
|
146
166
|
### `prelude watch`
|
|
147
167
|
Tracks development sessions:
|
|
148
168
|
```bash
|
|
@@ -188,6 +208,15 @@ Should I use Server Actions or API routes for [feature]?
|
|
|
188
208
|
Consider our existing patterns and constraints.
|
|
189
209
|
```
|
|
190
210
|
|
|
211
|
+
### 🔍 Scoped Context for AI Agents
|
|
212
|
+
```bash
|
|
213
|
+
# Feed only relevant context to an AI agent working on a specific directory
|
|
214
|
+
prelude query --scope src/api/ --format json | my-agent
|
|
215
|
+
|
|
216
|
+
# Quick lookup before asking an LLM about a topic
|
|
217
|
+
prelude query "authentication" --max-tokens 500
|
|
218
|
+
```
|
|
219
|
+
|
|
191
220
|
### 📚 Onboarding
|
|
192
221
|
Share your `.context/` directory with new team members so they can:
|
|
193
222
|
- Understand the stack instantly
|
|
@@ -333,6 +362,7 @@ Yes! While the CLI is built with Node.js, the Prelude format works with any lang
|
|
|
333
362
|
## Roadmap
|
|
334
363
|
|
|
335
364
|
- [x] Smart context updates with manual edit preservation
|
|
365
|
+
- [x] Scoped context query engine (`prelude query`)
|
|
336
366
|
- [ ] Improved inference for Python, Rust, Go
|
|
337
367
|
- [ ] VS Code extension for inline context
|
|
338
368
|
- [ ] GitHub Action for automated updates
|
package/dist/bin/prelude.js
CHANGED
|
@@ -24,6 +24,7 @@ import { registerExportCommand } from '../src/commands/export.js';
|
|
|
24
24
|
import { registerShareCommand } from '../src/commands/share.js';
|
|
25
25
|
import { registerDecisionCommand } from '../src/commands/decision.js';
|
|
26
26
|
import { registerWatchCommand } from '../src/commands/watch.js';
|
|
27
|
+
import { registerQueryCommand } from '../src/commands/query.js';
|
|
27
28
|
import { update } from '../src/commands/update.js';
|
|
28
29
|
// Register all commands
|
|
29
30
|
registerInitCommand(cli);
|
|
@@ -31,6 +32,7 @@ registerExportCommand(cli);
|
|
|
31
32
|
registerShareCommand(cli);
|
|
32
33
|
registerDecisionCommand(cli);
|
|
33
34
|
registerWatchCommand(cli);
|
|
35
|
+
registerQueryCommand(cli);
|
|
34
36
|
// Register update command
|
|
35
37
|
cli
|
|
36
38
|
.command('update', 'Update context by re-analyzing the codebase')
|
package/dist/bin/prelude.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prelude.js","sourceRoot":"","sources":["../../bin/prelude.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,0DAA0D;AAC1D,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,+DAA+D;AAC/D,IAAI,WAAgB,CAAC;AACrB,IAAI,CAAC;IACH,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;AACzF,CAAC;AAAC,MAAM,CAAC;IACP,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,iBAAiB,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;AACtF,CAAC;AAED,MAAM,GAAG,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC;AAE3B,GAAG;KACA,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC;KAC5B,IAAI,EAAE,CAAC;AAEV,kBAAkB;AAClB,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6B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;KACpC,MAAM,CAAC,MAAM,CAAC,CAAC;AAElB,gBAAgB;AAChB,GAAG,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/commands/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAQ/B,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,GAAG,QAoE5C"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { join } from 'path';
|
|
2
|
+
import { fileExists } from '../utils/fs.js';
|
|
3
|
+
import { logger } from '../utils/log.js';
|
|
4
|
+
import { CONTEXT_DIR } from '../constants.js';
|
|
5
|
+
import { executeQuery, VALID_TYPES } from '../core/query-engine.js';
|
|
6
|
+
export function registerQueryCommand(cli) {
|
|
7
|
+
cli
|
|
8
|
+
.command('query [topic]', 'Query project context by topic, scope, or type')
|
|
9
|
+
.option('--scope <path>', 'Filter results to a specific directory scope')
|
|
10
|
+
.option('--type <type>', 'Filter by context type (project, stack, architecture, constraints, decisions)')
|
|
11
|
+
.option('--format <format>', 'Output format (md or json)', { default: 'md' })
|
|
12
|
+
.option('--max-tokens <n>', 'Limit output to approximate token budget')
|
|
13
|
+
.action(async (topic, options) => {
|
|
14
|
+
const rootDir = process.cwd();
|
|
15
|
+
const externalRoot = process.env.PRELUDE_ROOT;
|
|
16
|
+
const contextDir = externalRoot
|
|
17
|
+
? join(externalRoot, rootDir.split('/').pop())
|
|
18
|
+
: join(rootDir, CONTEXT_DIR);
|
|
19
|
+
if (!(await fileExists(contextDir))) {
|
|
20
|
+
logger.error('.context/ directory not found. Run `prelude init` first.');
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
// Validate --type
|
|
24
|
+
if (options.type && !VALID_TYPES.includes(options.type)) {
|
|
25
|
+
logger.error(`Invalid type: "${options.type}". Valid types: ${VALID_TYPES.join(', ')}`);
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
|
28
|
+
// Must provide at least one filter
|
|
29
|
+
if (!topic && !options.scope && !options.type) {
|
|
30
|
+
logger.error('Provide a topic, --scope, or --type to query. Run `prelude query --help` for usage.');
|
|
31
|
+
process.exit(1);
|
|
32
|
+
}
|
|
33
|
+
const format = options.format === 'json' ? 'json' : 'md';
|
|
34
|
+
const maxTokens = options.maxTokens ? parseInt(options.maxTokens, 10) : undefined;
|
|
35
|
+
if (maxTokens !== undefined && (isNaN(maxTokens) || maxTokens <= 0)) {
|
|
36
|
+
logger.error('--max-tokens must be a positive number.');
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
try {
|
|
40
|
+
const { output, tokenEstimate } = await executeQuery(rootDir, {
|
|
41
|
+
topic,
|
|
42
|
+
scope: options.scope,
|
|
43
|
+
type: options.type,
|
|
44
|
+
format,
|
|
45
|
+
maxTokens,
|
|
46
|
+
});
|
|
47
|
+
// Print results to stdout (machine-friendly, no decoration)
|
|
48
|
+
console.log(output);
|
|
49
|
+
// Print token estimate to stderr so it doesn't pollute piped output
|
|
50
|
+
const budgetNote = maxTokens ? ` (budget: ${maxTokens})` : '';
|
|
51
|
+
process.stderr.write(`\n~${tokenEstimate} tokens${budgetNote}\n`);
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
logger.error(`Query failed: ${error}`);
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../../src/commands/query.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,WA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AAK,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,CAAC,iBAAiB,KAAK,EAAE,CAAC,CAAC;YACvC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type ContextType = 'project' | 'stack' | 'architecture' | 'constraints' | 'decisions';
|
|
2
|
+
export declare const VALID_TYPES: ContextType[];
|
|
3
|
+
export interface QueryOptions {
|
|
4
|
+
topic?: string;
|
|
5
|
+
scope?: string;
|
|
6
|
+
type?: ContextType;
|
|
7
|
+
format: 'md' | 'json';
|
|
8
|
+
maxTokens?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface QueryResult {
|
|
11
|
+
sections: Record<string, unknown>;
|
|
12
|
+
tokenEstimate: number;
|
|
13
|
+
}
|
|
14
|
+
export declare function executeQuery(rootDir: string, options: QueryOptions): Promise<{
|
|
15
|
+
output: string;
|
|
16
|
+
tokenEstimate: number;
|
|
17
|
+
}>;
|
|
18
|
+
//# sourceMappingURL=query-engine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-engine.d.ts","sourceRoot":"","sources":["../../../src/core/query-engine.ts"],"names":[],"mappings":"AAgBA,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,cAAc,GAAG,aAAa,GAAG,WAAW,CAAC;AAE7F,eAAO,MAAM,WAAW,EAAE,WAAW,EAAqE,CAAC;AAU3G,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,MAAM,EAAE,IAAI,GAAG,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,aAAa,EAAE,MAAM,CAAC;CACvB;AA2SD,wBAAsB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAAC,CA4D7H"}
|
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
import { join } from 'path';
|
|
2
|
+
import { readJSON, fileExists } from '../utils/fs.js';
|
|
3
|
+
import { CONTEXT_DIR, CONTEXT_FILES } from '../constants.js';
|
|
4
|
+
// Roughly estimate tokens (1 token ≈ 4 characters for English text)
|
|
5
|
+
function estimateTokens(text) {
|
|
6
|
+
return Math.ceil(text.length / 4);
|
|
7
|
+
}
|
|
8
|
+
function truncateToTokenBudget(text, maxTokens) {
|
|
9
|
+
const maxChars = maxTokens * 4;
|
|
10
|
+
if (text.length <= maxChars)
|
|
11
|
+
return text;
|
|
12
|
+
return text.slice(0, maxChars) + '\n\n[... truncated to fit token budget]';
|
|
13
|
+
}
|
|
14
|
+
export const VALID_TYPES = ['project', 'stack', 'architecture', 'constraints', 'decisions'];
|
|
15
|
+
// Load all context data from .context/ directory
|
|
16
|
+
async function loadContext(rootDir) {
|
|
17
|
+
const externalRoot = process.env.PRELUDE_ROOT;
|
|
18
|
+
const contextDir = externalRoot
|
|
19
|
+
? join(externalRoot, rootDir.split('/').pop())
|
|
20
|
+
: join(rootDir, CONTEXT_DIR);
|
|
21
|
+
const data = {};
|
|
22
|
+
const loaders = [
|
|
23
|
+
{ key: 'project', file: CONTEXT_FILES.PROJECT },
|
|
24
|
+
{ key: 'stack', file: CONTEXT_FILES.STACK },
|
|
25
|
+
{ key: 'architecture', file: CONTEXT_FILES.ARCHITECTURE },
|
|
26
|
+
{ key: 'constraints', file: CONTEXT_FILES.CONSTRAINTS },
|
|
27
|
+
{ key: 'decisions', file: CONTEXT_FILES.DECISIONS },
|
|
28
|
+
];
|
|
29
|
+
for (const { key, file } of loaders) {
|
|
30
|
+
const filePath = join(contextDir, file);
|
|
31
|
+
if (await fileExists(filePath)) {
|
|
32
|
+
data[key] = await readJSON(filePath);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return data;
|
|
36
|
+
}
|
|
37
|
+
// Deep-search an object for a keyword match (case-insensitive)
|
|
38
|
+
function objectContainsTopic(obj, topic) {
|
|
39
|
+
if (obj === null || obj === undefined)
|
|
40
|
+
return false;
|
|
41
|
+
if (typeof obj === 'string') {
|
|
42
|
+
return obj.toLowerCase().includes(topic);
|
|
43
|
+
}
|
|
44
|
+
if (typeof obj === 'number' || typeof obj === 'boolean') {
|
|
45
|
+
return String(obj).toLowerCase().includes(topic);
|
|
46
|
+
}
|
|
47
|
+
if (Array.isArray(obj)) {
|
|
48
|
+
return obj.some(item => objectContainsTopic(item, topic));
|
|
49
|
+
}
|
|
50
|
+
if (typeof obj === 'object') {
|
|
51
|
+
return Object.values(obj).some(val => objectContainsTopic(val, topic));
|
|
52
|
+
}
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
// Extract matching sub-fields from an object for a given topic
|
|
56
|
+
function extractMatchingFields(obj, topic) {
|
|
57
|
+
const matches = {};
|
|
58
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
59
|
+
if (key === '$schema' || key === 'version')
|
|
60
|
+
continue;
|
|
61
|
+
if (key.toLowerCase().includes(topic) || objectContainsTopic(value, topic)) {
|
|
62
|
+
matches[key] = value;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return matches;
|
|
66
|
+
}
|
|
67
|
+
// Filter architecture directories by scope path
|
|
68
|
+
function filterArchitectureByScope(arch, scope) {
|
|
69
|
+
const normalizedScope = scope.replace(/\/+$/, '').replace(/^\.\//, '');
|
|
70
|
+
const filteredDirs = (arch.directories || []).filter(dir => {
|
|
71
|
+
const normalizedDir = dir.path.replace(/\/+$/, '').replace(/^\.\//, '');
|
|
72
|
+
return normalizedDir.startsWith(normalizedScope) ||
|
|
73
|
+
normalizedScope.startsWith(normalizedDir);
|
|
74
|
+
});
|
|
75
|
+
// Find patterns/conventions relevant to the scoped directories
|
|
76
|
+
const scopeSegments = normalizedScope.toLowerCase().split('/');
|
|
77
|
+
const filteredPatterns = (arch.patterns || []).filter(p => {
|
|
78
|
+
const lower = p.toLowerCase();
|
|
79
|
+
return scopeSegments.some(seg => lower.includes(seg));
|
|
80
|
+
});
|
|
81
|
+
const filteredConventions = (arch.conventions || []).filter(c => {
|
|
82
|
+
const lower = c.toLowerCase();
|
|
83
|
+
return scopeSegments.some(seg => lower.includes(seg));
|
|
84
|
+
});
|
|
85
|
+
const filteredEntryPoints = (arch.entryPoints || []).filter(ep => ep.file.replace(/^\.\//, '').startsWith(normalizedScope));
|
|
86
|
+
return {
|
|
87
|
+
...arch,
|
|
88
|
+
directories: filteredDirs,
|
|
89
|
+
patterns: filteredPatterns.length > 0 ? filteredPatterns : arch.patterns,
|
|
90
|
+
conventions: filteredConventions.length > 0 ? filteredConventions : arch.conventions,
|
|
91
|
+
entryPoints: filteredEntryPoints.length > 0 ? filteredEntryPoints : undefined,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
// Filter constraints relevant to a scope (keeps all constraints since they apply globally,
|
|
95
|
+
// but highlights relevant directory organization rules)
|
|
96
|
+
function filterConstraintsByScope(constraints, scope) {
|
|
97
|
+
const normalizedScope = scope.replace(/\/+$/, '').replace(/^\.\//, '').toLowerCase();
|
|
98
|
+
const scopeSegments = normalizedScope.split('/');
|
|
99
|
+
const filteredFileOrg = (constraints.fileOrganization || []).filter(rule => {
|
|
100
|
+
const lower = rule.toLowerCase();
|
|
101
|
+
return scopeSegments.some(seg => lower.includes(seg));
|
|
102
|
+
});
|
|
103
|
+
return {
|
|
104
|
+
...constraints,
|
|
105
|
+
fileOrganization: filteredFileOrg.length > 0 ? filteredFileOrg : constraints.fileOrganization,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
// Format query results as markdown
|
|
109
|
+
function formatAsMarkdown(sections) {
|
|
110
|
+
let md = '# Prelude Query Results\n\n';
|
|
111
|
+
if (sections.project) {
|
|
112
|
+
md += formatProjectSection(sections.project);
|
|
113
|
+
}
|
|
114
|
+
if (sections.stack) {
|
|
115
|
+
md += formatStackSection(sections.stack);
|
|
116
|
+
}
|
|
117
|
+
if (sections.architecture) {
|
|
118
|
+
md += formatArchitectureSection(sections.architecture);
|
|
119
|
+
}
|
|
120
|
+
if (sections.constraints) {
|
|
121
|
+
md += formatConstraintsSection(sections.constraints);
|
|
122
|
+
}
|
|
123
|
+
if (sections.decisions) {
|
|
124
|
+
md += formatDecisionsSection(sections.decisions);
|
|
125
|
+
}
|
|
126
|
+
if (md === '# Prelude Query Results\n\n') {
|
|
127
|
+
md += '_No matching context found._\n';
|
|
128
|
+
}
|
|
129
|
+
return md;
|
|
130
|
+
}
|
|
131
|
+
function formatProjectSection(project) {
|
|
132
|
+
let md = '## Project\n\n';
|
|
133
|
+
if (project.name)
|
|
134
|
+
md += `**Name:** ${project.name}\n`;
|
|
135
|
+
if (project.description)
|
|
136
|
+
md += `**Description:** ${project.description}\n`;
|
|
137
|
+
if (project.version)
|
|
138
|
+
md += `**Version:** ${project.version}\n`;
|
|
139
|
+
if (project.repository)
|
|
140
|
+
md += `**Repository:** ${project.repository}\n`;
|
|
141
|
+
if (project.license)
|
|
142
|
+
md += `**License:** ${project.license}\n`;
|
|
143
|
+
if (project.goals && project.goals.length > 0) {
|
|
144
|
+
md += '**Goals:**\n';
|
|
145
|
+
project.goals.forEach(g => { md += `- ${g}\n`; });
|
|
146
|
+
}
|
|
147
|
+
md += '\n';
|
|
148
|
+
return md;
|
|
149
|
+
}
|
|
150
|
+
function formatStackSection(stack) {
|
|
151
|
+
let md = '## Stack\n\n';
|
|
152
|
+
if (stack.language)
|
|
153
|
+
md += `**Language:** ${stack.language}\n`;
|
|
154
|
+
if (stack.runtime)
|
|
155
|
+
md += `**Runtime:** ${stack.runtime}\n`;
|
|
156
|
+
if (stack.packageManager)
|
|
157
|
+
md += `**Package Manager:** ${stack.packageManager}\n`;
|
|
158
|
+
if (stack.frameworks?.length) {
|
|
159
|
+
md += '**Frameworks:** ' + stack.frameworks.join(', ') + '\n';
|
|
160
|
+
}
|
|
161
|
+
if (stack.testingFrameworks?.length) {
|
|
162
|
+
md += '**Testing:** ' + stack.testingFrameworks.join(', ') + '\n';
|
|
163
|
+
}
|
|
164
|
+
if (stack.database)
|
|
165
|
+
md += `**Database:** ${stack.database}\n`;
|
|
166
|
+
if (stack.orm)
|
|
167
|
+
md += `**ORM:** ${stack.orm}\n`;
|
|
168
|
+
md += '\n';
|
|
169
|
+
return md;
|
|
170
|
+
}
|
|
171
|
+
function formatArchitectureSection(arch) {
|
|
172
|
+
let md = '## Architecture\n\n';
|
|
173
|
+
if (arch.type)
|
|
174
|
+
md += `**Type:** ${arch.type}\n`;
|
|
175
|
+
if (arch.routing)
|
|
176
|
+
md += `**Routing:** ${arch.routing}\n`;
|
|
177
|
+
if (arch.apiStyle)
|
|
178
|
+
md += `**API Style:** ${arch.apiStyle}\n`;
|
|
179
|
+
if (arch.patterns?.length) {
|
|
180
|
+
md += '**Patterns:**\n';
|
|
181
|
+
arch.patterns.forEach(p => { md += `- ${p}\n`; });
|
|
182
|
+
}
|
|
183
|
+
if (arch.conventions?.length) {
|
|
184
|
+
md += '**Conventions:**\n';
|
|
185
|
+
arch.conventions.forEach(c => { md += `- ${c}\n`; });
|
|
186
|
+
}
|
|
187
|
+
if (arch.directories?.length) {
|
|
188
|
+
md += '**Directories:**\n';
|
|
189
|
+
arch.directories.forEach(d => {
|
|
190
|
+
md += `- \`${d.path}\``;
|
|
191
|
+
if (d.purpose)
|
|
192
|
+
md += ` - ${d.purpose}`;
|
|
193
|
+
md += '\n';
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
if (arch.entryPoints?.length) {
|
|
197
|
+
md += '**Entry Points:**\n';
|
|
198
|
+
arch.entryPoints.forEach(ep => {
|
|
199
|
+
md += `- \`${ep.file}\` - ${ep.purpose}\n`;
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
md += '\n';
|
|
203
|
+
return md;
|
|
204
|
+
}
|
|
205
|
+
function formatConstraintsSection(constraints) {
|
|
206
|
+
let md = '## Constraints\n\n';
|
|
207
|
+
if (constraints.mustUse?.length) {
|
|
208
|
+
md += '**Must Use:**\n';
|
|
209
|
+
constraints.mustUse.forEach(item => { md += `- ${item}\n`; });
|
|
210
|
+
}
|
|
211
|
+
if (constraints.mustNotUse?.length) {
|
|
212
|
+
md += '**Must Not Use:**\n';
|
|
213
|
+
constraints.mustNotUse.forEach(item => { md += `- ${item}\n`; });
|
|
214
|
+
}
|
|
215
|
+
if (constraints.preferences?.length) {
|
|
216
|
+
md += '**Preferences:**\n';
|
|
217
|
+
constraints.preferences.forEach(p => {
|
|
218
|
+
md += `- [${p.category}] ${p.preference}`;
|
|
219
|
+
if (p.rationale)
|
|
220
|
+
md += ` _(${p.rationale})_`;
|
|
221
|
+
md += '\n';
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
if (constraints.codeStyle) {
|
|
225
|
+
md += '**Code Style:**\n';
|
|
226
|
+
if (constraints.codeStyle.formatter)
|
|
227
|
+
md += `- Formatter: ${constraints.codeStyle.formatter}\n`;
|
|
228
|
+
if (constraints.codeStyle.linter)
|
|
229
|
+
md += `- Linter: ${constraints.codeStyle.linter}\n`;
|
|
230
|
+
if (constraints.codeStyle.rules?.length) {
|
|
231
|
+
constraints.codeStyle.rules.forEach(r => { md += `- ${r}\n`; });
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
if (constraints.naming) {
|
|
235
|
+
md += '**Naming:**\n';
|
|
236
|
+
const naming = constraints.naming;
|
|
237
|
+
if (naming.files)
|
|
238
|
+
md += `- Files: ${naming.files}\n`;
|
|
239
|
+
if (naming.components)
|
|
240
|
+
md += `- Components: ${naming.components}\n`;
|
|
241
|
+
if (naming.functions)
|
|
242
|
+
md += `- Functions: ${naming.functions}\n`;
|
|
243
|
+
if (naming.variables)
|
|
244
|
+
md += `- Variables: ${naming.variables}\n`;
|
|
245
|
+
}
|
|
246
|
+
if (constraints.testing) {
|
|
247
|
+
md += '**Testing:**\n';
|
|
248
|
+
md += `- Required: ${constraints.testing.required ? 'Yes' : 'No'}\n`;
|
|
249
|
+
if (constraints.testing.strategy)
|
|
250
|
+
md += `- Strategy: ${constraints.testing.strategy}\n`;
|
|
251
|
+
if (constraints.testing.coverage)
|
|
252
|
+
md += `- Coverage: ${constraints.testing.coverage}%\n`;
|
|
253
|
+
}
|
|
254
|
+
if (constraints.fileOrganization?.length) {
|
|
255
|
+
md += '**File Organization:**\n';
|
|
256
|
+
constraints.fileOrganization.forEach(r => { md += `- ${r}\n`; });
|
|
257
|
+
}
|
|
258
|
+
if (constraints.security?.length) {
|
|
259
|
+
md += '**Security:**\n';
|
|
260
|
+
constraints.security.forEach(s => { md += `- ${s}\n`; });
|
|
261
|
+
}
|
|
262
|
+
if (constraints.performance?.length) {
|
|
263
|
+
md += '**Performance:**\n';
|
|
264
|
+
constraints.performance.forEach(p => { md += `- ${p}\n`; });
|
|
265
|
+
}
|
|
266
|
+
if (constraints.accessibility?.length) {
|
|
267
|
+
md += '**Accessibility:**\n';
|
|
268
|
+
constraints.accessibility.forEach(a => { md += `- ${a}\n`; });
|
|
269
|
+
}
|
|
270
|
+
md += '\n';
|
|
271
|
+
return md;
|
|
272
|
+
}
|
|
273
|
+
function formatDecisionsSection(decisions) {
|
|
274
|
+
let md = '## Decisions\n\n';
|
|
275
|
+
const items = decisions.decisions || [];
|
|
276
|
+
if (items.length === 0)
|
|
277
|
+
return '';
|
|
278
|
+
items.forEach(d => {
|
|
279
|
+
md += `### ${d.title}\n`;
|
|
280
|
+
md += `**Status:** ${d.status}\n`;
|
|
281
|
+
md += `**Rationale:** ${d.rationale}\n`;
|
|
282
|
+
if (d.alternatives?.length) {
|
|
283
|
+
md += '**Alternatives:** ' + d.alternatives.join(', ') + '\n';
|
|
284
|
+
}
|
|
285
|
+
if (d.impact)
|
|
286
|
+
md += `**Impact:** ${d.impact}\n`;
|
|
287
|
+
if (d.tags?.length)
|
|
288
|
+
md += `**Tags:** ${d.tags.join(', ')}\n`;
|
|
289
|
+
md += '\n';
|
|
290
|
+
});
|
|
291
|
+
return md;
|
|
292
|
+
}
|
|
293
|
+
// Strip $schema and version from output
|
|
294
|
+
function cleanMetadata(obj) {
|
|
295
|
+
if (obj === null || obj === undefined)
|
|
296
|
+
return obj;
|
|
297
|
+
if (typeof obj !== 'object')
|
|
298
|
+
return obj;
|
|
299
|
+
if (Array.isArray(obj))
|
|
300
|
+
return obj.map(cleanMetadata);
|
|
301
|
+
const cleaned = {};
|
|
302
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
303
|
+
if (key === '$schema' || key === 'version')
|
|
304
|
+
continue;
|
|
305
|
+
cleaned[key] = value;
|
|
306
|
+
}
|
|
307
|
+
return cleaned;
|
|
308
|
+
}
|
|
309
|
+
export async function executeQuery(rootDir, options) {
|
|
310
|
+
const data = await loadContext(rootDir);
|
|
311
|
+
const sections = {};
|
|
312
|
+
const topic = options.topic?.toLowerCase();
|
|
313
|
+
// Determine which types to include
|
|
314
|
+
const typesToInclude = options.type
|
|
315
|
+
? [options.type]
|
|
316
|
+
: VALID_TYPES;
|
|
317
|
+
for (const type of typesToInclude) {
|
|
318
|
+
const raw = data[type];
|
|
319
|
+
if (!raw)
|
|
320
|
+
continue;
|
|
321
|
+
let section;
|
|
322
|
+
if (topic) {
|
|
323
|
+
// Topic-based filtering: extract only matching fields
|
|
324
|
+
const matches = extractMatchingFields(raw, topic);
|
|
325
|
+
if (Object.keys(matches).length > 0) {
|
|
326
|
+
section = matches;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
else {
|
|
330
|
+
section = raw;
|
|
331
|
+
}
|
|
332
|
+
// Apply scope filtering for architecture and constraints
|
|
333
|
+
if (options.scope && section) {
|
|
334
|
+
if (type === 'architecture') {
|
|
335
|
+
section = filterArchitectureByScope(section, options.scope);
|
|
336
|
+
}
|
|
337
|
+
else if (type === 'constraints') {
|
|
338
|
+
section = filterConstraintsByScope(section, options.scope);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
if (section && Object.keys(section).length > 0) {
|
|
342
|
+
sections[type] = section;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
// Format output
|
|
346
|
+
let output;
|
|
347
|
+
if (options.format === 'json') {
|
|
348
|
+
const cleaned = {};
|
|
349
|
+
for (const [key, value] of Object.entries(sections)) {
|
|
350
|
+
cleaned[key] = cleanMetadata(value);
|
|
351
|
+
}
|
|
352
|
+
output = JSON.stringify(cleaned, null, 2);
|
|
353
|
+
}
|
|
354
|
+
else {
|
|
355
|
+
output = formatAsMarkdown(sections);
|
|
356
|
+
}
|
|
357
|
+
const tokenEstimate = estimateTokens(output);
|
|
358
|
+
// Apply token budget
|
|
359
|
+
if (options.maxTokens && tokenEstimate > options.maxTokens) {
|
|
360
|
+
output = truncateToTokenBudget(output, options.maxTokens);
|
|
361
|
+
}
|
|
362
|
+
return { output, tokenEstimate };
|
|
363
|
+
}
|
|
364
|
+
//# sourceMappingURL=query-engine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-engine.js","sourceRoot":"","sources":["../../../src/core/query-engine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAG7D,oEAAoE;AACpE,SAAS,cAAc,CAAC,IAAY;IAClC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,qBAAqB,CAAC,IAAY,EAAE,SAAiB;IAC5D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CAAC;IAE7C,qBAAqB;IACrB,IAAI,OAAO,CAAC,SAAS,IAAI,aAAa,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;QAC3D,MAAM,GAAG,qBAAqB,CAAC,MAAM,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC5D,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC;AACnC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prelude-context",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "The open standard for expressing and maintaining machine-readable context about a codebase",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -13,6 +13,15 @@
|
|
|
13
13
|
"SPEC.md",
|
|
14
14
|
"LICENSE"
|
|
15
15
|
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"dev": "tsx watch bin/prelude.ts",
|
|
18
|
+
"build": "tsc",
|
|
19
|
+
"prepublishOnly": "pnpm build",
|
|
20
|
+
"test": "vitest",
|
|
21
|
+
"test:watch": "vitest --watch",
|
|
22
|
+
"lint": "eslint . --ext .ts",
|
|
23
|
+
"format": "prettier --write \"**/*.{ts,json,md}\""
|
|
24
|
+
},
|
|
16
25
|
"keywords": [
|
|
17
26
|
"cli",
|
|
18
27
|
"context",
|
|
@@ -51,13 +60,5 @@
|
|
|
51
60
|
},
|
|
52
61
|
"engines": {
|
|
53
62
|
"node": ">=18.0.0"
|
|
54
|
-
},
|
|
55
|
-
"scripts": {
|
|
56
|
-
"dev": "tsx watch bin/prelude.ts",
|
|
57
|
-
"build": "tsc",
|
|
58
|
-
"test": "vitest",
|
|
59
|
-
"test:watch": "vitest --watch",
|
|
60
|
-
"lint": "eslint . --ext .ts",
|
|
61
|
-
"format": "prettier --write \"**/*.{ts,json,md}\""
|
|
62
63
|
}
|
|
63
|
-
}
|
|
64
|
+
}
|