Download packages/coding-agent/src/core/source-info.ts from SaylorTwift/pi: direct link, hf CLI and curl.
- Browser
- Download file 852 Bytes
-
https://huggingface.co/SaylorTwift/pi/resolve/main/packages/coding-agent/src/core/source-info.ts
- Command line
-
hf download hf://SaylorTwift/pi/packages/coding-agent/src/core/source-info.ts
-
curl -L -o source-info.ts https://huggingface.co/SaylorTwift/pi/resolve/main/packages/coding-agent/src/core/source-info.ts
852 Bytes
| import type { PathMetadata } from "./package-manager.ts"; | |
| export type SourceScope = "user" | "project" | "temporary"; | |
| export type SourceOrigin = "package" | "top-level"; | |
| export interface SourceInfo { | |
| path: string; | |
| source: string; | |
| scope: SourceScope; | |
| origin: SourceOrigin; | |
| baseDir?: string; | |
| } | |
| export function createSourceInfo(path: string, metadata: PathMetadata): SourceInfo { | |
| return { | |
| path, | |
| source: metadata.source, | |
| scope: metadata.scope, | |
| origin: metadata.origin, | |
| baseDir: metadata.baseDir, | |
| }; | |
| } | |
| export function createSyntheticSourceInfo( | |
| path: string, | |
| options: { | |
| source: string; | |
| scope?: SourceScope; | |
| origin?: SourceOrigin; | |
| baseDir?: string; | |
| }, | |
| ): SourceInfo { | |
| return { | |
| path, | |
| source: options.source, | |
| scope: options.scope ?? "temporary", | |
| origin: options.origin ?? "top-level", | |
| baseDir: options.baseDir, | |
| }; | |
| } | |