mirror of
https://github.com/luckyyzh/pi-agent-integrated.git
synced 2026-10-03 02:59:35 +00:00
30 lines
1.1 KiB
TypeScript
30 lines
1.1 KiB
TypeScript
import { getSessionEntries, resolveSessionPath } from "./session-reader";
|
|
export { isFilePathReferencedByEntries } from "./session-file-references-core";
|
|
import {
|
|
isBashOutputPathReferencedByEntries,
|
|
isFilePathReferencedByEntries,
|
|
isValidSessionId,
|
|
} from "./session-file-references-core";
|
|
|
|
export async function isFilePathReferencedBySession(filePath: string, sessionId: string | null): Promise<boolean> {
|
|
if (!isValidSessionId(sessionId)) return false;
|
|
try {
|
|
const sessionPath = await resolveSessionPath(sessionId);
|
|
if (!sessionPath) return false;
|
|
return isFilePathReferencedByEntries(filePath, getSessionEntries(sessionPath));
|
|
} catch {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
export async function isBashOutputPathReferencedBySession(filePath: string, sessionId: string | null): Promise<boolean> {
|
|
if (!isValidSessionId(sessionId)) return false;
|
|
try {
|
|
const sessionPath = await resolveSessionPath(sessionId);
|
|
if (!sessionPath) return false;
|
|
return isBashOutputPathReferencedByEntries(filePath, getSessionEntries(sessionPath));
|
|
} catch {
|
|
return false;
|
|
}
|
|
}
|