feat: @devframes/service-git wire service + git plugin refactor - #263
Merged
Conversation
Extract the git plugin's git utilities into a new @devframes/service-git
wire service and refactor the plugin to consume it.
- services/git: createGitService({ cwd? }) → node API + devframes:service:git:*
RPC (status/log/show/diff/branches/stage/unstage/commit) + advertisement.
Single repo fixed at install (defaults to ctx.cwd, root discovered once).
Exec wrapper + parsers stay internal; typed ops only, no raw passthrough.
Write ops always exposed — authorization is the host's connection-trust
boundary. Defines no dump/snapshot of its own.
- core: DevframeDefinition.snapshotRpc lets a devframe bake an RPC it does
not own (a service's) into its static build — string (no-arg) or
{ method, inputs: tuples | async (ctx) => tuples }. createBuild applies it
before collecting; exported applySnapshotRpc; DF0072 warns on a missing
target.
- plugins/git: drops its node/git.ts + rpc layer and all git logic; declares
the service (cwd from repoRoot at factory time) and opts the read ops into
snapshotRpc (show enumerated at build time via the service node API). The
React SPA calls devframes:service:git:* directly and imports types from
@devframes/service-git. Drops --write — writes are always available,
protected by the connection trust boundary.
- docs: service-git in the built-in services list; snapshotRpc definition
field; git plugin README.
✅ Deploy Preview for devfra ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Group the RPC static-build opt-in under a new `rpc` config object: `DevframeDefinition.rpc.snapshot` (new `DevframeRpcOptions`) replaces the top-level `snapshotRpc`. Entry types and the `applySnapshotRpc` build helper are unchanged; the git plugin, build adapter, DF0072 message, tests, and docs are updated to the new shape.
The next-devframe-hub e2e asserted `devframes_plugin_git_status`; git's agent-flagged reads now live on `@devframes/service-git`, so the hub MCP surfaces `devframes_service_git_status`. Also assert the service exposes its agent-flagged status op on the agent surface.
antfu
approved these changes
Aug 19, 2026
antfubot
added a commit
that referenced
this pull request
Aug 19, 2026
Reconcile the in-house diff renderer with #263's @devframes/service-git refactor: the shared git types (GitDiff, FileStatusCode, CommitDetail) now come from @devframes/service-git, and the RPC scope moved to devframes:service:git:*. Combine the two service declarations (service-git + service-shiki) into one array on the git devframe, and drop the leftover @pierre/diffs/@pierre/theme lockfile entries.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Extracts the git plugin's git utilities into a new
@devframes/service-gitwire service (a peer ofservice-open/service-shiki) and refactorsplugins/gitto consume it. Adds one small core mechanism —DevframeDefinition.snapshotRpc— so a devframe can bake an RPC it doesn't own into its static build.@devframes/service-git—devframes:service:gitcreateGitService({ cwd? })→ node API +devframes:service:git:*RPC + client advertisement.status,log,show,diff,branches,stage,unstage,commit— the exact command-building + output parsing lifted from the plugin, now framework-neutral. TheexecFilewrapper and parsers stay internal; no rawgitpassthrough over RPC.cwddefaults to the context cwd, repo root discovered once (rev-parse --show-toplevel, memoized).isSafeRevision).dump/snapshot— stays live-only.ctx.services.get('@devframes/service-git')) and the same ops over RPC; types (GitStatus,GitDiff,CommitDetail, …) exported from the package and contributed to the RPC/scope declaration merges.Core:
DevframeDefinition.snapshotRpcOpt an RPC function a devframe doesn't own (a service's) into the static-build dump, since the service declares no dump. Each entry is a bare method id (bakes the no-arg call) or
{ method, inputs }whereinputsis argument-tuples or an async(ctx) => tuplesprovider (so it can enumerate at build time via the service node API).createBuildresolves these after setup and runs the target's own handler per tuple; the first tuple's result is the fallback. ExportedapplySnapshotRpc;DF0072warns on a missing target.plugins/gitrefactorsrc/node/git.tsand the wholesrc/rpc/layer — no git logic left in the plugin.cwdfromrepoRootcomputed at factory time) and opts the read ops intosnapshotRpc—status/branches/diffbake their no-arg call,logbakes the 200-commit head,showis enumerated per commit (patch-less) at build time via the service node API.devframes:service:git:*directly and imports types from@devframes/service-git.--write— writes are always available, protected by who-can-connect (matches the repo's security model).Validation
pnpm lint && pnpm knip && pnpm test && pnpm typecheck && pnpm buildall green (1226 tests, 110 files).services/gitcovers every op + non-repo degradation + revision-injection safety + scoped RPC;plugins/gitkeeps an integration test (service RPC over the dashboard server), a write round-trip, and asnapshotRpcbuild-baking test; devframe core gainssnapshotRpccoverage (string/inputs/provider +DF0072). API snapshots regenerated.Created with the help of an agent.