JJ Components
Smithers provides first-class support for Jujutsu (jj), a modern version control system. These components wrap jj commands and integrate with the database for logging.
Installation
Ensure you have Jujutsu installed:
# macOS
brew install jj
# From source
cargo install jj-cli
Components
Snapshot
Creates a jj snapshot and logs to the database.
import { Snapshot } from "smithers-orchestrator/components/JJ";
<Snapshot message="Before risky refactoring">
{/* Child content */}
</Snapshot>
Props
Optional message describing the snapshot.
Commit
Creates a jj commit with optional auto-describe functionality.
import { Commit } from "smithers-orchestrator/components/JJ";
// With explicit message
<Commit message="feat: Add user authentication" />
// With auto-generated message
<Commit autoDescribe />
// With git notes
<Commit
message="feat: New feature"
notes="User prompt: Add the new feature"
/>
Props
Commit message. If not provided and autoDescribe is false, defaults to “Commit by Smithers”.
Use Claude to automatically generate a commit message based on the diff.
Git notes to attach to the commit (useful for tracking Smithers metadata).
Describe
Updates the description of a jj change.
import { Describe } from "smithers-orchestrator/components/JJ";
<Describe changeId="abc123" description="Updated description" />
Props
The change ID to describe.
Status
Gets the current jj status.
import { Status } from "smithers-orchestrator/components/JJ";
<Status onStatus={(status) => console.log(status)} />
Props
onStatus
(status: JJStatus) => void
Callback with the current jj status.
Rebase
Performs a jj rebase operation.
import { Rebase } from "smithers-orchestrator/components/JJ";
<Rebase source="feature" destination="main" />
Props
Source revision to rebase.
Destination to rebase onto.
Complete Example
import { Snapshot, Commit } from "smithers-orchestrator/components/JJ";
function JJWorkflow() {
const [phase, setPhase] = useState("snapshot");
return (
<SmithersProvider db={db} executionId={executionId} maxIterations={5}>
<If condition={phase === "snapshot"}>
<Snapshot
message="Before feature implementation"
onFinished={() => setPhase("implement")}
/>
</If>
<If condition={phase === "implement"}>
<Claude
onFinished={() => setPhase("commit")}
>
Implement the feature.
</Claude>
</If>
<If condition={phase === "commit"}>
<Commit
autoDescribe
notes="Smithers automated commit"
onFinished={() => setPhase("done")}
/>
</If>
</SmithersProvider>
);
}
Database Logging
All JJ operations are automatically logged to the database:
// Snapshots
const snapshots = await db.vcs.getSnapshots(10);
// Commits
const commits = await db.vcs.getCommits(10);