/** * Copyright Daytona Platforms Inc. * SPDX-License-Identifier: Apache-2.0 */ import type { Sandbox } from '@daytona/sdk'; import type { PluginInput } from '@opencode-ai/plugin'; /** * SessionGitManager: Combines DaytonaSandboxGitManager and HostGitManager for session lifecycle git operations. */ export declare class SessionGitManager { private readonly sandboxGit; private readonly hostGit; private readonly sandbox; private readonly repoPath; private readonly worktree; private readonly branch; private readonly localBranch; /** Numbered remote (sandbox-2) matches localBranch (opencode/2) */ private readonly remoteName; constructor(sandbox: Sandbox, repoPath: string, worktree: string, branchNumber: number); /** * Allocate and reserve the next opencode/N number in the local repo at `worktree`. * This keeps all host-git concerns inside the git manager layer. */ static allocateAndReserveBranchNumber(worktree: string, prefix?: string): number; private getSshUrl; /** * Check if local git repository exists * @returns true if repo exists, false otherwise */ hasLocalRepo(): boolean; /** * Initialize git in the sandbox and sync with host * Used when a new sandbox is created for a session */ initializeAndSync(pluginCtx?: PluginInput): Promise; /** * Auto-commit in the sandbox and pull latest from host * Used on session idle * Returns true if changes were synced, false if no changes or no local repo */ autoCommitAndPull(pluginCtx?: PluginInput): Promise; }