fix(coding-agent): attach source info to resources and commands, fixes #1734
This commit is contained in:
19
packages/coding-agent/src/core/source-info.ts
Normal file
19
packages/coding-agent/src/core/source-info.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import type { PathMetadata } from "./package-manager.js";
|
||||
|
||||
export interface SourceInfo {
|
||||
path?: string;
|
||||
source: string;
|
||||
scope: "user" | "project" | "temporary";
|
||||
origin: "package" | "top-level";
|
||||
baseDir?: string;
|
||||
}
|
||||
|
||||
export function createSourceInfo(path: string | undefined, metadata: PathMetadata): SourceInfo {
|
||||
return {
|
||||
path,
|
||||
source: metadata.source,
|
||||
scope: metadata.scope,
|
||||
origin: metadata.origin,
|
||||
baseDir: metadata.baseDir,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user