UNPKG

@phren/cli

Version:

Knowledge layer for AI agents - CLI, MCP server, and data layer

34 lines (33 loc) • 1.92 kB
/** A keyed dispatch's isolated checkout. The clone and its managed global * config are outside the user's checkout and are removed with the dispatch. */ export interface DispatchClonePaths { cloneDir: string; gitConfigFile: string; agentTokenFile: string; /** The wrapper's PID/start-time record, beside the clone. */ workerFile?: string; } export declare function dispatchClonePaths(dispatchId: string): DispatchClonePaths; /** Canonical path inside the managed clone root, or a refusal. */ export declare function assertManagedClonePath(candidate: string): Promise<string>; export interface DispatchClone extends DispatchClonePaths { /** Where the agent starts: the same folder inside the clone as the project folder in its repository. */ cwd: string; path: string; branch: string; discard(): Promise<void>; } /** Only the keys a keyed worker may inherit: no user URL-specific overrides. */ export declare function writeManagedConfig(file: string, domain: string, checkout: string): Promise<void>; /** The start folder inside the clone, refusing a symlink or a path that escapes it. */ export declare function cloneStartDirectory(cloneDir: string, root: string, checkout: string): Promise<string>; /** A fresh clone with only our managed global config, never the user's checkout config. */ export declare function createDispatchClone(checkout: string, request: { branch: string; dispatchId: string; paths?: DispatchClonePaths; }): Promise<DispatchClone>; /** Remove a dispatch's clone, managed config and token file; only paths this Hook made. */ export declare function removeDispatchClone(paths: Partial<DispatchClonePaths> | undefined): Promise<void>; /** Keep the clone (recoverable work) but remove the token and managed config immediately. */ export declare function removeDispatchSecrets(paths: Partial<DispatchClonePaths> | undefined): Promise<void>;