Project Files
.qwen / PROJECT_SUMMARY.md
The user wants me to analyze the conversation history and generate a comprehensive project summary in markdown format. Let me review the key information:
Overall Goal: Set up an LM Studio git plugin that provides read-only git operations to local LLMs, with a clone tool, and working directory containment for security.
Key Knowledge:
Recent Actions:
Current Plan:
Set up an LM Studio plugin that provides git inspection and cloning capabilities to local LLMs, constrained by working directory containment for security.
| Command | Purpose |
|---|---|
npm run build | Compile to dist/ |
npm run lint / npm run lint:fix | ESLint |
npm run format / npm run format:check | Prettier |
npm run dev | Run in LM Studio dev mode |
npm run push | Push published plugin to LM Studio |
ToolsProvider is a function: (controller: ToolsProviderController) => Promise<Tool[]>Tool is created via tool({ name, description, parameters, implementation }) from 6eeb4a2)The project is in a stable, committed state. All core features are implemented and lint-clean.
Update time: 2026-05-01T01:42:37.379Z
noImplicitOverride)@lmstudio/sdk — provides tool() factory, PluginContext, ToolsProvider type, ToolsProviderController.getWorkingDirectory()simple-git — uses spawned processes with discrete argument arrays (no shell injection)zod — runtime parameter validation for tool schemassrc/index.ts — default export required by LM Studio host, calls PluginContext.withToolsProvider()src/tools-provider.ts — receives ToolsProviderController, calls controller.getWorkingDirectory() to get the sandboxed directorysrc/path/validation.ts — resolveAndValidateRepoPath() uses path.resolve() + startsWith() to enforce containment. Throws if the resolved path escapes the working directory.src/git/error-formatting.ts — formatGitError(operation, target, error) strips the fatal: prefix from simple-git's stderr output, recognises common patterns (not-a-git-repo, destination-already-exists, host-unreachable, auth-failed, ambiguous/bad/unknown-revision), and returns a clear error string for the model.src/tools/*-tool.ts — each exports a single create*Tool(workingDirectory: string): Tool factoryrepoPath and clone destination is validated to be a child of controller.getWorkingDirectory(). Paths escaping throw an error.git_status, git_diff, git_log, git_branch, git_show)git_clone clones remote repos into the working directory with optional branch, depth, and destinationsimple-git spawns with discrete argument arrayssrc/index.ts for LM Studio host)any is forbidden, no null (use undefined), strict boolean expressions (=== true, typeof x === "string")@param and @returns, no hyphen before @param description@throws {Error} format required for throw signatures@lmstudio/sdktool() accepts exactly 4 options — no workingDirectory or sandboxing. Must be injected manually via factory parametersimple-git clone signature: clone(repo: string, directory: string, customArgs: string[]) — options are flat string arrays, not recordspackage.json from web-tools project, stripped all scraping deps, added simple-git + typescriptgit_status, git_diff, git_log, git_branch, git_show with Zod schemas and tool() factory patternsrc/path-validation.ts (later moved to src/path/validation.ts) exposing resolveAndValidateRepoPath()branch, depth (shallow clone), and optional repoName; validates destination against working directorytools-provider.ts to capture controller.getWorkingDirectory() and pass to all tool factoriestypes: ["node"] to resolve node:path import6eeb4a2 with full lint and build passinggit_show hardening — added 10 MB cap via cat-file -s (later commits: aa73c23 pagination, b78953c size guard); added Zod refinements rejecting empty strings, leading-- flag-injection, whitespace in refs; capped limit/offset and added a post-load Buffer.byteLength cap so large commit diffs (where the pre-load cat-file cap is meaningless) don't blow up memory.fcf8a3c switched tools from absolute paths to repo names relative to the working directory.src/git/error-formatting.ts (formatGitError); all six tools now wrap their simple-git calls in try/catch and return formatted strings to the model. Path-validation throws still propagate (security boundary, user-facing). git_show now returns JSON.stringify(...) for structured payloads to match the SDK's ToolCallResult.content: string contract and the project convention used by git_status/git_log/git_branch.src/path-validation.ts → src/path/validation.ts and added src/git/error-formatting.ts so themed helpers live in sibling folders to src/tools/ rather than cluttering src/. CLAUDE.md updated to reflect the convention.ToolsProviderController.getWorkingDirectory()src/path/validation.ts) with containment checksgit_clone tool with path-validated destinationworkingDirectory parameternode:path typesgit_show with size caps, pagination, and Zod refinements (no empty strings, no leading--, no whitespace in refs)src/git/error-formatting.ts and route every tool's simple-git errors through it for consistent, model-readable outputsrc/path/ and src/git/, with helpers as siblings to src/tools/