Skip to content

Local adapters

Local durable and ephemeral adapters for filesystem-backed workflows.

Package:

Imports:

import { LocalDurableAdapter, LocalEphemeralAdapter } from '@gittrix/adapter-local'
interface LocalDurableAdapterOptions {
path: string
branch?: string
}
interface LocalEphemeralAdapterOptions {
sessionsRootDir: string
}

Local durable:

{ git: true, push: false, fetch: false, history: true, ttl: false, latencyClass: 'local' }

Local ephemeral:

{ git: true, push: false, fetch: false, history: true, ttl: false, latencyClass: 'local' }
import { GitTrix } from '@gittrix/core'
import { LocalDurableAdapter, LocalEphemeralAdapter } from '@gittrix/adapter-local'
const gittrix = new GitTrix({
durable: new LocalDurableAdapter({ path: '/path/to/repo', branch: 'main' }),
ephemeral: new LocalEphemeralAdapter({ sessionsRootDir: '/tmp/gittrix-sessions' }),
})
  • Creates a git worktree at <sessionsRootDir>/<session-id>/workspace when possible.
  • Falls back to a clone checked out at the baseline SHA.
  • Tracks API writes and git working-tree changes.
  • Excludes .git, .gittrix-touched.json, and .glib from touched files.
  • Removes worktrees cleanly on destroy and prunes stale worktree metadata best-effort.

LocalFsAdapter is removed and throws immediately. Use LocalDurableAdapter and LocalEphemeralAdapter instead.