Class: Resolver¶
Defined in: resolver/src/resolver.ts:105
Resolver for PromptScript files with inheritance and import support.
Handles: - @inherit: Single inheritance with deep merge - @use: Import declarations - @extend: Block modifications
Example¶
const resolver = new Resolver({
registryPath: '/path/to/registry',
localPath: '/path/to/project',
});
const result = await resolver.resolve('./instructions.prs');
if (result.ast) {
console.log('Resolved successfully');
}
Constructors¶
Constructor¶
new Resolver(
options):Resolver
Defined in: resolver/src/resolver.ts:115
Parameters¶
options¶
Returns¶
Resolver
Methods¶
clearCache()¶
clearCache():
void
Defined in: resolver/src/resolver.ts:1008
Clear the resolution cache.
Returns¶
void
getLoader()¶
getLoader():
FileLoader
Defined in: resolver/src/resolver.ts:1056
Get the file loader.
Returns¶
resolve()¶
resolve(
entryPath):Promise\<ResolvedAST>
Defined in: resolver/src/resolver.ts:138
Resolve a PromptScript file and all its dependencies.
Parameters¶
entryPath¶
string
Path to the entry file
Returns¶
Promise\<ResolvedAST>
Resolved AST with sources and errors
Throws¶
CircularDependencyError if a circular dependency is detected
verifyReferenceHashes()¶
verifyReferenceHashes(
lockfile):Promise\<ResolveError[]>
Defined in: resolver/src/resolver.ts:1020
Verify integrity hashes for registry reference files. Reads each referenced file from the registry cache and compares its hash against the lockfile entry.
Parameters¶
lockfile¶
Lockfile with reference hashes
Returns¶
Promise\<ResolveError[]>
Array of errors for mismatched references