Here's a summary of the recent changes:
- Project Initialization: Added
.gitignore,.shadow-lock(for state tracking), andREADME.mdfor project overview and usage instructions. - CLI Framework: Introduced
commanderfor command-line interface creation, defining asynccommand. - Core Logic (
synccommand):- Implemented the main synchronization flow in
src/commands/sync.tsand its compileddist/commands/sync.js. - Uses
GitManagerto check for clean working trees, retrieve commit hashes, get differences between commits, and list project files. - Utilizes
Storeto manage persistent state:- Saves the current commit hash in
.shadow-lockas a baseline on the first run. - Loads previous state and fetches the diff from the last known commit.
- Appends generated documentation summaries to
STRUCTURE.md.
- Saves the current commit hash in
- Integrates with
AIManagerto generate documentation summaries.
- Implemented the main synchronization flow in
- AI Integration (
ai.ts):- Added
src/lib/ai.tsanddist/lib/ai.jsto handle AI interactions. - Uses
@google/generative-aianddotenvto manage API keys. - Defines a prompt for the Gemini API, requesting concise, bullet-pointed summaries of Git diffs, project structure, and existing documentation.
- Added
- Git Utility (
git.ts):- Created
src/lib/git.tsanddist/lib/git.jsto encapsulate Git operations usingexecSync. - Includes functions for getting the current HEAD commit, ensuring a clean working tree, retrieving diffs, and listing project files.
- Created
- State Management (
store.ts):- Developed
src/utils/store.tsanddist/utils/store.jsfor file-based state management. - Handles reading and writing to
.shadow-lockfor commit history andSTRUCTURE.mdfor accumulating documentation.
- Developed
- Build & Dependencies:
- Updated
package.jsonto includedotenv,commander, andchalkas dependencies. - Added a
buildscript (npm run build) to compile TypeScript to JavaScript. - Modified the
binentry inpackage.jsonto point to the compileddist/index.js.
- Updated
- Removed Files: Deleted unused example files
git-lab.tsandtest-watcher.ts. - TypeScript Configuration: Updated
tsconfig.jsonto useesnextmodule target andbundlermodule resolution, along with enablingallowImportingTsExtensionsandrewriteRelativeImportExtensions.
--