feat(git-tools): add git_repo_info tool with Forgejo repo metadata #36
No reviewers
Labels
No labels
Agent
Ignore
Agent
In Progress
Agent
Planned
Agent
Planning
Agent
Ready
Agent
Triage
Compat
Breaking
Kind
Bug
Kind
Documentation
Kind
Enhancement
Kind
Feature
Kind
Security
Kind
Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
lucas/omp-deck!36
Loading…
Reference in a new issue
No description provided.
Delete branch "29-add-git-repo-info-tool-local-repo-forgejo-metadata"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds a read-only, parameterless
git_repo_infotool. It returns the work-tree root, branch/detached state, HEAD, upstream and ahead/behind, plus a resolved default branch with its source (Forgejo API first, then the localrefs/remotes/origin/HEAD). When origin is on the configured Forgejo instance, it also returns the repo's metadata: URLs, private/fork/archived/empty flags and the fork parent. A Forgejo API failure is reported underforgejo.error; the call still succeeds.buildForgejoToolsnow exposes itscontext, andbuildGitToolstakes it. The tool is allowed in Forgejo trigger sessions and listed in the git bash rule and orientation prompt. It also gets a dedicated web renderer (GitRepoInfoView) and three preview fixtures.Decisions
ApiRepo.descriptionis typedstring | null(Forgejo may send null) and mapped with?? "".fullNamefalls back toowner/repowhen the API omitsfull_name, becauseApiRepo.full_namewas already optional.tc-git-repo-info-forgejo-errorfixture shows the realisticorigin_headfallback rather than an unknown default branch.Verification
bun test src/bridge/git-tools/repo-info.test.ts: 6 pass. Covers origin/HEAD only, Forgejo wins with metadata mapping, Forgejo 500 fallback, network error, unborn repo, and non-repo error.bun test src/bridge src/forgejo/tools(server): 497 pass, 0 fail.bun test src/lib/git-format.test.ts(web): 9 pass.bun run typecheck(root): protocol, web and server all pass./previewfixtures.Closes #29
c01ee6ab2ctocb7c7fe6ddRebased onto
main(f58cc74).Conflicts resolved
git-tools/index.ts: combined main'scommitEnvobject and the newgit_rebasetool with theforgejoparameter andbuildRepoInfoTool.git-bash-rule.ts,orientation-store.ts: the tool lists now name bothgit_repo_infoandgit_rebase, and keep main's updated wording about force-pushing after a rebase.Integration check against main
in-process.tsmerged cleanly. BothbuildGitTools(cwd, forgejoCtx)callers sit inside the newwrapRebaseGatewrapper.git_repo_infois read-only, so the gate rightly leaves it ungated.originis the workspace's Forgejo URL, so the Forgejo context still resolves there. Those clones start on a detached HEAD with no local branches, which makes the tool's default-branch answer more useful in trigger sessions.git_rebaseto the blocklist.git_repo_infostays available.cb7c7fe: main now hasdocs/git-tools.mdand CHANGELOG entries for the git tools. It addsgit_repo_infoto the tool table, the idea-mode note, the card list and the CHANGELOG, and updates the read-only tool comment inidea-mode-bridge.ts.Verification
bun run typecheck: protocol, server and web pass.bun test src/bridge src/forgejo(server): 627 pass, 0 fail.bun test src/lib/git-format.test.ts(web): 9 pass./previewfixtures.