ctxinit 0.1.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/LICENSE +21 -0
- package/README.md +484 -0
- package/bin/ctx.js +3 -0
- package/dist/analysis/index.d.ts +2 -0
- package/dist/analysis/index.d.ts.map +1 -0
- package/dist/analysis/index.js +18 -0
- package/dist/analysis/index.js.map +1 -0
- package/dist/analysis/static-analysis.d.ts +79 -0
- package/dist/analysis/static-analysis.d.ts.map +1 -0
- package/dist/analysis/static-analysis.js +279 -0
- package/dist/analysis/static-analysis.js.map +1 -0
- package/dist/bootstrap/index.d.ts +8 -0
- package/dist/bootstrap/index.d.ts.map +1 -0
- package/dist/bootstrap/index.js +13 -0
- package/dist/bootstrap/index.js.map +1 -0
- package/dist/bootstrap/orchestrator.d.ts +48 -0
- package/dist/bootstrap/orchestrator.d.ts.map +1 -0
- package/dist/bootstrap/orchestrator.js +363 -0
- package/dist/bootstrap/orchestrator.js.map +1 -0
- package/dist/bootstrap/validator.d.ts +25 -0
- package/dist/bootstrap/validator.d.ts.map +1 -0
- package/dist/bootstrap/validator.js +412 -0
- package/dist/bootstrap/validator.js.map +1 -0
- package/dist/build/atomic.d.ts +74 -0
- package/dist/build/atomic.d.ts.map +1 -0
- package/dist/build/atomic.js +235 -0
- package/dist/build/atomic.js.map +1 -0
- package/dist/build/index.d.ts +10 -0
- package/dist/build/index.d.ts.map +1 -0
- package/dist/build/index.js +26 -0
- package/dist/build/index.js.map +1 -0
- package/dist/build/lock.d.ts +102 -0
- package/dist/build/lock.d.ts.map +1 -0
- package/dist/build/lock.js +297 -0
- package/dist/build/lock.js.map +1 -0
- package/dist/build/manifest.d.ts +138 -0
- package/dist/build/manifest.d.ts.map +1 -0
- package/dist/build/manifest.js +269 -0
- package/dist/build/manifest.js.map +1 -0
- package/dist/build/orchestrator.d.ts +103 -0
- package/dist/build/orchestrator.d.ts.map +1 -0
- package/dist/build/orchestrator.js +524 -0
- package/dist/build/orchestrator.js.map +1 -0
- package/dist/cli/bootstrap.d.ts +77 -0
- package/dist/cli/bootstrap.d.ts.map +1 -0
- package/dist/cli/bootstrap.js +527 -0
- package/dist/cli/bootstrap.js.map +1 -0
- package/dist/cli/build.d.ts +32 -0
- package/dist/cli/build.d.ts.map +1 -0
- package/dist/cli/build.js +156 -0
- package/dist/cli/build.js.map +1 -0
- package/dist/cli/diff.d.ts +23 -0
- package/dist/cli/diff.d.ts.map +1 -0
- package/dist/cli/diff.js +226 -0
- package/dist/cli/diff.js.map +1 -0
- package/dist/cli/hooks.d.ts +29 -0
- package/dist/cli/hooks.d.ts.map +1 -0
- package/dist/cli/hooks.js +176 -0
- package/dist/cli/hooks.js.map +1 -0
- package/dist/cli/init.d.ts +53 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js +254 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/lint.d.ts +46 -0
- package/dist/cli/lint.d.ts.map +1 -0
- package/dist/cli/lint.js +210 -0
- package/dist/cli/lint.js.map +1 -0
- package/dist/cli/migrate.d.ts +28 -0
- package/dist/cli/migrate.d.ts.map +1 -0
- package/dist/cli/migrate.js +350 -0
- package/dist/cli/migrate.js.map +1 -0
- package/dist/cli/verify.d.ts +21 -0
- package/dist/cli/verify.d.ts.map +1 -0
- package/dist/cli/verify.js +209 -0
- package/dist/cli/verify.js.map +1 -0
- package/dist/cli.d.ts +8 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +262 -0
- package/dist/cli.js.map +1 -0
- package/dist/compiler/agents-compiler.d.ts +24 -0
- package/dist/compiler/agents-compiler.d.ts.map +1 -0
- package/dist/compiler/agents-compiler.js +192 -0
- package/dist/compiler/agents-compiler.js.map +1 -0
- package/dist/compiler/base-compiler.d.ts +152 -0
- package/dist/compiler/base-compiler.d.ts.map +1 -0
- package/dist/compiler/base-compiler.js +180 -0
- package/dist/compiler/base-compiler.js.map +1 -0
- package/dist/compiler/claude-compiler.d.ts +24 -0
- package/dist/compiler/claude-compiler.d.ts.map +1 -0
- package/dist/compiler/claude-compiler.js +182 -0
- package/dist/compiler/claude-compiler.js.map +1 -0
- package/dist/compiler/cursor-compiler.d.ts +33 -0
- package/dist/compiler/cursor-compiler.d.ts.map +1 -0
- package/dist/compiler/cursor-compiler.js +136 -0
- package/dist/compiler/cursor-compiler.js.map +1 -0
- package/dist/compiler/index.d.ts +7 -0
- package/dist/compiler/index.d.ts.map +1 -0
- package/dist/compiler/index.js +24 -0
- package/dist/compiler/index.js.map +1 -0
- package/dist/compiler/rule-selector.d.ts +115 -0
- package/dist/compiler/rule-selector.d.ts.map +1 -0
- package/dist/compiler/rule-selector.js +273 -0
- package/dist/compiler/rule-selector.js.map +1 -0
- package/dist/compiler/token-estimator.d.ts +74 -0
- package/dist/compiler/token-estimator.d.ts.map +1 -0
- package/dist/compiler/token-estimator.js +191 -0
- package/dist/compiler/token-estimator.js.map +1 -0
- package/dist/config/index.d.ts +2 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +18 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/loader.d.ts +48 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +175 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/git/gitignore.d.ts +59 -0
- package/dist/git/gitignore.d.ts.map +1 -0
- package/dist/git/gitignore.js +268 -0
- package/dist/git/gitignore.js.map +1 -0
- package/dist/git/hooks.d.ts +34 -0
- package/dist/git/hooks.d.ts.map +1 -0
- package/dist/git/hooks.js +129 -0
- package/dist/git/hooks.js.map +1 -0
- package/dist/git/husky.d.ts +52 -0
- package/dist/git/husky.d.ts.map +1 -0
- package/dist/git/husky.js +219 -0
- package/dist/git/husky.js.map +1 -0
- package/dist/git/index.d.ts +9 -0
- package/dist/git/index.d.ts.map +1 -0
- package/dist/git/index.js +15 -0
- package/dist/git/index.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/llm/base-provider.d.ts +43 -0
- package/dist/llm/base-provider.d.ts.map +1 -0
- package/dist/llm/base-provider.js +91 -0
- package/dist/llm/base-provider.js.map +1 -0
- package/dist/llm/index.d.ts +17 -0
- package/dist/llm/index.d.ts.map +1 -0
- package/dist/llm/index.js +36 -0
- package/dist/llm/index.js.map +1 -0
- package/dist/llm/prompts/bootstrap-prompt.d.ts +27 -0
- package/dist/llm/prompts/bootstrap-prompt.d.ts.map +1 -0
- package/dist/llm/prompts/bootstrap-prompt.js +278 -0
- package/dist/llm/prompts/bootstrap-prompt.js.map +1 -0
- package/dist/llm/prompts/index.d.ts +5 -0
- package/dist/llm/prompts/index.d.ts.map +1 -0
- package/dist/llm/prompts/index.js +11 -0
- package/dist/llm/prompts/index.js.map +1 -0
- package/dist/llm/provider-factory.d.ts +27 -0
- package/dist/llm/provider-factory.d.ts.map +1 -0
- package/dist/llm/provider-factory.js +213 -0
- package/dist/llm/provider-factory.js.map +1 -0
- package/dist/llm/providers/claude-api.d.ts +21 -0
- package/dist/llm/providers/claude-api.d.ts.map +1 -0
- package/dist/llm/providers/claude-api.js +110 -0
- package/dist/llm/providers/claude-api.js.map +1 -0
- package/dist/llm/providers/claude-code.d.ts +21 -0
- package/dist/llm/providers/claude-code.d.ts.map +1 -0
- package/dist/llm/providers/claude-code.js +120 -0
- package/dist/llm/providers/claude-code.js.map +1 -0
- package/dist/llm/providers/codex-cli.d.ts +25 -0
- package/dist/llm/providers/codex-cli.d.ts.map +1 -0
- package/dist/llm/providers/codex-cli.js +129 -0
- package/dist/llm/providers/codex-cli.js.map +1 -0
- package/dist/llm/providers/cursor-cli.d.ts +24 -0
- package/dist/llm/providers/cursor-cli.d.ts.map +1 -0
- package/dist/llm/providers/cursor-cli.js +106 -0
- package/dist/llm/providers/cursor-cli.js.map +1 -0
- package/dist/llm/providers/gemini-api.d.ts +20 -0
- package/dist/llm/providers/gemini-api.d.ts.map +1 -0
- package/dist/llm/providers/gemini-api.js +121 -0
- package/dist/llm/providers/gemini-api.js.map +1 -0
- package/dist/llm/providers/gemini-cli.d.ts +20 -0
- package/dist/llm/providers/gemini-cli.d.ts.map +1 -0
- package/dist/llm/providers/gemini-cli.js +109 -0
- package/dist/llm/providers/gemini-cli.js.map +1 -0
- package/dist/llm/providers/interactive.d.ts +42 -0
- package/dist/llm/providers/interactive.d.ts.map +1 -0
- package/dist/llm/providers/interactive.js +200 -0
- package/dist/llm/providers/interactive.js.map +1 -0
- package/dist/llm/providers/openai-api.d.ts +21 -0
- package/dist/llm/providers/openai-api.d.ts.map +1 -0
- package/dist/llm/providers/openai-api.js +107 -0
- package/dist/llm/providers/openai-api.js.map +1 -0
- package/dist/llm/types.d.ts +128 -0
- package/dist/llm/types.d.ts.map +1 -0
- package/dist/llm/types.js +8 -0
- package/dist/llm/types.js.map +1 -0
- package/dist/parser/index.d.ts +3 -0
- package/dist/parser/index.d.ts.map +1 -0
- package/dist/parser/index.js +19 -0
- package/dist/parser/index.js.map +1 -0
- package/dist/parser/path-security.d.ts +40 -0
- package/dist/parser/path-security.d.ts.map +1 -0
- package/dist/parser/path-security.js +183 -0
- package/dist/parser/path-security.js.map +1 -0
- package/dist/parser/rule-parser.d.ts +50 -0
- package/dist/parser/rule-parser.d.ts.map +1 -0
- package/dist/parser/rule-parser.js +203 -0
- package/dist/parser/rule-parser.js.map +1 -0
- package/dist/schemas/config.d.ts +202 -0
- package/dist/schemas/config.d.ts.map +1 -0
- package/dist/schemas/config.js +96 -0
- package/dist/schemas/config.js.map +1 -0
- package/dist/schemas/index.d.ts +3 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +19 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/rule.d.ts +67 -0
- package/dist/schemas/rule.d.ts.map +1 -0
- package/dist/schemas/rule.js +44 -0
- package/dist/schemas/rule.js.map +1 -0
- package/package.json +69 -0
- package/templates/architecture.md +35 -0
- package/templates/bootstrap-prompt.md +242 -0
- package/templates/config.yaml +25 -0
- package/templates/project.md +44 -0
- package/templates/rules/example.md +36 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lock.js","sourceRoot":"","sources":["../../src/build/lock.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDH,kCAEC;AAQD,wCAOC;AAQD,4BAWC;AASD,kCAGC;AAQD,4CAUC;AAUD,kCAqDC;AA8CD,kCA0BC;AAQD,wCAIC;AA0BD,4BAoBC;AAnTD,uCAAyB;AACzB,2CAA6B;AAC7B,uCAAyB;AA8BzB;;GAEG;AACH,MAAM,kBAAkB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AAEzC;;GAEG;AACH,MAAM,aAAa,GAAG,aAAa,CAAC;AAEpC;;;;;GAKG;AACH,SAAgB,WAAW,CAAC,WAAmB;IAC7C,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;AAC3D,CAAC;AAED;;;;;GAKG;AACH,SAAgB,cAAc,CAAC,MAAc;IAC3C,OAAO;QACL,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;QACrB,QAAQ,EAAE,EAAE,CAAC,QAAQ,EAAE;QACvB,MAAM;KACP,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,QAAQ,CAAC,QAAgB;IAC7C,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC9D,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAa,CAAC;IACzC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAK,KAA+B,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YACvD,OAAO,IAAI,CAAC;Q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,IAAI,CAAC;QACH,OAAO,MAAM,EAAE,EAAE,CAAC;IACpB,CAAC;YAAS,CAAC;QACT,MAAM,WAAW,CAAC,WAAW,CAAC,CAAC;IACjC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build Manifest
|
|
3
|
+
*
|
|
4
|
+
* Tracks file hashes and modification times for incremental builds.
|
|
5
|
+
* Stored at `.context/.build-manifest.json`
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Entry for a tracked file in the manifest
|
|
9
|
+
*/
|
|
10
|
+
export interface ManifestEntry {
|
|
11
|
+
/** SHA-256 content hash with "sha256:" prefix */
|
|
12
|
+
hash: string;
|
|
13
|
+
/** Last modification time (Unix timestamp in ms) */
|
|
14
|
+
mtime: number;
|
|
15
|
+
/** File size in bytes */
|
|
16
|
+
size: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Output dependency tracking
|
|
20
|
+
*/
|
|
21
|
+
export interface OutputDependency {
|
|
22
|
+
/** Target output file path */
|
|
23
|
+
outputPath: string;
|
|
24
|
+
/** Source rule paths that contribute to this output */
|
|
25
|
+
sourceRules: string[];
|
|
26
|
+
/** Timestamp when output was generated */
|
|
27
|
+
generatedAt: number;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Build manifest structure
|
|
31
|
+
*/
|
|
32
|
+
export interface BuildManifest {
|
|
33
|
+
/** Manifest version for compatibility */
|
|
34
|
+
version: string;
|
|
35
|
+
/** Timestamp of last successful build */
|
|
36
|
+
lastBuildTime: number;
|
|
37
|
+
/** Target that was built (cursor, claude, agents) */
|
|
38
|
+
target: string;
|
|
39
|
+
/** Source file entries (rule files, project.md, etc.) */
|
|
40
|
+
sources: Record<string, ManifestEntry>;
|
|
41
|
+
/** Config file hash */
|
|
42
|
+
configHash: string;
|
|
43
|
+
/** Output dependencies */
|
|
44
|
+
outputs: OutputDependency[];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Calculate SHA-256 hash of file content
|
|
48
|
+
*
|
|
49
|
+
* @param content - File content to hash
|
|
50
|
+
* @returns Hash string with "sha256:" prefix
|
|
51
|
+
*/
|
|
52
|
+
export declare function calculateHash(content: string | Buffer): string;
|
|
53
|
+
/**
|
|
54
|
+
* Calculate SHA-256 hash of a file
|
|
55
|
+
*
|
|
56
|
+
* @param filePath - Path to file
|
|
57
|
+
* @returns Hash string with "sha256:" prefix
|
|
58
|
+
*/
|
|
59
|
+
export declare function calculateFileHash(filePath: string): Promise<string>;
|
|
60
|
+
/**
|
|
61
|
+
* Create a manifest entry for a file
|
|
62
|
+
*
|
|
63
|
+
* @param filePath - Path to file
|
|
64
|
+
* @returns Manifest entry with hash, mtime, and size
|
|
65
|
+
*/
|
|
66
|
+
export declare function createManifestEntry(filePath: string): Promise<ManifestEntry>;
|
|
67
|
+
/**
|
|
68
|
+
* Create an empty manifest
|
|
69
|
+
*
|
|
70
|
+
* @param target - Build target (cursor, claude, agents)
|
|
71
|
+
* @returns Empty manifest
|
|
72
|
+
*/
|
|
73
|
+
export declare function createEmptyManifest(target: string): BuildManifest;
|
|
74
|
+
/**
|
|
75
|
+
* Get manifest file path
|
|
76
|
+
*
|
|
77
|
+
* @param projectRoot - Project root directory
|
|
78
|
+
* @returns Manifest file path
|
|
79
|
+
*/
|
|
80
|
+
export declare function getManifestPath(projectRoot: string): string;
|
|
81
|
+
/**
|
|
82
|
+
* Read manifest from disk
|
|
83
|
+
*
|
|
84
|
+
* @param projectRoot - Project root directory
|
|
85
|
+
* @returns Manifest or null if not found
|
|
86
|
+
*/
|
|
87
|
+
export declare function readManifest(projectRoot: string): Promise<BuildManifest | null>;
|
|
88
|
+
/**
|
|
89
|
+
* Write manifest to disk
|
|
90
|
+
*
|
|
91
|
+
* @param projectRoot - Project root directory
|
|
92
|
+
* @param manifest - Manifest to write
|
|
93
|
+
*/
|
|
94
|
+
export declare function writeManifest(projectRoot: string, manifest: BuildManifest): Promise<void>;
|
|
95
|
+
/**
|
|
96
|
+
* Check if a file has changed since last build
|
|
97
|
+
*
|
|
98
|
+
* Uses mtime for fast detection, falls back to hash comparison
|
|
99
|
+
*
|
|
100
|
+
* @param filePath - File to check
|
|
101
|
+
* @param entry - Previous manifest entry
|
|
102
|
+
* @returns true if file has changed
|
|
103
|
+
*/
|
|
104
|
+
export declare function hasFileChanged(filePath: string, entry: ManifestEntry | undefined): Promise<boolean>;
|
|
105
|
+
/**
|
|
106
|
+
* Detect all changed files since last build
|
|
107
|
+
*
|
|
108
|
+
* @param projectRoot - Project root directory
|
|
109
|
+
* @param currentFiles - Current source files
|
|
110
|
+
* @param manifest - Previous build manifest
|
|
111
|
+
* @returns Object with added, modified, and removed file lists
|
|
112
|
+
*/
|
|
113
|
+
export declare function detectChanges(projectRoot: string, currentFiles: string[], manifest: BuildManifest): Promise<{
|
|
114
|
+
added: string[];
|
|
115
|
+
modified: string[];
|
|
116
|
+
removed: string[];
|
|
117
|
+
unchanged: string[];
|
|
118
|
+
}>;
|
|
119
|
+
/**
|
|
120
|
+
* Update manifest with current file states
|
|
121
|
+
*
|
|
122
|
+
* @param projectRoot - Project root directory
|
|
123
|
+
* @param files - Files to include in manifest
|
|
124
|
+
* @param target - Build target
|
|
125
|
+
* @param outputs - Output dependencies
|
|
126
|
+
* @param configHash - Hash of config file
|
|
127
|
+
* @returns Updated manifest
|
|
128
|
+
*/
|
|
129
|
+
export declare function updateManifest(projectRoot: string, files: string[], target: string, outputs: OutputDependency[], configHash: string): Promise<BuildManifest>;
|
|
130
|
+
/**
|
|
131
|
+
* Find outputs affected by changed source files
|
|
132
|
+
*
|
|
133
|
+
* @param manifest - Build manifest
|
|
134
|
+
* @param changedFiles - Files that have changed
|
|
135
|
+
* @returns Output paths that need regeneration
|
|
136
|
+
*/
|
|
137
|
+
export declare function findAffectedOutputs(manifest: BuildManifest, changedFiles: string[]): string[];
|
|
138
|
+
//# sourceMappingURL=manifest.d.ts.map
|
|
@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AC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAmBrF;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAI/F;AAED;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAClC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,aAAa,GAAG,SAAS,GAC/B,OAAO,CAAC,OAAO,CAAC,CAsBlB;AAED;;;;;;;GAOG;AACH,wBAAsB,aAAa,CACjC,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EAAE,EACtB,QAAQ,EAAE,aAAa,GACtB,OAAO,CAAC;IACT,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC,CAgCD;AAED;;;;;;;;;GASG;AACH,wBAAsB,cAAc,CAClC,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EAAE,EACf,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,gBAAgB,EAAE,EAC3B,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,aAAa,CAAC,CAgBxB;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,aAAa,EACvB,YAAY,EAAE,MAAM,EAAE,GACrB,MAAM,EAAE,CAcV"}
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Build Manifest
|
|
4
|
+
*
|
|
5
|
+
* Tracks file hashes and modification times for incremental builds.
|
|
6
|
+
* Stored at `.context/.build-manifest.json`
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
+
}) : function(o, v) {
|
|
22
|
+
o["default"] = v;
|
|
23
|
+
});
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.calculateHash = calculateHash;
|
|
43
|
+
exports.calculateFileHash = calculateFileHash;
|
|
44
|
+
exports.createManifestEntry = createManifestEntry;
|
|
45
|
+
exports.createEmptyManifest = createEmptyManifest;
|
|
46
|
+
exports.getManifestPath = getManifestPath;
|
|
47
|
+
exports.readManifest = readManifest;
|
|
48
|
+
exports.writeManifest = writeManifest;
|
|
49
|
+
exports.hasFileChanged = hasFileChanged;
|
|
50
|
+
exports.detectChanges = detectChanges;
|
|
51
|
+
exports.updateManifest = updateManifest;
|
|
52
|
+
exports.findAffectedOutputs = findAffectedOutputs;
|
|
53
|
+
const fs = __importStar(require("fs"));
|
|
54
|
+
const path = __importStar(require("path"));
|
|
55
|
+
const crypto = __importStar(require("crypto"));
|
|
56
|
+
/**
|
|
57
|
+
* Default manifest path
|
|
58
|
+
*/
|
|
59
|
+
const MANIFEST_FILENAME = '.build-manifest.json';
|
|
60
|
+
/**
|
|
61
|
+
* Current manifest version
|
|
62
|
+
*/
|
|
63
|
+
const MANIFEST_VERSION = '1.0';
|
|
64
|
+
/**
|
|
65
|
+
* Calculate SHA-256 hash of file content
|
|
66
|
+
*
|
|
67
|
+
* @param content - File content to hash
|
|
68
|
+
* @returns Hash string with "sha256:" prefix
|
|
69
|
+
*/
|
|
70
|
+
function calculateHash(content) {
|
|
71
|
+
const hash = crypto.createHash('sha256').update(content).digest('hex');
|
|
72
|
+
return `sha256:${hash}`;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Calculate SHA-256 hash of a file
|
|
76
|
+
*
|
|
77
|
+
* @param filePath - Path to file
|
|
78
|
+
* @returns Hash string with "sha256:" prefix
|
|
79
|
+
*/
|
|
80
|
+
async function calculateFileHash(filePath) {
|
|
81
|
+
const content = await fs.promises.readFile(filePath);
|
|
82
|
+
return calculateHash(content);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Create a manifest entry for a file
|
|
86
|
+
*
|
|
87
|
+
* @param filePath - Path to file
|
|
88
|
+
* @returns Manifest entry with hash, mtime, and size
|
|
89
|
+
*/
|
|
90
|
+
async function createManifestEntry(filePath) {
|
|
91
|
+
const stats = await fs.promises.stat(filePath);
|
|
92
|
+
const content = await fs.promises.readFile(filePath);
|
|
93
|
+
const hash = calculateHash(content);
|
|
94
|
+
return {
|
|
95
|
+
hash,
|
|
96
|
+
mtime: stats.mtimeMs,
|
|
97
|
+
size: stats.size,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Create an empty manifest
|
|
102
|
+
*
|
|
103
|
+
* @param target - Build target (cursor, claude, agents)
|
|
104
|
+
* @returns Empty manifest
|
|
105
|
+
*/
|
|
106
|
+
function createEmptyManifest(target) {
|
|
107
|
+
return {
|
|
108
|
+
version: MANIFEST_VERSION,
|
|
109
|
+
lastBuildTime: 0,
|
|
110
|
+
target,
|
|
111
|
+
sources: {},
|
|
112
|
+
configHash: '',
|
|
113
|
+
outputs: [],
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Get manifest file path
|
|
118
|
+
*
|
|
119
|
+
* @param projectRoot - Project root directory
|
|
120
|
+
* @returns Manifest file path
|
|
121
|
+
*/
|
|
122
|
+
function getManifestPath(projectRoot) {
|
|
123
|
+
return path.join(projectRoot, '.context', MANIFEST_FILENAME);
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Read manifest from disk
|
|
127
|
+
*
|
|
128
|
+
* @param projectRoot - Project root directory
|
|
129
|
+
* @returns Manifest or null if not found
|
|
130
|
+
*/
|
|
131
|
+
async function readManifest(projectRoot) {
|
|
132
|
+
const manifestPath = getManifestPath(projectRoot);
|
|
133
|
+
try {
|
|
134
|
+
const content = await fs.promises.readFile(manifestPath, 'utf-8');
|
|
135
|
+
const manifest = JSON.parse(content);
|
|
136
|
+
// Validate version
|
|
137
|
+
if (manifest.version !== MANIFEST_VERSION) {
|
|
138
|
+
return null; // Incompatible version, trigger full rebuild
|
|
139
|
+
}
|
|
140
|
+
return manifest;
|
|
141
|
+
}
|
|
142
|
+
catch (error) {
|
|
143
|
+
if (error.code === 'ENOENT') {
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
throw error;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Write manifest to disk
|
|
151
|
+
*
|
|
152
|
+
* @param projectRoot - Project root directory
|
|
153
|
+
* @param manifest - Manifest to write
|
|
154
|
+
*/
|
|
155
|
+
async function writeManifest(projectRoot, manifest) {
|
|
156
|
+
const manifestPath = getManifestPath(projectRoot);
|
|
157
|
+
const content = JSON.stringify(manifest, null, 2);
|
|
158
|
+
await fs.promises.writeFile(manifestPath, content, 'utf-8');
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Check if a file has changed since last build
|
|
162
|
+
*
|
|
163
|
+
* Uses mtime for fast detection, falls back to hash comparison
|
|
164
|
+
*
|
|
165
|
+
* @param filePath - File to check
|
|
166
|
+
* @param entry - Previous manifest entry
|
|
167
|
+
* @returns true if file has changed
|
|
168
|
+
*/
|
|
169
|
+
async function hasFileChanged(filePath, entry) {
|
|
170
|
+
if (!entry) {
|
|
171
|
+
return true; // New file
|
|
172
|
+
}
|
|
173
|
+
try {
|
|
174
|
+
const stats = await fs.promises.stat(filePath);
|
|
175
|
+
// Fast path: mtime unchanged means file unchanged
|
|
176
|
+
if (stats.mtimeMs === entry.mtime && stats.size === entry.size) {
|
|
177
|
+
return false;
|
|
178
|
+
}
|
|
179
|
+
// Slow path: verify with hash
|
|
180
|
+
const currentHash = await calculateFileHash(filePath);
|
|
181
|
+
return currentHash !== entry.hash;
|
|
182
|
+
}
|
|
183
|
+
catch (error) {
|
|
184
|
+
if (error.code === 'ENOENT') {
|
|
185
|
+
return true; // File deleted
|
|
186
|
+
}
|
|
187
|
+
throw error;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Detect all changed files since last build
|
|
192
|
+
*
|
|
193
|
+
* @param projectRoot - Project root directory
|
|
194
|
+
* @param currentFiles - Current source files
|
|
195
|
+
* @param manifest - Previous build manifest
|
|
196
|
+
* @returns Object with added, modified, and removed file lists
|
|
197
|
+
*/
|
|
198
|
+
async function detectChanges(projectRoot, currentFiles, manifest) {
|
|
199
|
+
const added = [];
|
|
200
|
+
const modified = [];
|
|
201
|
+
const removed = [];
|
|
202
|
+
const unchanged = [];
|
|
203
|
+
// Check current files against manifest
|
|
204
|
+
for (const file of currentFiles) {
|
|
205
|
+
const relativePath = path.relative(projectRoot, file);
|
|
206
|
+
const entry = manifest.sources[relativePath];
|
|
207
|
+
if (!entry) {
|
|
208
|
+
added.push(relativePath);
|
|
209
|
+
}
|
|
210
|
+
else if (await hasFileChanged(file, entry)) {
|
|
211
|
+
modified.push(relativePath);
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
unchanged.push(relativePath);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
// Check for removed files
|
|
218
|
+
const currentRelativePaths = new Set(currentFiles.map(f => path.relative(projectRoot, f)));
|
|
219
|
+
for (const previousFile of Object.keys(manifest.sources)) {
|
|
220
|
+
if (!currentRelativePaths.has(previousFile)) {
|
|
221
|
+
removed.push(previousFile);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
return { added, modified, removed, unchanged };
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Update manifest with current file states
|
|
228
|
+
*
|
|
229
|
+
* @param projectRoot - Project root directory
|
|
230
|
+
* @param files - Files to include in manifest
|
|
231
|
+
* @param target - Build target
|
|
232
|
+
* @param outputs - Output dependencies
|
|
233
|
+
* @param configHash - Hash of config file
|
|
234
|
+
* @returns Updated manifest
|
|
235
|
+
*/
|
|
236
|
+
async function updateManifest(projectRoot, files, target, outputs, configHash) {
|
|
237
|
+
const sources = {};
|
|
238
|
+
for (const file of files) {
|
|
239
|
+
const relativePath = path.relative(projectRoot, file);
|
|
240
|
+
sources[relativePath] = await createManifestEntry(file);
|
|
241
|
+
}
|
|
242
|
+
return {
|
|
243
|
+
version: MANIFEST_VERSION,
|
|
244
|
+
lastBuildTime: Date.now(),
|
|
245
|
+
target,
|
|
246
|
+
sources,
|
|
247
|
+
configHash,
|
|
248
|
+
outputs,
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Find outputs affected by changed source files
|
|
253
|
+
*
|
|
254
|
+
* @param manifest - Build manifest
|
|
255
|
+
* @param changedFiles - Files that have changed
|
|
256
|
+
* @returns Output paths that need regeneration
|
|
257
|
+
*/
|
|
258
|
+
function findAffectedOutputs(manifest, changedFiles) {
|
|
259
|
+
const changedSet = new Set(changedFiles);
|
|
260
|
+
const affected = [];
|
|
261
|
+
for (const output of manifest.outputs) {
|
|
262
|
+
const hasChangedSource = output.sourceRules.some(source => changedSet.has(source));
|
|
263
|
+
if (hasChangedSource) {
|
|
264
|
+
affected.push(output.outputPath);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
return affected;
|
|
268
|
+
}
|
|
269
|
+
//# sourceMappingURL=manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/build/manifest.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEH,sCAGC;AAQD,8CAGC;AAQD,kDAUC;AAQD,kDASC;AAQD,0CAEC;AAQD,oCAmBC;AAQD,sCAIC;AAWD,wCAyBC;AAUD,sCAyCC;AAYD,wCAsBC;AASD,kDAiBC;AAnTD,uCAAyB;AACzB,2CAA6B;AAC7B,+CAAiC;AA4CjC;;GAEG;AACH,MAAM,iBAAiB,GAAG,sBAAsB,CAAC;AAEjD;;GAEG;AACH,MAAM,gBAAgB,GAAG,KAAK,CAAC;AAE/B;;;;;GAKG;AACH,SAAgB,aAAa,CAAC,OAAwB;IACpD,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvE,OAAO,UAAU,IAAI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,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build Orchestration
|
|
3
|
+
*
|
|
4
|
+
* Coordinates the full build pipeline:
|
|
5
|
+
* - Rule discovery and parsing
|
|
6
|
+
* - Static analysis validation
|
|
7
|
+
* - Multi-target compilation
|
|
8
|
+
* - Incremental build support
|
|
9
|
+
* - Error handling and recovery
|
|
10
|
+
*/
|
|
11
|
+
import { Config, BuildTarget } from '../schemas/config';
|
|
12
|
+
import { AnalysisResult } from '../analysis/static-analysis';
|
|
13
|
+
import { CompilationResult } from '../compiler/base-compiler';
|
|
14
|
+
/**
|
|
15
|
+
* Build options
|
|
16
|
+
*/
|
|
17
|
+
export interface BuildOptions {
|
|
18
|
+
/** Project root directory */
|
|
19
|
+
projectRoot: string;
|
|
20
|
+
/** Build target(s) */
|
|
21
|
+
targets?: BuildTarget[];
|
|
22
|
+
/** Force full rebuild (ignore incremental) */
|
|
23
|
+
force?: boolean;
|
|
24
|
+
/** Check if outputs are up to date (no writes) */
|
|
25
|
+
check?: boolean;
|
|
26
|
+
/** Verbose output */
|
|
27
|
+
verbose?: boolean;
|
|
28
|
+
/** Quiet mode (minimal output) */
|
|
29
|
+
quiet?: boolean;
|
|
30
|
+
/** Skip validation */
|
|
31
|
+
skipValidation?: boolean;
|
|
32
|
+
/** Parallel rule processing */
|
|
33
|
+
parallel?: boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Build statistics
|
|
37
|
+
*/
|
|
38
|
+
export interface BuildStats {
|
|
39
|
+
/** Total build duration in milliseconds */
|
|
40
|
+
duration: number;
|
|
41
|
+
/** Number of rules processed */
|
|
42
|
+
rulesProcessed: number;
|
|
43
|
+
/** Number of rules changed (incremental) */
|
|
44
|
+
rulesChanged: number;
|
|
45
|
+
/** Number of output files generated */
|
|
46
|
+
filesGenerated: number;
|
|
47
|
+
/** Total tokens in output */
|
|
48
|
+
totalTokens: number;
|
|
49
|
+
/** Whether this was an incremental build */
|
|
50
|
+
incremental: boolean;
|
|
51
|
+
/** Targets built */
|
|
52
|
+
targets: BuildTarget[];
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Build result
|
|
56
|
+
*/
|
|
57
|
+
export interface BuildResult {
|
|
58
|
+
/** Whether build succeeded */
|
|
59
|
+
success: boolean;
|
|
60
|
+
/** Build statistics */
|
|
61
|
+
stats: BuildStats;
|
|
62
|
+
/** Analysis result */
|
|
63
|
+
analysis?: AnalysisResult;
|
|
64
|
+
/** Compilation results by target */
|
|
65
|
+
compilations: Map<BuildTarget, CompilationResult>;
|
|
66
|
+
/** Errors encountered */
|
|
67
|
+
errors: string[];
|
|
68
|
+
/** Warnings */
|
|
69
|
+
warnings: string[];
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Build orchestrator
|
|
73
|
+
*/
|
|
74
|
+
export declare class BuildOrchestrator {
|
|
75
|
+
private config;
|
|
76
|
+
private projectRoot;
|
|
77
|
+
private quiet;
|
|
78
|
+
constructor(projectRoot: string, config: Config, options?: Partial<BuildOptions>);
|
|
79
|
+
/**
|
|
80
|
+
* Execute full build pipeline
|
|
81
|
+
*/
|
|
82
|
+
build(options: BuildOptions): Promise<BuildResult>;
|
|
83
|
+
/**
|
|
84
|
+
* Log message (respecting quiet/verbose modes)
|
|
85
|
+
*/
|
|
86
|
+
private log;
|
|
87
|
+
/**
|
|
88
|
+
* Get default targets based on config
|
|
89
|
+
* Returns targets that have configuration, defaults to ['claude']
|
|
90
|
+
*/
|
|
91
|
+
private getDefaultTargets;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Execute build with options
|
|
95
|
+
*
|
|
96
|
+
* Convenience function for CLI integration
|
|
97
|
+
*/
|
|
98
|
+
export declare function executeBuild(options: BuildOptions): Promise<BuildResult>;
|
|
99
|
+
/**
|
|
100
|
+
* Format build result for display
|
|
101
|
+
*/
|
|
102
|
+
export declare function formatBuildResult(result: BuildResult): string;
|
|
103
|
+
//# sourceMappingURL=orchestrator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