@gitgov/core 2.1.1 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -6
- package/dist/src/{agent_runner-ByOUWOt6.d.ts → agent_runner-Cs5HXt4h.d.ts} +2 -1
- package/dist/src/fs.d.ts +11 -20
- package/dist/src/fs.js +9 -0
- package/dist/src/fs.js.map +1 -1
- package/dist/src/github.d.ts +472 -0
- package/dist/src/github.js +1281 -0
- package/dist/src/github.js.map +1 -0
- package/dist/src/{index--ahcnsG3.d.ts → index-D1RVufxB.d.ts} +38 -234
- package/dist/src/index.d.ts +10 -7
- package/dist/src/index.js +9 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/key_provider-CRpHFGjN.d.ts +227 -0
- package/dist/src/memory.d.ts +10 -4
- package/dist/src/memory.js +9 -1
- package/dist/src/memory.js.map +1 -1
- package/dist/src/{memory_file_lister-BkQ_C3ZU.d.ts → memory_file_lister-CfHtByeZ.d.ts} +2 -1
- package/package.json +6 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/file_lister/file_lister.errors.ts","../../src/file_lister/github/github_file_lister.ts","../../src/record_store/github/github_record_store.ts","../../src/git/errors.ts","../../src/git/github/github_git_module.ts","../../src/config_store/github/github_config_store.ts","../../src/github.ts"],"names":[],"mappings":";;;;;AAaO,IAAM,eAAA,GAAN,cAA8B,KAAA,CAAM;AAAA,EACzC,WAAA,CACE,OAAA,EACgB,IAAA,EACA,QAAA,EAChB;AACA,IAAA,KAAA,CAAM,OAAO,CAAA;AAHG,IAAA,IAAA,CAAA,IAAA,GAAA,IAAA;AACA,IAAA,IAAA,CAAA,QAAA,GAAA,QAAA;AAGhB,IAAA,IAAA,CAAK,IAAA,GAAO,iBAAA;AAAA,EACd;AACF,CAAA;;;AC6BO,IAAM,mBAAN,MAA6C;AAAA,EACjC,KAAA;AAAA,EACA,IAAA;AAAA,EACA,GAAA;AAAA,EAC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A;AAAA,KACF;AAAA,EACF;AAGA,EAAA,MAAM,UAAU,KAAA,YAAiB,KAAA,GAAQ,KAAA,CAAM,OAAA,GAAU,OAAO,KAAK,CAAA;AACrE,EAAA,OAAO,IAAI,cAAA,CAAe,CAAA,eAAA,EAAkB,OAAO,IAAI,eAAe,CAAA;AACxE","file":"github.js","sourcesContent":["/**\n * Error codes for FileLister operations.\n */\nexport type FileListerErrorCode =\n | 'FILE_NOT_FOUND'\n | 'READ_ERROR'\n | 'PERMISSION_DENIED'\n | 'INVALID_PATH'\n | 'NETWORK_ERROR';\n\n/**\n * Error thrown when file operations fail.\n */\nexport class FileListerError extends Error {\n constructor(\n message: string,\n public readonly code: FileListerErrorCode,\n public readonly filePath?: string\n ) {\n super(message);\n this.name = 'FileListerError';\n }\n}\n","/**\n * GitHubFileLister - GitHub REST API implementation of FileLister\n *\n * Provides file listing and reading operations via GitHub's REST API\n * for SaaS environments where direct filesystem access is not available.\n *\n * Uses the Git Trees API for listing (with caching) and the Contents API\n * for reading individual files. Falls back to the Blobs API for files\n * larger than 1MB where the Contents API returns null content.\n *\n * @module file_lister/github/github_file_lister\n */\n\nimport picomatch from 'picomatch';\nimport type { Octokit } from '@octokit/rest';\nimport type { FileLister, FileListOptions, FileStats } from '../file_lister';\nimport { FileListerError } from '../file_lister';\nimport { isOctokitRequestError } from '../../github';\nimport type { GitHubFileListerOptions } from './github_file_lister.types';\n\n/** Tree entry shape from Octokit git.getTree response */\ntype TreeEntry = {\n path?: string;\n type?: string;\n sha?: string;\n size?: number;\n};\n\n/**\n * GitHubFileLister - GitHub REST API FileLister implementation.\n *\n * Implements the FileLister interface using GitHub's REST API endpoints:\n * - Trees API for listing files (cached)\n * - Contents API for reading, stat, and exists\n * - Blobs API as fallback for large files (>1MB)\n *\n * @example\n * ```typescript\n * import { Octokit } from '@octokit/rest';\n * const octokit = new Octokit({ auth: 'ghp_xxx' });\n * const lister = new GitHubFileLister({\n * owner: 'myorg',\n * repo: 'myrepo',\n * ref: 'gitgov-state',\n * basePath: '.gitgov',\n * }, octokit);\n *\n * const files = await lister.list(['**\\/*.ts']);\n * const content = await lister.read('config.json');\n * ```\n */\nexport class GitHubFileLister implements FileLister {\n private readonly owner: string;\n private readonly repo: string;\n private readonly ref: string;\n private readonly basePath: string;\n private readonly octokit: Octokit;\n\n /** Cached tree entries from the Trees API */\n private treeCache: TreeEntry[] | null = null;\n\n constructor(options: GitHubFileListerOptions, octokit: Octokit) {\n this.owner = options.owner;\n this.repo = options.repo;\n this.ref = options.ref ?? 'gitgov-state';\n this.basePath = options.basePath ?? '';\n this.octokit = octokit;\n }\n\n // ═══════════════════════════════════════════════════════════════════════\n // FileLister Interface\n // ═══════════════════════════════════════════════════════════════════════\n\n /**\n * [EARS-A1] Lists files matching glob patterns.\n * [EARS-B1] Uses Trees API with recursive=1 and picomatch filter.\n * [EARS-B3] Applies basePath prefix for tree entries, strips from results.\n * [EARS-B6] Caches tree between list() calls.\n */\n async list(patterns: string[], options?: FileListOptions): Promise<string[]> {\n const entries = await this.fetchTree();\n\n // Filter only blobs (files, not directories)\n const blobs = entries.filter(entry => entry.type === 'blob');\n\n // Apply basePath: only entries under basePath, then strip prefix\n const prefix = this.basePath ? `${this.basePath}/` : '';\n const relativePaths: string[] = [];\n\n for (const blob of blobs) {\n if (!blob.path) continue;\n if (prefix && !blob.path.startsWith(prefix)) {\n continue;\n }\n const relativePath = prefix ? blob.path.slice(prefix.length) : blob.path;\n relativePaths.push(relativePath);\n }\n\n // Match against patterns using picomatch\n const isMatch = picomatch(patterns, {\n ignore: options?.ignore,\n });\n\n return relativePaths.filter(p => isMatch(p)).sort();\n }\n\n /**\n * [EARS-A2] Checks if a file exists via Contents API.\n * [EARS-B4] Returns false for 404 responses.\n */\n async exists(filePath: string): Promise<boolean> {\n const fullPath = this.buildFullPath(filePath);\n\n try {\n const { data } = await this.octokit.rest.repos.getContent({\n owner: this.owner,\n repo: this.repo,\n path: fullPath,\n ref: this.ref,\n });\n // [EARS-A2] Verify it's a file, not a directory\n if (Array.isArray(data) || data.type !== 'file') {\n return false;\n }\n return true;\n } catch (error: unknown) {\n if (isOctokitRequestError(error)) {\n if (error.status === 404) return false;\n if (error.status === 401 || error.status === 403) {\n throw new FileListerError(\n `Permission denied: ${filePath}`,\n 'PERMISSION_DENIED',\n filePath,\n );\n }\n if (error.status >= 500) {\n throw new FileListerError(\n `GitHub API server error (${error.status}): ${filePath}`,\n 'READ_ERROR',\n filePath,\n );\n }\n throw new FileListerError(\n `Unexpected GitHub API response (${error.status}): ${filePath}`,\n 'READ_ERROR',\n filePath,\n );\n }\n throw new FileListerError(\n `Network error checking file: ${filePath}`,\n 'NETWORK_ERROR',\n filePath,\n );\n }\n }\n\n /**\n * [EARS-A3] Reads file content as string.\n * [EARS-B2] Decodes base64 content from Contents API.\n * [EARS-B7] Falls back to Blobs API for files >1MB (null content).\n */\n async read(filePath: string): Promise<string> {\n const fullPath = this.buildFullPath(filePath);\n\n try {\n const { data } = await this.octokit.rest.repos.getContent({\n owner: this.owner,\n repo: this.repo,\n path: fullPath,\n ref: this.ref,\n });\n\n if (Array.isArray(data) || data.type !== 'file') {\n throw new FileListerError(\n `Not a file: ${filePath}`,\n 'READ_ERROR',\n filePath,\n );\n }\n\n // [EARS-B2] Decode base64 content\n if (data.content !== null && data.content !== undefined) {\n return Buffer.from(data.content, 'base64').toString('utf-8');\n }\n\n // [EARS-B7] Content is null (file >1MB), fallback to Blobs API\n return this.readViaBlobs(data.sha, filePath);\n } catch (error: unknown) {\n if (error instanceof FileListerError) throw error;\n if (isOctokitRequestError(error)) {\n if (error.status === 404) {\n throw new FileListerError(\n `File not found: ${filePath}`,\n 'FILE_NOT_FOUND',\n filePath,\n );\n }\n if (error.status === 401 || error.status === 403) {\n throw new FileListerError(\n `Permission denied: ${filePath}`,\n 'PERMISSION_DENIED',\n filePath,\n );\n }\n if (error.status >= 500) {\n throw new FileListerError(\n `GitHub API server error (${error.status}): ${filePath}`,\n 'READ_ERROR',\n filePath,\n );\n }\n throw new FileListerError(\n `Unexpected GitHub API response (${error.status}): ${filePath}`,\n 'READ_ERROR',\n filePath,\n );\n }\n throw new FileListerError(\n `Network error reading file: ${filePath}`,\n 'NETWORK_ERROR',\n filePath,\n );\n }\n }\n\n /**\n * [EARS-A4] Gets file statistics via Contents API.\n * Returns size from API, mtime as 0 (not available via Contents API), isFile as true.\n */\n async stat(filePath: string): Promise<FileStats> {\n const fullPath = this.buildFullPath(filePath);\n\n try {\n const { data } = await this.octokit.rest.repos.getContent({\n owner: this.owner,\n repo: this.repo,\n path: fullPath,\n ref: this.ref,\n });\n\n if (Array.isArray(data) || data.type !== 'file') {\n throw new FileListerError(\n `Not a file: ${filePath}`,\n 'READ_ERROR',\n filePath,\n );\n }\n\n return {\n size: data.size,\n mtime: 0,\n isFile: true,\n };\n } catch (error: unknown) {\n if (error instanceof FileListerError) throw error;\n if (isOctokitRequestError(error)) {\n if (error.status === 404) {\n throw new FileListerError(\n `File not found: ${filePath}`,\n 'FILE_NOT_FOUND',\n filePath,\n );\n }\n if (error.status === 401 || error.status === 403) {\n throw new FileListerError(\n `Permission denied: ${filePath}`,\n 'PERMISSION_DENIED',\n filePath,\n );\n }\n if (error.status >= 500) {\n throw new FileListerError(\n `GitHub API server error (${error.status}): ${filePath}`,\n 'READ_ERROR',\n filePath,\n );\n }\n throw new FileListerError(\n `Unexpected GitHub API response (${error.status}): ${filePath}`,\n 'READ_ERROR',\n filePath,\n );\n }\n throw new FileListerError(\n `Network error getting file stats: ${filePath}`,\n 'NETWORK_ERROR',\n filePath,\n );\n }\n }\n\n // ═══════════════════════════════════════════════════════════════════════\n // Private Helpers\n // ═══════════════════════════════════════════════════════════════════════\n\n /**\n * Builds the full file path including basePath prefix.\n */\n private buildFullPath(filePath: string): string {\n if (this.basePath) {\n return `${this.basePath}/${filePath}`;\n }\n return filePath;\n }\n\n /**\n * [EARS-B6] Fetches and caches the full repository tree.\n * [EARS-C3] Throws READ_ERROR if the tree response is truncated.\n */\n private async fetchTree(): Promise<TreeEntry[]> {\n if (this.treeCache !== null) {\n return this.treeCache;\n }\n\n try {\n const { data } = await this.octokit.rest.git.getTree({\n owner: this.owner,\n repo: this.repo,\n tree_sha: this.ref,\n recursive: '1',\n });\n\n // [EARS-C3] Truncated tree means we cannot reliably list all files\n if (data.truncated) {\n throw new FileListerError(\n 'Repository tree is truncated; too many files to list via Trees API',\n 'READ_ERROR',\n );\n }\n\n this.treeCache = data.tree;\n return this.treeCache;\n } catch (error: unknown) {\n if (error instanceof FileListerError) throw error;\n if (isOctokitRequestError(error)) {\n if (error.status === 404) {\n throw new FileListerError(\n 'Repository or ref not found',\n 'FILE_NOT_FOUND',\n );\n }\n if (error.status === 401 || error.status === 403) {\n throw new FileListerError(\n 'Permission denied accessing repository tree',\n 'PERMISSION_DENIED',\n );\n }\n if (error.status >= 500) {\n throw new FileListerError(\n `GitHub API server error (${error.status}) fetching tree`,\n 'READ_ERROR',\n );\n }\n throw new FileListerError(\n `Unexpected GitHub API response (${error.status}) fetching tree`,\n 'READ_ERROR',\n );\n }\n throw new FileListerError(\n 'Network error fetching repository tree',\n 'NETWORK_ERROR',\n );\n }\n }\n\n /**\n * [EARS-B7] Reads file content via the Blobs API (fallback for >1MB files).\n */\n private async readViaBlobs(sha: string, filePath: string): Promise<string> {\n try {\n const { data } = await this.octokit.rest.git.getBlob({\n owner: this.owner,\n repo: this.repo,\n file_sha: sha,\n });\n\n return Buffer.from(data.content, 'base64').toString('utf-8');\n } catch (error: unknown) {\n if (isOctokitRequestError(error)) {\n if (error.status === 404) {\n throw new FileListerError(\n `File not found: ${filePath}`,\n 'FILE_NOT_FOUND',\n filePath,\n );\n }\n if (error.status === 401 || error.status === 403) {\n throw new FileListerError(\n `Permission denied: ${filePath}`,\n 'PERMISSION_DENIED',\n filePath,\n );\n }\n throw new FileListerError(\n `GitHub API error (${error.status}): ${filePath}`,\n 'READ_ERROR',\n filePath,\n );\n }\n throw new FileListerError(\n `Network error reading blob for file: ${filePath}`,\n 'NETWORK_ERROR',\n filePath,\n );\n }\n }\n}\n","import type { Octokit } from '@octokit/rest';\nimport type { RecordStore, IdEncoder } from '../record_store';\nimport type { GitHubRecordStoreOptions, GitHubWriteResult, GitHubWriteOpts } from './github_record_store.types';\nimport type { IGitModule } from '../../git/index';\nimport { GitHubApiError, mapOctokitError, isOctokitRequestError } from '../../github';\n\n/**\n * GitHubRecordStore<V> - GitHub Contents API implementation of RecordStore<V, GitHubWriteResult, GitHubWriteOpts>\n *\n * Persists records as JSON files in a GitHub repository via Octokit.\n * Supports SHA caching to avoid redundant GET calls before PUT/DELETE.\n */\nexport class GitHubRecordStore<V> implements RecordStore<V, GitHubWriteResult, GitHubWriteOpts> {\n private readonly owner: string;\n private readonly repo: string;\n private readonly ref: string;\n private readonly basePath: string;\n private readonly extension: string;\n private readonly idEncoder: IdEncoder | undefined;\n private readonly octokit: Octokit;\n\n /** SHA cache keyed by full file path (basePath/encoded + extension) */\n private readonly shaCache: Map<string, string> = new Map();\n\n /** IGitModule dependency for putMany() atomic commits. Optional — only needed for putMany(). */\n private readonly gitModule: IGitModule | undefined;\n\n constructor(options: GitHubRecordStoreOptions, octokit: Octokit, gitModule?: IGitModule) {\n this.owner = options.owner;\n this.repo = options.repo;\n this.ref = options.ref ?? 'gitgov-state';\n this.basePath = options.basePath;\n this.extension = options.extension ?? '.json';\n this.idEncoder = options.idEncoder;\n this.octokit = octokit;\n this.gitModule = gitModule;\n }\n\n async get(id: string): Promise<V | null> {\n this.validateId(id);\n const filePath = this.buildFilePath(id);\n\n try {\n const { data } = await this.octokit.rest.repos.getContent({\n owner: this.owner,\n repo: this.repo,\n path: filePath,\n ref: this.ref,\n });\n\n if (Array.isArray(data) || data.type !== 'file') {\n throw new GitHubApiError(`Not a file: ${filePath}`, 'INVALID_RESPONSE');\n }\n\n if (data.content === null || data.content === undefined) {\n throw new GitHubApiError(\n `File content is null (file may exceed 1MB): ${filePath}`,\n 'INVALID_RESPONSE',\n );\n }\n\n // Cache the SHA for subsequent operations\n this.shaCache.set(filePath, data.sha);\n\n const decoded = Buffer.from(data.content, 'base64').toString('utf-8');\n return JSON.parse(decoded) as V;\n } catch (error: unknown) {\n if (error instanceof GitHubApiError) throw error;\n if (isOctokitRequestError(error) && error.status === 404) return null;\n throw mapOctokitError(error, `GET ${filePath}`);\n }\n }\n\n async put(id: string, value: V, opts?: GitHubWriteOpts): Promise<GitHubWriteResult> {\n this.validateId(id);\n const filePath = this.buildFilePath(id);\n const content = Buffer.from(JSON.stringify(value, null, 2)).toString('base64');\n\n const cachedSha = this.shaCache.get(filePath);\n\n try {\n const { data } = await this.octokit.rest.repos.createOrUpdateFileContents({\n owner: this.owner,\n repo: this.repo,\n path: filePath,\n message: opts?.commitMessage ?? `put ${id}`,\n content,\n branch: this.ref,\n ...(cachedSha ? { sha: cachedSha } : {}),\n });\n\n // Cache the new SHA from the response\n if (data.content?.sha) {\n this.shaCache.set(filePath, data.content.sha);\n }\n\n return { commitSha: data.commit.sha! };\n } catch (error: unknown) {\n throw mapOctokitError(error, `PUT ${filePath}`);\n }\n }\n\n /**\n * [EARS-A11, EARS-A12, EARS-B8] Persists multiple records in a single atomic commit.\n * Uses GitHubGitModule staging buffer: add() with contentMap, then commit().\n * Empty entries array returns { commitSha: undefined } without API calls.\n * Requires gitModule dependency — throws if not injected.\n */\n async putMany(entries: Array<{ id: string; value: V }>, opts?: GitHubWriteOpts): Promise<GitHubWriteResult> {\n if (entries.length === 0) {\n return {};\n }\n\n if (!this.gitModule) {\n throw new Error('putMany requires IGitModule dependency for atomic commits');\n }\n\n for (const { id } of entries) {\n this.validateId(id);\n }\n\n const contentMap: Record<string, string> = {};\n const filePaths: string[] = [];\n\n for (const { id, value } of entries) {\n const filePath = this.buildFilePath(id);\n contentMap[filePath] = JSON.stringify(value, null, 2);\n filePaths.push(filePath);\n }\n\n await this.gitModule.add(filePaths, { contentMap });\n\n const message = opts?.commitMessage ?? `putMany ${entries.length} records`;\n const commitSha = await this.gitModule.commit(message);\n\n return { commitSha };\n }\n\n async delete(id: string, opts?: GitHubWriteOpts): Promise<GitHubWriteResult> {\n this.validateId(id);\n const filePath = this.buildFilePath(id);\n\n let sha = this.shaCache.get(filePath);\n\n // If no cached SHA, do a GET to obtain it\n if (sha === undefined) {\n try {\n const { data } = await this.octokit.rest.repos.getContent({\n owner: this.owner,\n repo: this.repo,\n path: filePath,\n ref: this.ref,\n });\n\n if (Array.isArray(data) || data.type !== 'file') {\n return {};\n }\n\n sha = data.sha;\n } catch (error: unknown) {\n if (isOctokitRequestError(error) && error.status === 404) {\n return {};\n }\n throw mapOctokitError(error, `GET ${filePath} (for delete)`);\n }\n }\n\n try {\n const { data } = await this.octokit.rest.repos.deleteFile({\n owner: this.owner,\n repo: this.repo,\n path: filePath,\n message: opts?.commitMessage ?? `delete ${id}`,\n sha: sha!,\n branch: this.ref,\n });\n\n this.shaCache.delete(filePath);\n return { commitSha: data.commit.sha! };\n } catch (error: unknown) {\n if (isOctokitRequestError(error) && error.status === 404) {\n this.shaCache.delete(filePath);\n return {};\n }\n throw mapOctokitError(error, `DELETE ${filePath}`);\n }\n }\n\n async list(): Promise<string[]> {\n try {\n const { data } = await this.octokit.rest.repos.getContent({\n owner: this.owner,\n repo: this.repo,\n path: this.basePath,\n ref: this.ref,\n });\n\n if (!Array.isArray(data)) {\n return [];\n }\n\n const ids = data\n .filter((entry) => entry.name.endsWith(this.extension))\n .map((entry) => entry.name.slice(0, -this.extension.length));\n\n return this.idEncoder ? ids.map((encoded) => this.idEncoder!.decode(encoded)) : ids;\n } catch (error: unknown) {\n if (isOctokitRequestError(error) && error.status === 404) {\n return [];\n }\n throw mapOctokitError(error, `GET ${this.basePath} (list)`);\n }\n }\n\n async exists(id: string): Promise<boolean> {\n this.validateId(id);\n const filePath = this.buildFilePath(id);\n\n try {\n await this.octokit.rest.repos.getContent({\n owner: this.owner,\n repo: this.repo,\n path: filePath,\n ref: this.ref,\n });\n return true;\n } catch (error: unknown) {\n if (isOctokitRequestError(error) && error.status === 404) {\n return false;\n }\n throw mapOctokitError(error, `GET ${filePath} (exists)`);\n }\n }\n\n // ─────────────────────────────────────────────────────────\n // Private helpers\n // ─────────────────────────────────────────────────────────\n\n private validateId(id: string): void {\n if (!id || typeof id !== 'string') {\n throw new GitHubApiError('ID must be a non-empty string', 'INVALID_ID');\n }\n if (id.includes('..') || /[\\/\\\\]/.test(id)) {\n throw new GitHubApiError(\n `Invalid ID: \"${id}\". IDs cannot contain /, \\\\, or ..`,\n 'INVALID_ID',\n );\n }\n }\n\n private buildFilePath(id: string): string {\n const encoded = this.idEncoder ? this.idEncoder.encode(id) : id;\n return `${this.basePath}/${encoded}${this.extension}`;\n }\n}\n","/**\n * Custom Error Classes for GitModule\n * \n * These errors provide typed exceptions for better error handling\n * and diagnostics in the Git module operations.\n */\n\n/**\n * Base error class for all Git-related errors\n */\nexport class GitError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'GitError';\n Object.setPrototypeOf(this, GitError.prototype);\n }\n}\n\n/**\n * Error thrown when a Git command fails\n */\nexport class GitCommandError extends GitError {\n public readonly stderr: string;\n public readonly stdout?: string | undefined;\n public readonly command?: string | undefined;\n\n constructor(message: string, stderr: string = '', command?: string | undefined, stdout?: string) {\n super(message);\n this.name = 'GitCommandError';\n this.stderr = stderr;\n this.stdout = stdout;\n this.command = command;\n Object.setPrototypeOf(this, GitCommandError.prototype);\n }\n}\n\n/**\n * Error thrown when a branch does not exist\n */\nexport class BranchNotFoundError extends GitError {\n public readonly branchName: string;\n\n constructor(branchName: string) {\n super(`Branch not found: ${branchName}`);\n this.name = 'BranchNotFoundError';\n this.branchName = branchName;\n Object.setPrototypeOf(this, BranchNotFoundError.prototype);\n }\n}\n\n/**\n * Error thrown when a file does not exist in a commit\n */\nexport class FileNotFoundError extends GitError {\n public readonly filePath: string;\n public readonly commitHash: string;\n\n constructor(filePath: string, commitHash: string) {\n super(`File not found: ${filePath} in commit ${commitHash}`);\n this.name = 'FileNotFoundError';\n this.filePath = filePath;\n this.commitHash = commitHash;\n Object.setPrototypeOf(this, FileNotFoundError.prototype);\n }\n}\n\n/**\n * Error thrown when a merge conflict occurs\n */\nexport class MergeConflictError extends GitError {\n public readonly conflictedFiles: string[];\n\n constructor(conflictedFiles: string[]) {\n super(`Merge conflict detected in ${conflictedFiles.length} file(s)`);\n this.name = 'MergeConflictError';\n this.conflictedFiles = conflictedFiles;\n Object.setPrototypeOf(this, MergeConflictError.prototype);\n }\n}\n\n/**\n * Error thrown when a rebase conflict occurs\n */\nexport class RebaseConflictError extends GitError {\n public readonly conflictedFiles: string[];\n\n constructor(conflictedFiles: string[]) {\n super(`Rebase conflict detected in ${conflictedFiles.length} file(s)`);\n this.name = 'RebaseConflictError';\n this.conflictedFiles = conflictedFiles;\n Object.setPrototypeOf(this, RebaseConflictError.prototype);\n }\n}\n\n/**\n * Error thrown when trying to continue/abort a rebase that is not in progress\n */\nexport class RebaseNotInProgressError extends GitError {\n constructor() {\n super('No rebase in progress');\n this.name = 'RebaseNotInProgressError';\n Object.setPrototypeOf(this, RebaseNotInProgressError.prototype);\n }\n}\n\n/**\n * Error thrown when trying to create a branch that already exists\n */\nexport class BranchAlreadyExistsError extends GitError {\n public readonly branchName: string;\n\n constructor(branchName: string) {\n super(`Branch already exists: ${branchName}`);\n this.name = 'BranchAlreadyExistsError';\n this.branchName = branchName;\n Object.setPrototypeOf(this, BranchAlreadyExistsError.prototype);\n }\n}\n\n","/**\n * GitHubGitModule - GitHub REST API implementation of IGitModule\n *\n * Implements IGitModule for SaaS environments where direct filesystem\n * and git CLI are not available. Uses GitHub REST API via Octokit for all operations.\n *\n * Method categories:\n * - Category A (Implement): Real API calls — getFileContent, getCommitHash, etc.\n * - Category B (No-op): Return sensible defaults — push, fetch, stash, etc.\n * - Category C (Not Supported): Throw GitError — rebase, resetHard, etc.\n *\n * All EARS prefixes map to github_git_module.md\n *\n * @module git/github\n */\n\nimport type { Octokit } from '@octokit/rest';\nimport type { IGitModule } from '..';\nimport type {\n ExecOptions,\n ExecResult,\n GetCommitHistoryOptions,\n CommitInfo,\n ChangedFile,\n CommitAuthor,\n} from '../types';\nimport { isOctokitRequestError } from '../../github';\nimport type { GitHubGitModuleOptions } from './github_git_module.types';\nimport { GitError, FileNotFoundError, BranchNotFoundError, BranchAlreadyExistsError } from '../errors';\n\nexport class GitHubGitModule implements IGitModule {\n private readonly owner: string;\n private readonly repo: string;\n private readonly defaultBranch: string;\n private readonly octokit: Octokit;\n\n /** Staging buffer: path → content (null = delete) */\n private stagingBuffer: Map<string, string | null> = new Map();\n\n /** Active ref for operations (can be changed via checkoutBranch) */\n private activeRef: string;\n\n constructor(options: GitHubGitModuleOptions, octokit: Octokit) {\n this.owner = options.owner;\n this.repo = options.repo;\n this.defaultBranch = options.defaultBranch ?? 'gitgov-state';\n this.octokit = octokit;\n this.activeRef = this.defaultBranch;\n }\n\n // ═══════════════════════════════════════════════════════════════\n // PRIVATE HELPERS\n // ═══════════════════════════════════════════════════════════════\n\n /** Category C: Not supported via GitHub API */\n private notSupported(method: string): never {\n throw new GitError(\n `${method} is not supported via GitHub API`\n );\n }\n\n // ═══════════════════════════════════════════════════════════════\n // CATEGORY A: READ OPERATIONS (EARS-A1 to A6)\n // ═══════════════════════════════════════════════════════════════\n\n /**\n * [EARS-A1] Read file content via Contents API + base64 decode\n * [EARS-A2] Fallback to Blobs API for files >1MB\n */\n async getFileContent(commitHash: string, filePath: string): Promise<string> {\n try {\n const { data } = await this.octokit.rest.repos.getContent({\n owner: this.owner,\n repo: this.repo,\n path: filePath,\n ref: commitHash,\n });\n\n if (Array.isArray(data) || data.type !== 'file') {\n throw new GitError(`Not a file: ${filePath}`);\n }\n\n // [EARS-A1] Decode base64 content\n if (data.content !== null && data.content !== undefined) {\n return Buffer.from(data.content, 'base64').toString('utf-8');\n }\n\n // [EARS-A2] Content is null (file >1MB), fallback to Blobs API\n const { data: blobData } = await this.octokit.rest.git.getBlob({\n owner: this.owner,\n repo: this.repo,\n file_sha: data.sha,\n });\n\n return Buffer.from(blobData.content, 'base64').toString('utf-8');\n } catch (error: unknown) {\n if (error instanceof GitError) throw error;\n if (isOctokitRequestError(error)) {\n if (error.status === 404) {\n throw new FileNotFoundError(filePath, commitHash);\n }\n if (error.status === 401 || error.status === 403) {\n throw new GitError(`authentication/permission error (${error.status}): getFileContent ${filePath}`);\n }\n if (error.status >= 500) {\n throw new GitError(`GitHub server error (${error.status}): getFileContent ${filePath}`);\n }\n throw new GitError(`GitHub API error (${error.status}): getFileContent ${filePath}`);\n }\n const msg = error instanceof Error ? error.message : String(error);\n throw new GitError(`network error: ${msg}`);\n }\n }\n\n /**\n * [EARS-A3] Get commit SHA from branch via Refs API\n * [EARS-B4] Return SHA directly if already a 40-char hex\n */\n async getCommitHash(ref: string = this.activeRef): Promise<string> {\n // [EARS-B4] If ref is already a 40-char hex SHA, return directly\n if (/^[0-9a-f]{40}$/i.test(ref)) {\n return ref;\n }\n\n try {\n const { data } = await this.octokit.rest.git.getRef({\n owner: this.owner,\n repo: this.repo,\n ref: `heads/${ref}`,\n });\n return data.object.sha;\n } catch (error: unknown) {\n if (isOctokitRequestError(error)) {\n if (error.status === 404) {\n throw new BranchNotFoundError(ref);\n }\n if (error.status === 401 || error.status === 403) {\n throw new GitError(`authentication/permission error (${error.status}): getCommitHash ${ref}`);\n }\n if (error.status >= 500) {\n throw new GitError(`GitHub server error (${error.status}): getCommitHash ${ref}`);\n }\n }\n const msg = error instanceof Error ? error.message : String(error);\n throw new GitError(`network error: ${msg}`);\n }\n }\n\n /**\n * [EARS-A4] List changed files via Compare API\n */\n async getChangedFiles(\n fromCommit: string,\n toCommit: string,\n pathFilter: string\n ): Promise<ChangedFile[]> {\n try {\n const { data } = await this.octokit.rest.repos.compareCommits({\n owner: this.owner,\n repo: this.repo,\n base: fromCommit,\n head: toCommit,\n });\n\n const statusMap: Record<string, 'A' | 'M' | 'D'> = {\n added: 'A',\n modified: 'M',\n removed: 'D',\n renamed: 'M',\n };\n\n const files: ChangedFile[] = (data.files ?? [])\n .map(f => ({\n status: statusMap[f.status] ?? ('M' as const),\n file: f.filename,\n }))\n .filter(f => !pathFilter || f.file.startsWith(pathFilter));\n\n return files;\n } catch (error: unknown) {\n if (isOctokitRequestError(error)) {\n if (error.status === 401 || error.status === 403) {\n throw new GitError(`authentication/permission error (${error.status}): getChangedFiles ${fromCommit}...${toCommit}`);\n }\n if (error.status >= 500) {\n throw new GitError(`GitHub server error (${error.status}): getChangedFiles`);\n }\n throw new GitError(`Failed to compare ${fromCommit}...${toCommit}: HTTP ${error.status}`);\n }\n const msg = error instanceof Error ? error.message : String(error);\n throw new GitError(`network error: ${msg}`);\n }\n }\n\n /**\n * [EARS-A5] Get commit history via Commits API\n */\n async getCommitHistory(\n branch: string,\n options?: GetCommitHistoryOptions\n ): Promise<CommitInfo[]> {\n try {\n const { data } = await this.octokit.rest.repos.listCommits({\n owner: this.owner,\n repo: this.repo,\n sha: branch,\n ...(options?.maxCount !== undefined && { per_page: options.maxCount }),\n ...(options?.pathFilter !== undefined && { path: options.pathFilter }),\n });\n\n return data.map(c => ({\n hash: c.sha,\n message: c.commit.message,\n author: `${c.commit.author?.name ?? 'unknown'} <${c.commit.author?.email ?? 'unknown'}>`,\n date: c.commit.author?.date ?? '',\n }));\n } catch (error: unknown) {\n if (isOctokitRequestError(error)) {\n if (error.status === 401 || error.status === 403) {\n throw new GitError(`authentication/permission error (${error.status}): getCommitHistory ${branch}`);\n }\n if (error.status >= 500) {\n throw new GitError(`GitHub server error (${error.status}): getCommitHistory`);\n }\n throw new GitError(`Failed to get commit history: HTTP ${error.status}`);\n }\n const msg = error instanceof Error ? error.message : String(error);\n throw new GitError(`network error: ${msg}`);\n }\n }\n\n /**\n * [EARS-B3] Get commit history between two commits via Compare API\n */\n async getCommitHistoryRange(\n fromHash: string,\n toHash: string,\n options?: GetCommitHistoryOptions\n ): Promise<CommitInfo[]> {\n try {\n const { data } = await this.octokit.rest.repos.compareCommits({\n owner: this.owner,\n repo: this.repo,\n base: fromHash,\n head: toHash,\n });\n\n let commits: CommitInfo[] = data.commits.map(c => ({\n hash: c.sha,\n message: c.commit.message,\n author: `${c.commit.author?.name ?? 'unknown'} <${c.commit.author?.email ?? 'unknown'}>`,\n date: c.commit.author?.date ?? '',\n }));\n\n if (options?.pathFilter) {\n const changedPaths = new Set((data.files ?? []).map(f => f.filename));\n commits = commits.filter(() =>\n Array.from(changedPaths).some(f => f.startsWith(options.pathFilter!))\n );\n }\n\n if (options?.maxCount) {\n commits = commits.slice(0, options.maxCount);\n }\n\n return commits;\n } catch (error: unknown) {\n if (isOctokitRequestError(error)) {\n if (error.status === 401 || error.status === 403) {\n throw new GitError(`authentication/permission error (${error.status}): getCommitHistoryRange ${fromHash}...${toHash}`);\n }\n if (error.status >= 500) {\n throw new GitError(`GitHub server error (${error.status}): getCommitHistoryRange`);\n }\n throw new GitError(`Failed to get commit range: HTTP ${error.status}`);\n }\n const msg = error instanceof Error ? error.message : String(error);\n throw new GitError(`network error: ${msg}`);\n }\n }\n\n /**\n * [EARS-A6] Get commit message via Commits API\n */\n async getCommitMessage(commitHash: string): Promise<string> {\n try {\n const { data } = await this.octokit.rest.repos.getCommit({\n owner: this.owner,\n repo: this.repo,\n ref: commitHash,\n });\n return data.commit.message;\n } catch (error: unknown) {\n if (isOctokitRequestError(error)) {\n if (error.status === 404) {\n throw new GitError(`Commit not found: ${commitHash}`);\n }\n if (error.status === 401 || error.status === 403) {\n throw new GitError(`authentication/permission error (${error.status}): getCommitMessage ${commitHash}`);\n }\n if (error.status >= 500) {\n throw new GitError(`GitHub server error (${error.status}): getCommitMessage`);\n }\n }\n const msg = error instanceof Error ? error.message : String(error);\n throw new GitError(`network error: ${msg}`);\n }\n }\n\n // ═══════════════════════════════════════════════════════════════\n // CATEGORY A: BRANCH OPERATIONS (EARS-B1 to B2)\n // ═══════════════════════════════════════════════════════════════\n\n /**\n * [EARS-B1] Check if branch exists via Branches API\n */\n async branchExists(branchName: string): Promise<boolean> {\n try {\n await this.octokit.rest.repos.getBranch({\n owner: this.owner,\n repo: this.repo,\n branch: branchName,\n });\n return true;\n } catch (error: unknown) {\n if (isOctokitRequestError(error)) {\n if (error.status === 404) return false;\n if (error.status === 401 || error.status === 403) {\n throw new GitError(`authentication/permission error (${error.status}): branchExists ${branchName}`);\n }\n throw new GitError(`Failed to check branch: HTTP ${error.status}`);\n }\n const msg = error instanceof Error ? error.message : String(error);\n throw new GitError(`network error: ${msg}`);\n }\n }\n\n /**\n * [EARS-B2] List remote branches via Branches API\n * remoteName is ignored — repo itself is the implicit remote\n */\n async listRemoteBranches(_remoteName: string): Promise<string[]> {\n try {\n const { data } = await this.octokit.rest.repos.listBranches({\n owner: this.owner,\n repo: this.repo,\n });\n return data.map(b => b.name);\n } catch (error: unknown) {\n if (isOctokitRequestError(error)) {\n if (error.status === 401 || error.status === 403) {\n throw new GitError(`authentication/permission error (${error.status}): listRemoteBranches`);\n }\n if (error.status >= 500) {\n throw new GitError(`GitHub server error (${error.status}): listRemoteBranches`);\n }\n throw new GitError(`Failed to list branches: HTTP ${error.status}`);\n }\n const msg = error instanceof Error ? error.message : String(error);\n throw new GitError(`network error: ${msg}`);\n }\n }\n\n // ═══════════════════════════════════════════════════════════════\n // CATEGORY A: WRITE OPERATIONS (EARS-C1 to C7)\n // ═══════════════════════════════════════════════════════════════\n\n /** [EARS-C1] Read file content and store in staging buffer */\n async add(filePaths: string[], options?: { force?: boolean; contentMap?: Record<string, string> }): Promise<void> {\n for (const filePath of filePaths) {\n const content = options?.contentMap?.[filePath]\n ?? await this.getFileContent(this.activeRef, filePath);\n this.stagingBuffer.set(filePath, content);\n }\n }\n\n /** [EARS-C2] Mark files as deleted in staging buffer */\n async rm(filePaths: string[]): Promise<void> {\n for (const filePath of filePaths) {\n this.stagingBuffer.set(filePath, null);\n }\n }\n\n /** [EARS-C7] Return staged file paths from buffer */\n async getStagedFiles(): Promise<string[]> {\n return Array.from(this.stagingBuffer.keys());\n }\n\n /**\n * [EARS-C6] Create branch via Refs API POST\n */\n async createBranch(branchName: string, startPoint?: string): Promise<void> {\n // Resolve startPoint to SHA\n const sha = startPoint\n ? await this.getCommitHash(startPoint)\n : await this.getCommitHash(this.activeRef);\n\n try {\n await this.octokit.rest.git.createRef({\n owner: this.owner,\n repo: this.repo,\n ref: `refs/heads/${branchName}`,\n sha,\n });\n } catch (error: unknown) {\n if (isOctokitRequestError(error)) {\n if (error.status === 422) {\n throw new BranchAlreadyExistsError(branchName);\n }\n if (error.status === 401 || error.status === 403) {\n throw new GitError(`authentication/permission error (${error.status}): createBranch ${branchName}`);\n }\n throw new GitError(`Failed to create branch ${branchName}: HTTP ${error.status}`);\n }\n const msg = error instanceof Error ? error.message : String(error);\n throw new GitError(`network error: ${msg}`);\n }\n }\n\n /**\n * Internal commit implementation shared by commit() and commitAllowEmpty().\n *\n * [EARS-C3] 6-step atomic transaction\n * [EARS-C4] Clears staging buffer after successful commit\n * [EARS-C5] Throws if staging buffer is empty (unless allowEmpty)\n */\n private async commitInternal(message: string, author?: CommitAuthor, allowEmpty = false): Promise<string> {\n // [EARS-C5] Empty buffer check (skipped for commitAllowEmpty)\n if (!allowEmpty && this.stagingBuffer.size === 0) {\n throw new GitError('Nothing to commit: staging buffer is empty');\n }\n\n try {\n // Step 1: GET current ref SHA\n const { data: refData } = await this.octokit.rest.git.getRef({\n owner: this.owner,\n repo: this.repo,\n ref: `heads/${this.activeRef}`,\n });\n const currentSha = refData.object.sha;\n\n // Step 2: GET commit to obtain tree SHA\n const { data: commitData } = await this.octokit.rest.git.getCommit({\n owner: this.owner,\n repo: this.repo,\n commit_sha: currentSha,\n });\n const treeSha = commitData.tree.sha;\n\n // Step 3: POST blobs for each staged file (adds/updates only, not deletes)\n const treeEntries: Array<{\n path: string;\n mode: '100644';\n type: 'blob';\n sha: string | null;\n }> = [];\n\n for (const [path, content] of this.stagingBuffer) {\n if (content === null) {\n // Delete entry\n treeEntries.push({\n path,\n mode: '100644',\n type: 'blob',\n sha: null,\n });\n } else {\n // Create blob\n const { data: blobData } = await this.octokit.rest.git.createBlob({\n owner: this.owner,\n repo: this.repo,\n content: Buffer.from(content).toString('base64'),\n encoding: 'base64',\n });\n\n treeEntries.push({\n path,\n mode: '100644',\n type: 'blob',\n sha: blobData.sha,\n });\n }\n }\n\n // Step 4: POST new tree\n const { data: treeData } = await this.octokit.rest.git.createTree({\n owner: this.owner,\n repo: this.repo,\n base_tree: treeSha,\n tree: treeEntries,\n });\n const newTreeSha = treeData.sha;\n\n // Step 5: POST new commit\n const commitParams: {\n owner: string;\n repo: string;\n message: string;\n tree: string;\n parents: string[];\n author?: { name: string; email: string; date: string };\n } = {\n owner: this.owner,\n repo: this.repo,\n message,\n tree: newTreeSha,\n parents: [currentSha],\n };\n\n if (author) {\n commitParams.author = {\n name: author.name,\n email: author.email,\n date: new Date().toISOString(),\n };\n }\n\n const { data: newCommitData } = await this.octokit.rest.git.createCommit(commitParams);\n const newCommitSha = newCommitData.sha;\n\n // Step 6: PATCH ref to point to new commit\n try {\n await this.octokit.rest.git.updateRef({\n owner: this.owner,\n repo: this.repo,\n ref: `heads/${this.activeRef}`,\n sha: newCommitSha,\n });\n } catch (error: unknown) {\n if (isOctokitRequestError(error) && error.status === 422) {\n throw new GitError('non-fast-forward update rejected');\n }\n throw error;\n }\n\n // [EARS-C4] Clear staging buffer after successful commit\n this.stagingBuffer.clear();\n\n return newCommitSha;\n } catch (error: unknown) {\n if (error instanceof GitError) throw error;\n if (isOctokitRequestError(error)) {\n if (error.status === 401 || error.status === 403) {\n throw new GitError(`authentication/permission error (${error.status}): commit`);\n }\n if (error.status >= 500) {\n throw new GitError(`GitHub server error (${error.status}): commit`);\n }\n throw new GitError(`GitHub API error (${error.status}): commit`);\n }\n const msg = error instanceof Error ? error.message : String(error);\n throw new GitError(`network error: ${msg}`);\n }\n }\n\n /**\n * [EARS-C3] Commit staged changes via 6-step atomic transaction\n * [EARS-C5] Throws if staging buffer is empty\n */\n async commit(message: string, author?: CommitAuthor): Promise<string> {\n return this.commitInternal(message, author, false);\n }\n\n // ═══════════════════════════════════════════════════════════════\n // CATEGORY B: NO-OPS (sensible defaults)\n // ═══════════════════════════════════════════════════════════════\n\n /** [EARS-D5] exec not supported in API mode */\n async exec(\n _command: string,\n _args: string[],\n _options?: ExecOptions\n ): Promise<ExecResult> {\n return { exitCode: 1, stdout: '', stderr: 'exec() not supported in GitHub API mode' };\n }\n\n /** No-op: repos are created via GitHub API, not initialized locally */\n async init(): Promise<void> {\n // No-op\n }\n\n /** [EARS-D1] Return virtual path representing the repo */\n async getRepoRoot(): Promise<string> {\n return `github://${this.owner}/${this.repo}`;\n }\n\n /** [EARS-D1] Return active ref (starts as defaultBranch) */\n async getCurrentBranch(): Promise<string> {\n return this.activeRef;\n }\n\n /** No-op: git config doesn't apply to GitHub API */\n async setConfig(\n _key: string,\n _value: string,\n _scope?: 'local' | 'global' | 'system'\n ): Promise<void> {\n // No-op\n }\n\n /** [EARS-D1] Return true if staging buffer has entries */\n async hasUncommittedChanges(_pathFilter?: string): Promise<boolean> {\n return this.stagingBuffer.size > 0;\n }\n\n /** No-op: GitHub API doesn't have rebase-in-progress concept */\n async isRebaseInProgress(): Promise<boolean> {\n return false;\n }\n\n /** [EARS-D1] GitHub repos always have 'origin' conceptually */\n async isRemoteConfigured(_remoteName: string): Promise<boolean> {\n return true;\n }\n\n /** No-op: always 'origin' */\n async getBranchRemote(_branchName: string): Promise<string | null> {\n return 'origin';\n }\n\n /** No-op: GitHub API handles merges atomically */\n async getConflictedFiles(): Promise<string[]> {\n return [];\n }\n\n /** [EARS-D2] Update activeRef for subsequent operations */\n async checkoutBranch(branchName: string): Promise<void> {\n this.activeRef = branchName;\n }\n\n /** No-op: GitHub API doesn't have stash concept */\n async stash(_message?: string): Promise<string | null> {\n return null;\n }\n\n /** No-op */\n async stashPop(): Promise<boolean> {\n return false;\n }\n\n /** No-op */\n async stashDrop(_stashHash?: string): Promise<void> {\n // No-op\n }\n\n /** No-op: API always fresh */\n async fetch(_remote: string): Promise<void> {\n // No-op\n }\n\n /** No-op: API mode */\n async pull(_remote: string, _branchName: string): Promise<void> {\n // No-op\n }\n\n /** No-op: API mode */\n async pullRebase(_remote: string, _branchName: string): Promise<void> {\n // No-op\n }\n\n /** [EARS-D4] No-op: commits via API are already remote */\n async push(_remote: string, _branchName: string): Promise<void> {\n // No-op\n }\n\n /** [EARS-D4] No-op: commits via API are already remote */\n async pushWithUpstream(_remote: string, _branchName: string): Promise<void> {\n // No-op\n }\n\n /** No-op: API mode */\n async setUpstream(\n _branchName: string,\n _remote: string,\n _remoteBranch: string\n ): Promise<void> {\n // No-op\n }\n\n /** No-op */\n async rebaseAbort(): Promise<void> {\n // No-op\n }\n\n /** [EARS-D1] Delegates to commitInternal, allowing empty staging buffer */\n async commitAllowEmpty(message: string, author?: CommitAuthor): Promise<string> {\n return this.commitInternal(message, author, true);\n }\n\n // ═══════════════════════════════════════════════════════════════\n // CATEGORY C: NOT SUPPORTED (throw GitError)\n // ═══════════════════════════════════════════════════════════════\n\n /** [EARS-D3] Not supported via GitHub API */\n async rebase(_targetBranch: string): Promise<void> {\n this.notSupported('rebase');\n }\n\n /** [EARS-D3] Not supported via GitHub API */\n async rebaseContinue(): Promise<string> {\n this.notSupported('rebaseContinue');\n }\n\n /** [EARS-D3] Not supported via GitHub API */\n async resetHard(_target: string): Promise<void> {\n this.notSupported('resetHard');\n }\n\n /** [EARS-D3] Not supported via GitHub API */\n async checkoutOrphanBranch(_branchName: string): Promise<void> {\n this.notSupported('checkoutOrphanBranch');\n }\n\n /** [EARS-D3] Not supported via GitHub API */\n async checkoutFilesFromBranch(\n _sourceBranch: string,\n _filePaths: string[]\n ): Promise<void> {\n this.notSupported('checkoutFilesFromBranch');\n }\n\n /** [EARS-D3] Not supported via GitHub API */\n async getMergeBase(_branchA: string, _branchB: string): Promise<string> {\n this.notSupported('getMergeBase');\n }\n}\n","/**\n * GitHubConfigStore - GitHub Contents API implementation of ConfigStore\n *\n * Persists config.json to a GitHub repository via Octokit.\n * Used by SaaS/server-side environments where the project lives on GitHub\n * and direct filesystem access is not available.\n *\n * Key behaviors:\n * - loadConfig: GET contents, base64 decode, JSON parse. Fail-safe on 404/invalid JSON.\n * - saveConfig: JSON serialize + base64 encode, PUT contents with optional SHA for updates.\n * - Caches blob SHA from loadConfig for subsequent saveConfig (optimistic concurrency).\n */\n\nimport type { Octokit } from '@octokit/rest';\nimport type { ConfigStore } from '../config_store';\nimport type { GitGovConfig } from '../../config_manager/config_manager.types';\nimport type { GitHubConfigStoreOptions, GitHubSaveResult } from './github_config_store.types';\nimport { mapOctokitError, isOctokitRequestError } from '../../github';\n\nexport class GitHubConfigStore implements ConfigStore<GitHubSaveResult> {\n private readonly owner: string;\n private readonly repo: string;\n private readonly ref: string;\n private readonly basePath: string;\n private readonly octokit: Octokit;\n\n /** Cached blob SHA from the last loadConfig call, used for PUT updates */\n private cachedSha: string | null = null;\n\n constructor(options: GitHubConfigStoreOptions, octokit: Octokit) {\n this.owner = options.owner;\n this.repo = options.repo;\n this.ref = options.ref ?? 'gitgov-state';\n this.basePath = options.basePath ?? '.gitgov';\n this.octokit = octokit;\n }\n\n /**\n * Load project configuration from GitHub Contents API.\n *\n * [EARS-A1] Returns GitGovConfig when valid JSON is found.\n * [EARS-A2] Returns null on 404 (fail-safe).\n * [EARS-A3] Returns null on invalid JSON (fail-safe).\n * [EARS-B1] Fetches via Contents API with base64 decode.\n * [EARS-B2] Caches SHA from response for subsequent saveConfig.\n */\n async loadConfig(): Promise<GitGovConfig | null> {\n const path = `${this.basePath}/config.json`;\n\n try {\n const { data } = await this.octokit.rest.repos.getContent({\n owner: this.owner,\n repo: this.repo,\n path,\n ref: this.ref,\n });\n\n // getContent can return array (directory) — we expect a file\n if (Array.isArray(data) || data.type !== 'file') {\n return null;\n }\n\n // Decode base64 content\n if (!data.content) {\n return null;\n }\n\n // Cache SHA for subsequent saveConfig (only when content is present)\n this.cachedSha = data.sha;\n\n try {\n const decoded = Buffer.from(data.content, 'base64').toString('utf-8');\n return JSON.parse(decoded) as GitGovConfig;\n } catch {\n // Invalid JSON - fail-safe\n return null;\n }\n } catch (error: unknown) {\n if (isOctokitRequestError(error) && error.status === 404) {\n return null;\n }\n throw mapOctokitError(error, `loadConfig ${this.owner}/${this.repo}/${path}`);\n }\n }\n\n /**\n * Save project configuration to GitHub via Contents API PUT.\n *\n * [EARS-A4] Writes config via PUT to Contents API.\n * [EARS-B3] Includes cached SHA for updates (optimistic concurrency).\n * [EARS-B4] Omits SHA for initial creation.\n * [EARS-C1] Throws PERMISSION_DENIED on 401/403.\n * [EARS-C2] Throws CONFLICT on 409.\n * [EARS-C3] Throws SERVER_ERROR on 5xx.\n */\n async saveConfig(config: GitGovConfig): Promise<GitHubSaveResult> {\n const path = `${this.basePath}/config.json`;\n const content = Buffer.from(JSON.stringify(config, null, 2)).toString('base64');\n\n try {\n const { data } = await this.octokit.rest.repos.createOrUpdateFileContents({\n owner: this.owner,\n repo: this.repo,\n path,\n message: 'chore(config): update gitgov config.json',\n content,\n branch: this.ref,\n ...(this.cachedSha ? { sha: this.cachedSha } : {}),\n });\n\n // Update cached SHA for subsequent saves\n if (data.content?.sha) {\n this.cachedSha = data.content.sha;\n }\n\n return { commitSha: data.commit.sha! };\n } catch (error: unknown) {\n throw mapOctokitError(error, `saveConfig ${this.owner}/${this.repo}/${path}`);\n }\n }\n}\n","/**\n * GitHub API implementations for @gitgov/core/github\n *\n * This module exports all implementations that use GitHub REST API.\n * Suitable for SaaS environments, Forge apps, GitHub Actions,\n * and any context without local filesystem access.\n *\n * Usage:\n * import { GitHubFileLister, GitHubRecordStore, GitHubGitModule, GitHubConfigStore } from '@gitgov/core/github';\n *\n * Each implementation receives an `Octokit` instance for testability and shared auth/base-URL config.\n */\n\n// ==================== Re-exports: Octokit (types only) ====================\n\nexport type { Octokit, RestEndpointMethodTypes } from '@octokit/rest';\n\n// ==================== Shared Types ====================\n\n/**\n * Error codes for GitHub API errors.\n * Semantic codes that abstract HTTP status codes.\n */\nexport type GitHubApiErrorCode =\n | 'PERMISSION_DENIED'\n | 'NOT_FOUND'\n | 'CONFLICT'\n | 'SERVER_ERROR'\n | 'NETWORK_ERROR'\n | 'INVALID_ID'\n | 'INVALID_RESPONSE';\n\n/**\n * Typed error for GitHub API operations.\n * Used by RecordStore, ConfigStore, and other modules that\n * interact with GitHub Contents API directly.\n */\nexport class GitHubApiError extends Error {\n constructor(\n message: string,\n /** Semantic error code */\n public readonly code: GitHubApiErrorCode,\n /** HTTP status code (if applicable) */\n public readonly statusCode?: number,\n ) {\n super(message);\n this.name = 'GitHubApiError';\n Object.setPrototypeOf(this, GitHubApiError.prototype);\n }\n}\n\n/**\n * Type guard: checks if an error is an Octokit RequestError (duck-typing).\n * Avoids runtime import of ESM-only @octokit/request-error.\n */\nexport function isOctokitRequestError(error: unknown): error is { status: number; message: string } {\n return (\n error instanceof Error &&\n typeof (error as unknown as Record<string, unknown>)['status'] === 'number'\n );\n}\n\n/**\n * Maps Octokit RequestError (and unknown errors) to GitHubApiError.\n * Shared utility used by all GitHub backend modules.\n */\nexport function mapOctokitError(error: unknown, context: string): GitHubApiError {\n if (isOctokitRequestError(error)) {\n const status = error.status;\n\n if (status === 401 || status === 403) {\n return new GitHubApiError(\n `Permission denied: ${context}`,\n 'PERMISSION_DENIED',\n status,\n );\n }\n if (status === 404) {\n return new GitHubApiError(\n `Not found: ${context}`,\n 'NOT_FOUND',\n status,\n );\n }\n if (status === 409) {\n return new GitHubApiError(\n `Conflict: ${context}`,\n 'CONFLICT',\n status,\n );\n }\n if (status === 422) {\n return new GitHubApiError(\n `Validation failed: ${context}`,\n 'CONFLICT',\n status,\n );\n }\n if (status >= 500) {\n return new GitHubApiError(\n `Server error (${status}): ${context}`,\n 'SERVER_ERROR',\n status,\n );\n }\n\n return new GitHubApiError(\n `GitHub API error (${status}): ${context}`,\n 'SERVER_ERROR',\n status,\n );\n }\n\n // Network / unknown errors\n const message = error instanceof Error ? error.message : String(error);\n return new GitHubApiError(`Network error: ${message}`, 'NETWORK_ERROR');\n}\n\n// ==================== Module Exports ====================\n\n// FileLister\nexport { GitHubFileLister } from './file_lister/github';\nexport type {\n GitHubFileListerOptions,\n} from './file_lister/github';\n\n// RecordStore\nexport { GitHubRecordStore } from './record_store/github';\nexport type {\n GitHubRecordStoreOptions,\n GitHubWriteResult,\n GitHubWriteOpts,\n} from './record_store/github';\n\n// GitModule\nexport { GitHubGitModule } from './git/github';\nexport type { GitHubGitModuleOptions } from './git/github';\n\n// ConfigStore\nexport { GitHubConfigStore } from './config_store/github';\nexport type {\n GitHubConfigStoreOptions,\n GitHubSaveResult,\n} from './config_store/github';\n"]}
|
|
@@ -1,26 +1,54 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* IdEncoder for transforming IDs to storage-safe filenames.
|
|
3
|
+
* Useful for characters not allowed in filesystem (e.g., `:` on Windows)
|
|
4
|
+
* or URL-unsafe characters in remote backends.
|
|
5
|
+
*/
|
|
6
|
+
interface IdEncoder {
|
|
7
|
+
/** Transform ID to storage-safe string */
|
|
8
|
+
encode: (id: string) => string;
|
|
9
|
+
/** Recover original ID from encoded string */
|
|
10
|
+
decode: (encoded: string) => string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Default encoder: `:` → `_` (for IDs like "human:camilo")
|
|
14
|
+
* Reversible because IDs cannot contain `_` (see id_generator.ts)
|
|
15
|
+
*/
|
|
16
|
+
declare const DEFAULT_ID_ENCODER: IdEncoder;
|
|
17
|
+
/**
|
|
18
|
+
* RecordStore<V, R, O> - Generic interface for record persistence
|
|
3
19
|
*
|
|
4
20
|
* Abstracts CRUD operations without assuming storage backend.
|
|
5
21
|
* Each implementation decides how to persist (fs, memory, db, remote).
|
|
22
|
+
*
|
|
23
|
+
* @typeParam V - Value type (the record being stored)
|
|
24
|
+
* @typeParam R - Return type for write operations (default: void for local, GitHubWriteResult for GitHub)
|
|
25
|
+
* @typeParam O - Options type for write operations (default: void for local, GitHubWriteOpts for GitHub)
|
|
6
26
|
*/
|
|
7
|
-
interface RecordStore<
|
|
27
|
+
interface RecordStore<V, R = void, O = void> {
|
|
8
28
|
/**
|
|
9
29
|
* Gets a record by ID
|
|
10
30
|
* @returns The record or null if it doesn't exist
|
|
11
31
|
*/
|
|
12
|
-
get(id: string): Promise<
|
|
32
|
+
get(id: string): Promise<V | null>;
|
|
13
33
|
/**
|
|
14
34
|
* Persists a record
|
|
15
35
|
* @param id - Unique identifier
|
|
16
36
|
* @param value - The record to persist
|
|
17
37
|
*/
|
|
18
|
-
put(id: string, value:
|
|
38
|
+
put(id: string, value: V, ...opts: O extends void ? [] : [opts?: O]): Promise<R>;
|
|
39
|
+
/**
|
|
40
|
+
* Persists multiple records in a single operation.
|
|
41
|
+
* Local backends iterate sequentially; GitHub backend uses atomic commits.
|
|
42
|
+
*/
|
|
43
|
+
putMany(entries: Array<{
|
|
44
|
+
id: string;
|
|
45
|
+
value: V;
|
|
46
|
+
}>, ...opts: O extends void ? [] : [opts?: O]): Promise<R>;
|
|
19
47
|
/**
|
|
20
48
|
* Deletes a record
|
|
21
49
|
* @param id - Identifier of the record to delete
|
|
22
50
|
*/
|
|
23
|
-
delete(id: string): Promise<
|
|
51
|
+
delete(id: string, ...opts: O extends void ? [] : [opts?: O]): Promise<R>;
|
|
24
52
|
/**
|
|
25
53
|
* Lists all record IDs
|
|
26
54
|
* @returns Array of IDs
|
|
@@ -160,164 +188,6 @@ interface IConfigManager {
|
|
|
160
188
|
getStateBranch(): Promise<string>;
|
|
161
189
|
}
|
|
162
190
|
|
|
163
|
-
/**
|
|
164
|
-
* SessionManager Types
|
|
165
|
-
*/
|
|
166
|
-
/**
|
|
167
|
-
* Sync status for an actor's synchronization state.
|
|
168
|
-
*/
|
|
169
|
-
type SyncStatus = {
|
|
170
|
-
lastSyncPush?: string;
|
|
171
|
-
lastSyncPull?: string;
|
|
172
|
-
status?: 'synced' | 'pending' | 'pulling' | 'pushing' | 'conflict';
|
|
173
|
-
lastError?: string;
|
|
174
|
-
};
|
|
175
|
-
/**
|
|
176
|
-
* State for a specific actor on this machine.
|
|
177
|
-
*/
|
|
178
|
-
type ActorState = {
|
|
179
|
-
activeTaskId?: string | undefined;
|
|
180
|
-
activeCycleId?: string | undefined;
|
|
181
|
-
lastSync?: string;
|
|
182
|
-
syncStatus?: SyncStatus;
|
|
183
|
-
[key: string]: unknown;
|
|
184
|
-
};
|
|
185
|
-
/**
|
|
186
|
-
* GitGovernance Session State
|
|
187
|
-
* Based on session_state.md blueprint
|
|
188
|
-
*/
|
|
189
|
-
type GitGovSession = {
|
|
190
|
-
cloud?: {
|
|
191
|
-
sessionToken?: string;
|
|
192
|
-
};
|
|
193
|
-
lastSession?: {
|
|
194
|
-
actorId: string;
|
|
195
|
-
timestamp: string;
|
|
196
|
-
};
|
|
197
|
-
actorState?: Record<string, ActorState>;
|
|
198
|
-
syncPreferences?: {
|
|
199
|
-
pullScheduler?: {
|
|
200
|
-
enabled?: boolean;
|
|
201
|
-
pullIntervalSeconds?: number;
|
|
202
|
-
continueOnNetworkError?: boolean;
|
|
203
|
-
stopOnConflict?: boolean;
|
|
204
|
-
};
|
|
205
|
-
fileWatcher?: {
|
|
206
|
-
enabled?: boolean;
|
|
207
|
-
debounceMs?: number;
|
|
208
|
-
ignoredPatterns?: string[];
|
|
209
|
-
};
|
|
210
|
-
};
|
|
211
|
-
};
|
|
212
|
-
/**
|
|
213
|
-
* Sync preferences update payload
|
|
214
|
-
*/
|
|
215
|
-
type SyncPreferencesUpdate = {
|
|
216
|
-
pullScheduler?: Partial<{
|
|
217
|
-
enabled: boolean;
|
|
218
|
-
pullIntervalSeconds: number;
|
|
219
|
-
continueOnNetworkError: boolean;
|
|
220
|
-
stopOnConflict: boolean;
|
|
221
|
-
}>;
|
|
222
|
-
fileWatcher?: Partial<{
|
|
223
|
-
enabled: boolean;
|
|
224
|
-
debounceMs: number;
|
|
225
|
-
ignoredPatterns: string[];
|
|
226
|
-
}>;
|
|
227
|
-
};
|
|
228
|
-
/**
|
|
229
|
-
* ISessionManager interface
|
|
230
|
-
*
|
|
231
|
-
* Provides typed access to GitGovernance session state.
|
|
232
|
-
* Session state is ephemeral, machine-local, and NOT versioned in Git.
|
|
233
|
-
*/
|
|
234
|
-
interface ISessionManager {
|
|
235
|
-
/**
|
|
236
|
-
* Load GitGovernance session state
|
|
237
|
-
* [EARS-B9] Auto-detects actor from .key files if no session or no actorId exists
|
|
238
|
-
*/
|
|
239
|
-
loadSession(): Promise<GitGovSession | null>;
|
|
240
|
-
/**
|
|
241
|
-
* [EARS-B9] Detect actor from .key files in .gitgov/actors/
|
|
242
|
-
*/
|
|
243
|
-
detectActorFromKeyFiles(): Promise<string | null>;
|
|
244
|
-
/**
|
|
245
|
-
* Get actor state for a specific actor
|
|
246
|
-
*/
|
|
247
|
-
getActorState(actorId: string): Promise<ActorState | null>;
|
|
248
|
-
/**
|
|
249
|
-
* Update actor state for a specific actor
|
|
250
|
-
*/
|
|
251
|
-
updateActorState(actorId: string, state: Partial<ActorState>): Promise<void>;
|
|
252
|
-
/**
|
|
253
|
-
* Get cloud session token
|
|
254
|
-
*/
|
|
255
|
-
getCloudSessionToken(): Promise<string | null>;
|
|
256
|
-
/**
|
|
257
|
-
* Get sync preferences from session
|
|
258
|
-
*/
|
|
259
|
-
getSyncPreferences(): Promise<GitGovSession['syncPreferences'] | null>;
|
|
260
|
-
/**
|
|
261
|
-
* Update sync preferences in .session.json
|
|
262
|
-
* These are local machine preferences that override project defaults
|
|
263
|
-
*/
|
|
264
|
-
updateSyncPreferences(preferences: SyncPreferencesUpdate): Promise<void>;
|
|
265
|
-
/**
|
|
266
|
-
* Get last session info (last human who interacted)
|
|
267
|
-
*/
|
|
268
|
-
getLastSession(): Promise<{
|
|
269
|
-
actorId: string;
|
|
270
|
-
timestamp: string;
|
|
271
|
-
} | null>;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
/**
|
|
275
|
-
* SessionStore - Session persistence abstraction
|
|
276
|
-
*
|
|
277
|
-
* Interface for storing and retrieving local session state (.session.json).
|
|
278
|
-
* Session state is ephemeral, machine-local, and NOT versioned in Git.
|
|
279
|
-
*
|
|
280
|
-
* Implementations:
|
|
281
|
-
* - FsSessionStore: Filesystem-based (production)
|
|
282
|
-
* - MemorySessionStore: In-memory (tests, serverless)
|
|
283
|
-
*/
|
|
284
|
-
|
|
285
|
-
/**
|
|
286
|
-
* Interface for session state persistence.
|
|
287
|
-
*
|
|
288
|
-
* Session state includes:
|
|
289
|
-
* - Actor state (activeTaskId, activeCycleId, syncStatus)
|
|
290
|
-
* - Sync preferences (pullScheduler, fileWatcher settings)
|
|
291
|
-
* - Cloud session tokens
|
|
292
|
-
* - Last session information
|
|
293
|
-
*
|
|
294
|
-
* Unlike ConfigStore, SessionStore handles ephemeral, machine-local state
|
|
295
|
-
* that is NOT shared between collaborators.
|
|
296
|
-
*/
|
|
297
|
-
interface SessionStore {
|
|
298
|
-
/**
|
|
299
|
-
* Load session state from storage.
|
|
300
|
-
*
|
|
301
|
-
* @returns GitGovSession object or null if not found
|
|
302
|
-
*/
|
|
303
|
-
loadSession(): Promise<GitGovSession | null>;
|
|
304
|
-
/**
|
|
305
|
-
* Save session state to storage.
|
|
306
|
-
*
|
|
307
|
-
* @param session - The session state to persist
|
|
308
|
-
*/
|
|
309
|
-
saveSession(session: GitGovSession): Promise<void>;
|
|
310
|
-
/**
|
|
311
|
-
* Detect actor from private key files.
|
|
312
|
-
*
|
|
313
|
-
* Optional method for implementations that support actor auto-detection
|
|
314
|
-
* from .key files in the actors directory.
|
|
315
|
-
*
|
|
316
|
-
* @returns Actor ID (e.g., "human:camilo-v2") or null if not detectable
|
|
317
|
-
*/
|
|
318
|
-
detectActorFromKeyFiles?(): Promise<string | null>;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
191
|
/**
|
|
322
192
|
* ConfigStore Interface
|
|
323
193
|
*
|
|
@@ -353,7 +223,7 @@ interface SessionStore {
|
|
|
353
223
|
* store.setConfig({ protocolVersion: '1.0', ... });
|
|
354
224
|
* ```
|
|
355
225
|
*/
|
|
356
|
-
interface ConfigStore {
|
|
226
|
+
interface ConfigStore<R = void> {
|
|
357
227
|
/**
|
|
358
228
|
* Load project configuration from config.json
|
|
359
229
|
*
|
|
@@ -364,76 +234,9 @@ interface ConfigStore {
|
|
|
364
234
|
* Save project configuration to config.json
|
|
365
235
|
*
|
|
366
236
|
* @param config - Configuration to persist
|
|
237
|
+
* @returns Void for local backends; GitHubSaveResult for GitHub backend
|
|
367
238
|
*/
|
|
368
|
-
saveConfig(config: GitGovConfig): Promise<
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
/**
|
|
372
|
-
* KeyProvider Interface
|
|
373
|
-
*
|
|
374
|
-
* Abstracts private key storage for Actor signing operations.
|
|
375
|
-
* Enables different backends: filesystem (development), environment variables (serverless),
|
|
376
|
-
* or cloud KMS (enterprise).
|
|
377
|
-
*
|
|
378
|
-
* @module key_provider
|
|
379
|
-
*/
|
|
380
|
-
/**
|
|
381
|
-
* Error codes for KeyProvider operations.
|
|
382
|
-
*/
|
|
383
|
-
type KeyProviderErrorCode = 'KEY_NOT_FOUND' | 'KEY_READ_ERROR' | 'KEY_WRITE_ERROR' | 'KEY_DELETE_ERROR' | 'INVALID_KEY_FORMAT' | 'INVALID_ACTOR_ID';
|
|
384
|
-
/**
|
|
385
|
-
* Error thrown when key operations fail.
|
|
386
|
-
*/
|
|
387
|
-
declare class KeyProviderError extends Error {
|
|
388
|
-
readonly code: KeyProviderErrorCode;
|
|
389
|
-
readonly actorId?: string | undefined;
|
|
390
|
-
constructor(message: string, code: KeyProviderErrorCode, actorId?: string | undefined);
|
|
391
|
-
}
|
|
392
|
-
/**
|
|
393
|
-
* Interface for managing private key storage.
|
|
394
|
-
* Implementations handle the actual persistence mechanism.
|
|
395
|
-
*
|
|
396
|
-
* @example
|
|
397
|
-
* ```typescript
|
|
398
|
-
* // Filesystem backend (development)
|
|
399
|
-
* const provider = new FsKeyProvider({ actorsDir: '.gitgov/actors' });
|
|
400
|
-
*
|
|
401
|
-
* // Environment backend (serverless)
|
|
402
|
-
* const provider = new EnvKeyProvider({ prefix: 'GITGOV_KEY_' });
|
|
403
|
-
*
|
|
404
|
-
* // Usage
|
|
405
|
-
* const privateKey = await provider.getPrivateKey('actor:human:alice');
|
|
406
|
-
* if (privateKey) {
|
|
407
|
-
* const signature = signPayload(payload, privateKey, actorId, role);
|
|
408
|
-
* }
|
|
409
|
-
* ```
|
|
410
|
-
*/
|
|
411
|
-
interface KeyProvider {
|
|
412
|
-
/**
|
|
413
|
-
* Retrieves the private key for an actor.
|
|
414
|
-
* @param actorId - The actor's ID (e.g., 'actor:human:alice')
|
|
415
|
-
* @returns The base64-encoded private key, or null if not found
|
|
416
|
-
*/
|
|
417
|
-
getPrivateKey(actorId: string): Promise<string | null>;
|
|
418
|
-
/**
|
|
419
|
-
* Stores a private key for an actor.
|
|
420
|
-
* @param actorId - The actor's ID
|
|
421
|
-
* @param privateKey - The base64-encoded private key
|
|
422
|
-
* @throws KeyProviderError if write fails
|
|
423
|
-
*/
|
|
424
|
-
setPrivateKey(actorId: string, privateKey: string): Promise<void>;
|
|
425
|
-
/**
|
|
426
|
-
* Checks if a private key exists for an actor.
|
|
427
|
-
* @param actorId - The actor's ID
|
|
428
|
-
* @returns true if key exists, false otherwise
|
|
429
|
-
*/
|
|
430
|
-
hasPrivateKey(actorId: string): Promise<boolean>;
|
|
431
|
-
/**
|
|
432
|
-
* Deletes the private key for an actor.
|
|
433
|
-
* @param actorId - The actor's ID
|
|
434
|
-
* @returns true if key was deleted, false if it didn't exist
|
|
435
|
-
*/
|
|
436
|
-
deletePrivateKey(actorId: string): Promise<boolean>;
|
|
239
|
+
saveConfig(config: GitGovConfig): Promise<R>;
|
|
437
240
|
}
|
|
438
241
|
|
|
439
242
|
/**
|
|
@@ -754,6 +557,7 @@ interface IGitModule {
|
|
|
754
557
|
checkoutFilesFromBranch(sourceBranch: string, filePaths: string[]): Promise<void>;
|
|
755
558
|
add(filePaths: string[], options?: {
|
|
756
559
|
force?: boolean;
|
|
560
|
+
contentMap?: Record<string, string>;
|
|
757
561
|
}): Promise<void>;
|
|
758
562
|
rm(filePaths: string[]): Promise<void>;
|
|
759
563
|
commit(message: string, author?: CommitAuthor): Promise<string>;
|
|
@@ -795,4 +599,4 @@ declare namespace index {
|
|
|
795
599
|
export { index_BranchAlreadyExistsError as BranchAlreadyExistsError, index_BranchNotFoundError as BranchNotFoundError, type index_ChangedFile as ChangedFile, type index_CommitAuthor as CommitAuthor, type index_CommitInfo as CommitInfo, type index_ExecOptions as ExecOptions, type index_ExecResult as ExecResult, index_FileNotFoundError as FileNotFoundError, type index_GetCommitHistoryOptions as GetCommitHistoryOptions, index_GitCommandError as GitCommandError, index_GitError as GitError, type index_GitModuleDependencies as GitModuleDependencies, type index_IGitModule as IGitModule, index_MergeConflictError as MergeConflictError, index_RebaseConflictError as RebaseConflictError, index_RebaseNotInProgressError as RebaseNotInProgressError };
|
|
796
600
|
}
|
|
797
601
|
|
|
798
|
-
export { type
|
|
602
|
+
export { type AuditState as A, type ConfigStore as C, DEFAULT_ID_ENCODER as D, type ExecOptions as E, type FsFileListerOptions as F, type GitGovConfig as G, type IdEncoder as I, type MemoryFileListerOptions as M, type RecordStore as R, type SyncConfig as S, type IGitModule as a, type GitModuleDependencies as b, type ExecResult as c, type ChangedFile as d, type GetCommitHistoryOptions as e, type CommitInfo as f, type CommitAuthor as g, type FileLister as h, type FileListOptions as i, type FileStats as j, type AuditStateUpdate as k, type IConfigManager as l, type SyncDefaults as m, index as n };
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { S as SessionManager, C as ConfigManager, B as ActorPayload, D as ActorRecord, H as AgentPayload, J as AgentRecord, K as ChangelogPayload, M as ChangelogRecord, N as CustomRecord, O as CyclePayload, Q as CycleRecord, T as EmbeddedMetadataHeader, U as EmbeddedMetadataRecord, V as ExecutionPayload, W as ExecutionRecord, X as FeedbackPayload, Y as FeedbackRecord, Z as GitGovActorRecord, _ as GitGovAgentRecord, $ as GitGovChangelogRecord, a0 as GitGovCycleRecord, a1 as GitGovError, a2 as GitGovExecutionRecord, a3 as GitGovFeedbackRecord, G as GitGovRecord, a4 as GitGovRecordPayload, a5 as GitGovRecordType, a6 as GitGovTaskRecord, a7 as Signature, a8 as TaskPayload, a9 as TaskRecord, aa as RecordStores, ab as CollaborationMetrics, ac as IMetricsAdapter, ad as IPlatformApi, ae as MetricsAdapter, af as MetricsAdapterDependencies, ag as ProductivityMetrics, ah as SystemStatus, ai as TaskHealthReport, aj as TokenConsumption, ak as ActivityEvent, al as ActorCreatedEvent, am as ActorRevokedEvent, an as AgentRegisteredEvent, ao as BaseEvent, ap as ChangelogCreatedEvent, aq as CycleCreatedEvent, ar as CycleStatusChangedEvent, as as EventBus, at as EventHandler, au as EventMetadata, av as EventSubscription, aw as ExecutionCreatedEvent, ax as FeedbackCreatedEvent, ay as GitGovEvent, s as IEventStream, az as SystemDailyTickEvent, aA as TaskCreatedEvent, aB as TaskStatusChangedEvent, aC as eventBus, aD as publishEvent, aE as subscribeToEvent, c as IIndexerAdapter, aF as IndexerAdapterDependencies, aG as IndexGenerationReport, aH as IndexData, aI as IntegrityReport, aJ as AllRecords, aK as DerivedStates, aL as EnrichedTaskRecord, aM as DerivedStateSets, aN as IntegrityError, aO as IntegrityWarning, aP as IIdentityAdapter, aQ as IdentityAdapter, aR as IdentityAdapterDependencies, I as ILintModule, aS as LintModuleDependencies, d as LintRecordContext, e as LintResult, L as LintOptions, a as LintReport$1, F as FixRecordOptions, b as FixReport, aT as FixResult, aU as LintSummary, aV as RecordEntry, R as RecordStores$1, aW as ValidationContext$1, aX as ValidatorType, aY as IExecutionAdapter, aZ as ExecutionAdapterDependencies, E as EnvironmentValidation, f as IProjectInitializer, x as FsKeyProvider, y as FsKeyProviderOptions, z as FsFileLister, g as ISyncStateModule, a_ as AuditScope$1, A as AuditStateOptions, l as AuditStateReport, j as ConflictDiff, a$ as ConflictFileDiff, b0 as ConflictInfo, b1 as ConflictType, b2 as ExpectedFilesScope, k as IntegrityViolation, i as StateDeltaFile, h as SyncStateModuleDependencies, o as SyncStatePullOptions, p as SyncStatePullResult, m as SyncStatePushOptions, n as SyncStatePushResult, q as SyncStateResolveOptions, r as SyncStateResolveResult, b3 as AgentExecutionContext, b4 as AgentOutput, w as AgentResponse, u as AgentRunnerDependencies, b5 as AgentRunnerEvent, b6 as ApiEngine, b7 as AuthConfig, b8 as AuthType, b9 as CustomEngine, ba as Engine, bb as EngineType, bc as IAgentLoader, t as IAgentRunner, bd as LocalEngine, be as McpEngine, bf as ProtocolHandler, P as ProtocolHandlerRegistry, v as RunOptions, bg as RuntimeHandler, bh as RuntimeHandlerRegistry } from './agent_runner-
|
|
2
|
-
import { A as ActorState,
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { S as SessionManager, C as ConfigManager, B as ActorPayload, D as ActorRecord, H as AgentPayload, J as AgentRecord, K as ChangelogPayload, M as ChangelogRecord, N as CustomRecord, O as CyclePayload, Q as CycleRecord, T as EmbeddedMetadataHeader, U as EmbeddedMetadataRecord, V as ExecutionPayload, W as ExecutionRecord, X as FeedbackPayload, Y as FeedbackRecord, Z as GitGovActorRecord, _ as GitGovAgentRecord, $ as GitGovChangelogRecord, a0 as GitGovCycleRecord, a1 as GitGovError, a2 as GitGovExecutionRecord, a3 as GitGovFeedbackRecord, G as GitGovRecord, a4 as GitGovRecordPayload, a5 as GitGovRecordType, a6 as GitGovTaskRecord, a7 as Signature, a8 as TaskPayload, a9 as TaskRecord, aa as RecordStores, ab as CollaborationMetrics, ac as IMetricsAdapter, ad as IPlatformApi, ae as MetricsAdapter, af as MetricsAdapterDependencies, ag as ProductivityMetrics, ah as SystemStatus, ai as TaskHealthReport, aj as TokenConsumption, ak as ActivityEvent, al as ActorCreatedEvent, am as ActorRevokedEvent, an as AgentRegisteredEvent, ao as BaseEvent, ap as ChangelogCreatedEvent, aq as CycleCreatedEvent, ar as CycleStatusChangedEvent, as as EventBus, at as EventHandler, au as EventMetadata, av as EventSubscription, aw as ExecutionCreatedEvent, ax as FeedbackCreatedEvent, ay as GitGovEvent, s as IEventStream, az as SystemDailyTickEvent, aA as TaskCreatedEvent, aB as TaskStatusChangedEvent, aC as eventBus, aD as publishEvent, aE as subscribeToEvent, c as IIndexerAdapter, aF as IndexerAdapterDependencies, aG as IndexGenerationReport, aH as IndexData, aI as IntegrityReport, aJ as AllRecords, aK as DerivedStates, aL as EnrichedTaskRecord, aM as DerivedStateSets, aN as IntegrityError, aO as IntegrityWarning, aP as IIdentityAdapter, aQ as IdentityAdapter, aR as IdentityAdapterDependencies, I as ILintModule, aS as LintModuleDependencies, d as LintRecordContext, e as LintResult, L as LintOptions, a as LintReport$1, F as FixRecordOptions, b as FixReport, aT as FixResult, aU as LintSummary, aV as RecordEntry, R as RecordStores$1, aW as ValidationContext$1, aX as ValidatorType, aY as IExecutionAdapter, aZ as ExecutionAdapterDependencies, E as EnvironmentValidation, f as IProjectInitializer, x as FsKeyProvider, y as FsKeyProviderOptions, z as FsFileLister, g as ISyncStateModule, a_ as AuditScope$1, A as AuditStateOptions, l as AuditStateReport, j as ConflictDiff, a$ as ConflictFileDiff, b0 as ConflictInfo, b1 as ConflictType, b2 as ExpectedFilesScope, k as IntegrityViolation, i as StateDeltaFile, h as SyncStateModuleDependencies, o as SyncStatePullOptions, p as SyncStatePullResult, m as SyncStatePushOptions, n as SyncStatePushResult, q as SyncStateResolveOptions, r as SyncStateResolveResult, b3 as AgentExecutionContext, b4 as AgentOutput, w as AgentResponse, u as AgentRunnerDependencies, b5 as AgentRunnerEvent, b6 as ApiEngine, b7 as AuthConfig, b8 as AuthType, b9 as CustomEngine, ba as Engine, bb as EngineType, bc as IAgentLoader, t as IAgentRunner, bd as LocalEngine, be as McpEngine, bf as ProtocolHandler, P as ProtocolHandlerRegistry, v as RunOptions, bg as RuntimeHandler, bh as RuntimeHandlerRegistry } from './agent_runner-Cs5HXt4h.js';
|
|
2
|
+
import { A as ActorState, G as GitGovSession, I as ISessionManager, a as SyncPreferencesUpdate, b as SyncStatus, K as KeyProvider, c as KeyProviderError, d as KeyProviderErrorCode } from './key_provider-CRpHFGjN.js';
|
|
3
|
+
import { A as AuditState, k as AuditStateUpdate, G as GitGovConfig, l as IConfigManager, S as SyncConfig, m as SyncDefaults, D as DEFAULT_ID_ENCODER, I as IdEncoder, R as RecordStore, i as FileListOptions, h as FileLister, j as FileStats, F as FsFileListerOptions, M as MemoryFileListerOptions, a as IGitModule } from './index-D1RVufxB.js';
|
|
4
|
+
export { C as ConfigStore, n as Git } from './index-D1RVufxB.js';
|
|
5
|
+
import { E as EnvKeyProvider, a as EnvKeyProviderOptions, M as MockKeyProvider, b as MockKeyProviderOptions, c as MemoryFileLister } from './memory_file_lister-CfHtByeZ.js';
|
|
5
6
|
import { ValidateFunction } from 'ajv';
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -46,7 +47,7 @@ declare namespace index$r {
|
|
|
46
47
|
/**
|
|
47
48
|
* Error codes for FileLister operations.
|
|
48
49
|
*/
|
|
49
|
-
type FileListerErrorCode = 'FILE_NOT_FOUND' | 'READ_ERROR' | 'PERMISSION_DENIED' | 'INVALID_PATH';
|
|
50
|
+
type FileListerErrorCode = 'FILE_NOT_FOUND' | 'READ_ERROR' | 'PERMISSION_DENIED' | 'INVALID_PATH' | 'NETWORK_ERROR';
|
|
50
51
|
/**
|
|
51
52
|
* Error thrown when file operations fail.
|
|
52
53
|
*/
|
|
@@ -215,10 +216,12 @@ declare namespace index$q {
|
|
|
215
216
|
export { index$q_ActorPayload as ActorPayload, index$q_ActorRecord as ActorRecord, index$q_AgentPayload as AgentPayload, index$q_AgentRecord as AgentRecord, index$q_ChangelogPayload as ChangelogPayload, index$q_ChangelogRecord as ChangelogRecord, index$q_CustomRecord as CustomRecord, index$q_CyclePayload as CyclePayload, index$q_CycleRecord as CycleRecord, index$q_EmbeddedMetadataHeader as EmbeddedMetadataHeader, index$q_EmbeddedMetadataRecord as EmbeddedMetadataRecord, index$q_ExecutionPayload as ExecutionPayload, index$q_ExecutionRecord as ExecutionRecord, index$q_FeedbackPayload as FeedbackPayload, index$q_FeedbackRecord as FeedbackRecord, index$q_GitGovActorRecord as GitGovActorRecord, index$q_GitGovAgentRecord as GitGovAgentRecord, index$q_GitGovChangelogRecord as GitGovChangelogRecord, index$q_GitGovCycleRecord as GitGovCycleRecord, index$q_GitGovError as GitGovError, index$q_GitGovExecutionRecord as GitGovExecutionRecord, index$q_GitGovFeedbackRecord as GitGovFeedbackRecord, index$q_GitGovRecord as GitGovRecord, index$q_GitGovRecordPayload as GitGovRecordPayload, index$q_GitGovRecordType as GitGovRecordType, index$q_GitGovTaskRecord as GitGovTaskRecord, index$q_Signature as Signature, index$q_TaskPayload as TaskPayload, index$q_TaskRecord as TaskRecord, type index$q_WorkflowRecord as WorkflowRecord };
|
|
216
217
|
}
|
|
217
218
|
|
|
219
|
+
declare const index$p_DEFAULT_ID_ENCODER: typeof DEFAULT_ID_ENCODER;
|
|
220
|
+
declare const index$p_IdEncoder: typeof IdEncoder;
|
|
218
221
|
declare const index$p_RecordStore: typeof RecordStore;
|
|
219
222
|
declare const index$p_RecordStores: typeof RecordStores;
|
|
220
223
|
declare namespace index$p {
|
|
221
|
-
export { index$p_RecordStore as RecordStore, index$p_RecordStores as RecordStores };
|
|
224
|
+
export { index$p_DEFAULT_ID_ENCODER as DEFAULT_ID_ENCODER, index$p_IdEncoder as IdEncoder, index$p_RecordStore as RecordStore, index$p_RecordStores as RecordStores };
|
|
222
225
|
}
|
|
223
226
|
|
|
224
227
|
declare const index$o_CollaborationMetrics: typeof CollaborationMetrics;
|
|
@@ -7103,4 +7106,4 @@ declare namespace index {
|
|
|
7103
7106
|
export { type index_ActiveWaiver as ActiveWaiver, type index_AuditContentsInput as AuditContentsInput, type index_AuditOptions as AuditOptions, type index_AuditResult as AuditResult, type index_AuditScope as AuditScope, type index_AuditSummary as AuditSummary, type index_AuditTarget as AuditTarget, type index_CodeScope as CodeScope, type index_CreateWaiverOptions as CreateWaiverOptions, type index_FailOnSeverity as FailOnSeverity, type index_FileContent as FileContent, type index_GitgovScope as GitgovScope, type index_GroupByOption as GroupByOption, type index_IWaiverReader as IWaiverReader, type index_JiraScope as JiraScope, type index_OutputFormat as OutputFormat, type index_ScopeConfig as ScopeConfig, index_ScopeSelector as ScopeSelector, index_ScoringEngine as ScoringEngine, type index_SourceAuditorDependencies as SourceAuditorDependencies, index_SourceAuditorModule as SourceAuditorModule, type index_WaiverMetadata as WaiverMetadata, index_WaiverReader as WaiverReader, type index_WaiverStatus as WaiverStatus, index_WaiverWriter as WaiverWriter };
|
|
7104
7107
|
}
|
|
7105
7108
|
|
|
7106
|
-
export { ActivityEvent, ActorRecord, ActorState, index$c as Adapters, AgentRecord, AgentResponse, AllRecords, AuditState, AuditStateReport, index$f as BacklogAdapter, index$g as ChangelogAdapter, ChangelogRecord, CollaborationMetrics, index$r as Config, index$b as Crypto, CustomRecord, CycleRecord, DerivedStates, index$2 as DiagramGenerator, EmbeddedMetadataRecord, EnrichedTaskRecord, EnvironmentValidation, index$n as EventBus, index$j as ExecutionAdapter, ExecutionRecord, index$a as Factories, index$i as FeedbackAdapter, FeedbackRecord, index$8 as FileLister, index$1 as FindingDetector, FixReport, GitGovActorRecord, GitGovAgentRecord, GitGovChangelogRecord, GitGovConfig, GitGovCycleRecord, GitGovExecutionRecord, GitGovFeedbackRecord, GitGovRecord, GitGovRecordPayload, GitGovRecordType, GitGovTaskRecord, IAgentRunner, IConfigManager, IIdentityAdapter, IIndexerAdapter, KeyProvider as IKeyProvider, ILintModule, IMetricsAdapter, ISessionManager, ISyncStateModule, index$l as IdentityAdapter, IndexData, IndexGenerationReport, index$m as IndexerAdapter, IndexerAdapterDependencies, IntegrityReport, index$9 as KeyProvider, index$k as Lint, LintOptions, LintReport$1 as LintReport, LintResult, index$7 as Logger, index$o as MetricsAdapter, ProductivityMetrics, index$d as ProjectAdapter, type ProjectInitResult, index$e as ProjectInitializer, RecordStore, RecordStores$1 as RecordStores, index$q as Records, RunOptions, index$3 as Runner, index$6 as Schemas, index$s as Session, Signature, index as SourceAuditor, index$p as Store, index$5 as SyncState, SyncStatePullResult, SyncStatePushResult, SyncStateResolveResult, SyncStatus, SystemStatus, TaskHealthReport, TaskRecord, index$4 as Validation, ValidatorType, index$h as WorkflowAdapter, type WorkflowRecord };
|
|
7109
|
+
export { ActivityEvent, ActorRecord, ActorState, index$c as Adapters, AgentRecord, AgentResponse, AllRecords, AuditState, AuditStateReport, index$f as BacklogAdapter, index$g as ChangelogAdapter, ChangelogRecord, CollaborationMetrics, index$r as Config, index$b as Crypto, CustomRecord, CycleRecord, DerivedStates, index$2 as DiagramGenerator, EmbeddedMetadataRecord, EnrichedTaskRecord, EnvironmentValidation, index$n as EventBus, index$j as ExecutionAdapter, ExecutionRecord, index$a as Factories, index$i as FeedbackAdapter, FeedbackRecord, index$8 as FileLister, index$1 as FindingDetector, FixReport, GitGovActorRecord, GitGovAgentRecord, GitGovChangelogRecord, GitGovConfig, GitGovCycleRecord, GitGovExecutionRecord, GitGovFeedbackRecord, GitGovRecord, GitGovRecordPayload, GitGovRecordType, GitGovTaskRecord, IAgentRunner, IConfigManager, FileLister as IFileLister, IIdentityAdapter, IIndexerAdapter, KeyProvider as IKeyProvider, ILintModule, IMetricsAdapter, ISessionManager, ISyncStateModule, IdEncoder, index$l as IdentityAdapter, IndexData, IndexGenerationReport, index$m as IndexerAdapter, IndexerAdapterDependencies, IntegrityReport, index$9 as KeyProvider, index$k as Lint, LintOptions, LintReport$1 as LintReport, LintResult, index$7 as Logger, index$o as MetricsAdapter, ProductivityMetrics, index$d as ProjectAdapter, type ProjectInitResult, index$e as ProjectInitializer, RecordStore, RecordStores$1 as RecordStores, index$q as Records, RunOptions, index$3 as Runner, index$6 as Schemas, index$s as Session, Signature, index as SourceAuditor, index$p as Store, index$5 as SyncState, SyncStatePullResult, SyncStatePushResult, SyncStateResolveResult, SyncStatus, SystemStatus, TaskHealthReport, TaskRecord, index$4 as Validation, ValidatorType, index$h as WorkflowAdapter, type WorkflowRecord };
|