import type { ContextTypes } from "@cargo-ai/types"; import { z } from "zod"; import type { ApiType, DateToString } from "../types.js"; export declare namespace Context { type Repository = ApiType; type RepositorySource = ApiType; type RuntimeBrowseEntry = { name: string; path: string; kind: "file" | "folder"; }; type RuntimeCommit = { sha: string; message: string; }; type GraphEdgeOrigin = ApiType; type GraphNode = ApiType; type GraphEdge = ApiType; type GraphBrokenEdge = ApiType; type Graph = ApiType; namespace Api { type GetRepositoryResult = { repository: Repository; }; type BrowseRuntimePayload = DateToString<{ path?: string; /** * - omitted or `1` → list a single directory level via the * runtime sandbox. * - `-1` together with no `path` → fetch the entire repository * tree from the configured default branch on GitHub. */ depth?: number; }>; type BrowseRuntimeResult = { path: string; entries: RuntimeBrowseEntry[]; /** Set only on the recursive GitHub view when GitHub truncated the response past its 100k-entries / 7 MB cap. */ truncated?: boolean; }; type ReadRuntimePayload = DateToString<{ path: string; startLine?: number; endLine?: number; }>; type ReadRuntimeResult = { path: string; content: string; startLine: number; endLine: number; totalLines: number; }; type ReadBytesRuntimePayload = DateToString<{ path: string; }>; type WriteRuntimePayload = DateToString<{ path: string; content: string; commitMessage?: string; }>; type WriteRuntimeResult = { commit: RuntimeCommit; }; type EditRuntimePayload = DateToString<{ path: string; oldString: string; newString: string; /** Replace every occurrence of `oldString` instead of requiring a single match. */ replaceAll?: boolean; commitMessage?: string; }>; type EditRuntimeResult = { commit: RuntimeCommit; }; type ExecuteRuntimePayload = DateToString<{ command: string; args?: string[]; commitMessage?: string; }>; const zodGetRepositoryErrorReason: z.ZodEnum<{ repositoryNotFound: "repositoryNotFound"; }>; const zodBrowseRuntimeErrorReason: z.ZodEnum<{ repositoryNotFound: "repositoryNotFound"; branchNotFound: "branchNotFound"; pathNotFound: "pathNotFound"; invalidQuery: "invalidQuery"; }>; const zodReadRuntimeErrorReason: z.ZodEnum<{ fileNotFound: "fileNotFound"; tooLarge: "tooLarge"; repositoryNotFound: "repositoryNotFound"; invalidBody: "invalidBody"; }>; const zodReadBytesRuntimeErrorReason: z.ZodEnum<{ fileNotFound: "fileNotFound"; tooLarge: "tooLarge"; repositoryNotFound: "repositoryNotFound"; invalidQuery: "invalidQuery"; }>; const zodWriteRuntimeErrorReason: z.ZodEnum<{ repositoryNotFound: "repositoryNotFound"; invalidBody: "invalidBody"; deniedPath: "deniedPath"; failedToWrite: "failedToWrite"; }>; const zodEditRuntimeErrorReason: z.ZodEnum<{ fileNotFound: "fileNotFound"; repositoryNotFound: "repositoryNotFound"; invalidBody: "invalidBody"; deniedPath: "deniedPath"; stringNotFound: "stringNotFound"; stringNotUnique: "stringNotUnique"; noOp: "noOp"; failedToEdit: "failedToEdit"; }>; const zodExecuteRuntimeErrorReason: z.ZodEnum<{ repositoryNotFound: "repositoryNotFound"; invalidBody: "invalidBody"; readOnly: "readOnly"; failedToExecute: "failedToExecute"; }>; const zodGetGraphErrorReason: z.ZodEnum<{ repositoryNotFound: "repositoryNotFound"; tooManyFiles: "tooManyFiles"; fileTooLarge: "fileTooLarge"; }>; type ExecuteRuntimeResult = { exitCode: number; stdout: string; stderr: string; /** * Present iff the command left the working tree dirty AND the * resulting auto-push landed on the default branch. Absent when * the command produced no tracked changes or when the push * didn't land. */ commit?: RuntimeCommit; }; type GetGraphResult = { graph: Graph; }; } const repositoryKeys: { get: (workspaceUuid: string) => readonly ["context", "repository", string]; }; const runtimeKeys: { browse: (workspaceUuid: string, path?: string, depth?: number) => readonly ["context", "runtime", "browse", string, string | undefined, number | undefined]; read: (workspaceUuid: string, path: string) => readonly ["context", "runtime", "read", string, string]; readBytes: (workspaceUuid: string, path: string) => readonly ["context", "runtime", "readBytes", string, string]; }; const graphKeys: { get: (workspaceUuid: string) => readonly ["context", "graph", string]; }; } //# sourceMappingURL=context.d.ts.map