Convert gitgram/ and aitimemachine/ from embedded git repos (which showed as opaque submodule gitlinks on GitHub) into fully-tracked first-party content. AITM now merges its 7 vendored repos as first-party engines: - memory: beads (Go task DAG) + context7 (docs SDK), unified into saved_contexts - git: vendored C git (bundled binary) + gitnexus (in-process code intelligence) - agentic: a2a (@a2a-js/sdk) + pal (AITM-managed Python subprocess) Includes the full session's product build: Gitgram web/mobile/backend features, AITM website/CLI/MCP, the unified memory layer, engine build tooling (scripts/build-engines.sh, Dockerfile, CI), docs (README, ENGINES.md, ARCHITECTURE.md), and extensive test suites. Build artifacts, node_modules, external/, and gemini-cli are gitignored. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
91 lines
2.1 KiB
Go
91 lines
2.1 KiB
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/spf13/cobra"
|
|
"github.com/steveyegge/beads/internal/ui"
|
|
)
|
|
|
|
var assignCmd = &cobra.Command{
|
|
Use: "assign <id> <name>",
|
|
GroupID: "issues",
|
|
Short: "Assign an issue to someone",
|
|
Long: `Assign an issue to someone.
|
|
|
|
Shorthand for 'bd update <id> --assignee <name>'.
|
|
|
|
Examples:
|
|
bd assign bd-123 alice
|
|
bd assign bd-123 "" # unassign`,
|
|
Args: cobra.ExactArgs(2),
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
CheckReadonly("assign")
|
|
|
|
id := args[0]
|
|
assignee := args[1]
|
|
|
|
ctx := rootCtx
|
|
|
|
result, err := resolveAndGetIssueForMutation(ctx, store, id)
|
|
if err != nil {
|
|
if result != nil {
|
|
result.Close()
|
|
}
|
|
FatalErrorRespectJSON("resolving %s: %v", id, err)
|
|
}
|
|
if result == nil || result.Issue == nil {
|
|
if result != nil {
|
|
result.Close()
|
|
}
|
|
FatalErrorRespectJSON("issue %s not found", id)
|
|
}
|
|
defer result.Close()
|
|
|
|
issueStore := result.Store
|
|
|
|
if err := validateIssueUpdatable(id, result.Issue); err != nil {
|
|
FatalErrorRespectJSON("%s", err)
|
|
}
|
|
|
|
updates := map[string]interface{}{
|
|
"assignee": assignee,
|
|
}
|
|
if err := issueStore.UpdateIssue(ctx, result.ResolvedID, updates, actor); err != nil {
|
|
FatalErrorRespectJSON("updating %s: %v", id, err)
|
|
}
|
|
|
|
if err := commitPendingIfEmbedded(ctx, issueStore, actor, doltAutoCommitParams{
|
|
Command: "assign",
|
|
IssueIDs: []string{result.ResolvedID},
|
|
}); err != nil {
|
|
FatalErrorRespectJSON("failed to commit: %v", err)
|
|
}
|
|
|
|
SetLastTouchedID(result.ResolvedID)
|
|
|
|
// Re-fetch for display
|
|
updatedIssue, _ := issueStore.GetIssue(ctx, result.ResolvedID)
|
|
title := ""
|
|
if updatedIssue != nil {
|
|
title = updatedIssue.Title
|
|
}
|
|
if jsonOutput {
|
|
if updatedIssue != nil {
|
|
outputJSON(updatedIssue)
|
|
}
|
|
} else {
|
|
if assignee == "" {
|
|
fmt.Printf("%s Unassigned %s\n", ui.RenderPass("✓"), formatFeedbackID(result.ResolvedID, title))
|
|
} else {
|
|
fmt.Printf("%s Assigned %s to %s\n", ui.RenderPass("✓"), formatFeedbackID(result.ResolvedID, title), assignee)
|
|
}
|
|
}
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
assignCmd.ValidArgsFunction = issueIDCompletion
|
|
rootCmd.AddCommand(assignCmd)
|
|
}
|