Versions in this module Expand all Collapse all v0 v0.7.0 Apr 13, 2026 Changes in this version + type BundleCreatedHook func(ctx context.Context, workspaceID, headCommit string, bundleSize int) + type FileStat struct + FilePath string + LinesAdded int + LinesRemoved int + type MergeHook func(ctx context.Context, event MergeHookEvent) + type MergeHookEvent struct + Files []FileStat + MergeCommit string + PreviousTarget string + SourceCommit string + TargetBranch string + TaskID string + WorkspaceID string type Service + func (s *Service) DiffNumStat(ctx context.Context, workspaceID, from, to string) ([]FileStat, error) + func (s *Service) SetBundleCreatedHook(h BundleCreatedHook) + func (s *Service) SetMergeHook(h MergeHook) v0.6.0 Mar 17, 2026 Changes in this version + const ProtocolID + const StatusError + const StatusOK + const TaskBranchPrefix + var ErrEmptyRepo = errors.New("empty repository") + var ErrMissingPrerequisite = errors.New("missing prerequisite commits") + type BareRepoStore struct + func NewBareRepoStore(baseDir string, logger *zap.Logger) *BareRepoStore + func (s *BareRepoStore) Init(workspaceID string) error + func (s *BareRepoStore) List() ([]string, error) + func (s *BareRepoStore) Remove(workspaceID string) error + func (s *BareRepoStore) Repo(workspaceID string) (*git.Repository, error) + func (s *BareRepoStore) RepoPath(workspaceID string) string + type BranchInfo struct + CommitHash string + IsHead bool + Name string + UpdatedAt time.Time + type CommitInfo struct + Author string + Hash string + Message string + Timestamp time.Time + type DiffPayload struct + From string + To string + type DiffResponse struct + Diff string + type FetchByHashPayload struct + CommitHash string + type FetchIncrementalPayload struct + BaseCommit string + type FetchIncrementalResponse struct + Bundle []byte + HeadCommit string + IsFull bool + type FindLeavesResponse struct + Leaves []string + type Handler struct + func NewHandler(cfg HandlerConfig) *Handler + func (h *Handler) StreamHandler() network.StreamHandler + type HandlerConfig struct + Logger *zap.Logger + MaxBundleSize int64 + Service *Service + Validator SessionValidator + type HasCommitPayload struct + CommitHash string + type HasCommitResponse struct + Exists bool + Hash string + type ListCommitsPayload struct + Limit int + type ListCommitsResponse struct + Commits []CommitInfo + type MergeResult struct + ConflictFiles []string + MergeCommit string + Message string + Success bool + type PushBundlePayload struct + Bundle []byte + CommitMsg string + SenderDID string + type PushBundleResponse struct + Applied bool + Message string + type PushIncrementalBundlePayload struct + BaseCommit string + Bundle []byte + CommitMsg string + SenderDID string + type Request struct + Payload json.RawMessage + Timestamp time.Time + Token string + Type RequestType + WorkspaceID string + type RequestType string + const RequestDiff + const RequestFetchByHash + const RequestFetchIncremental + const RequestFindLeaves + const RequestHasCommit + const RequestListCommits + const RequestPushBundle + const RequestPushIncrementalBundle + const RequestVerifyBundle + type Response struct + Data json.RawMessage + Error string + Status string + type Service struct + func NewService(store *BareRepoStore, logger *zap.Logger) *Service + func (s *Service) ApplyBundle(ctx context.Context, workspaceID string, bundle []byte) error + func (s *Service) CreateBundle(ctx context.Context, workspaceID string) ([]byte, string, error) + func (s *Service) CreateIncrementalBundle(ctx context.Context, workspaceID, baseCommit string) ([]byte, string, error) + func (s *Service) CreateTaskBranch(ctx context.Context, workspaceID, taskID, baseBranch string) error + func (s *Service) DeleteTaskBranch(ctx context.Context, workspaceID, taskID string) error + func (s *Service) Diff(ctx context.Context, workspaceID, from, to string) (string, error) + func (s *Service) HasCommit(ctx context.Context, workspaceID, commitHash string) (bool, error) + func (s *Service) Init(ctx context.Context, workspaceID string) error + func (s *Service) Leaves(ctx context.Context, workspaceID string) ([]string, error) + func (s *Service) ListBranches(ctx context.Context, workspaceID string) ([]BranchInfo, error) + func (s *Service) Log(ctx context.Context, workspaceID string, limit int) ([]CommitInfo, error) + func (s *Service) MergeTaskBranch(ctx context.Context, workspaceID, taskID, targetBranch string) (*MergeResult, error) + func (s *Service) SafeApplyBundle(ctx context.Context, workspaceID string, bundleData []byte) error + func (s *Service) VerifyBundle(ctx context.Context, workspaceID string, bundleData []byte) error + type SessionValidator func(token string) (string, bool) + type VerifyBundlePayload struct + Bundle []byte + type VerifyBundleResponse struct + Message string + Valid bool