Class: Resolver¶
Defined in: resolver/src/resolver.ts:114
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:124
Parameters¶
options¶
Returns¶
Resolver
Methods¶
clearCache()¶
clearCache():
void
Defined in: resolver/src/resolver.ts:1101
Clear the resolution cache.
Returns¶
void
getLoader()¶
getLoader():
FileLoader
Defined in: resolver/src/resolver.ts:1208
Get the file loader.
Returns¶
resolve()¶
resolve(
entryPath):Promise\<ResolvedAST>
Defined in: resolver/src/resolver.ts:147
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:1113
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