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>
119 lines
3.8 KiB
Go
119 lines
3.8 KiB
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"strings"
|
|
)
|
|
|
|
// configSideEffect describes a hint or warning to show after a config change.
|
|
type configSideEffect struct {
|
|
Message string `json:"message"`
|
|
Command string `json:"command,omitempty"` // suggested command to run
|
|
}
|
|
|
|
// checkConfigSetSideEffects returns any hints/warnings for a config key being set.
|
|
func checkConfigSetSideEffects(key, value string) []configSideEffect {
|
|
var effects []configSideEffect
|
|
|
|
switch {
|
|
case key == "federation.remote":
|
|
effects = append(effects, configSideEffect{
|
|
Message: fmt.Sprintf("To activate, ensure a Dolt remote matches this URL: %s", value),
|
|
Command: fmt.Sprintf("bd dolt remote add origin %s", value),
|
|
})
|
|
|
|
case key == "dolt.shared-server" && strings.EqualFold(value, "true"):
|
|
effects = append(effects, configSideEffect{
|
|
Message: "Shared server mode enabled. Start the server to activate.",
|
|
Command: "bd dolt server start",
|
|
})
|
|
|
|
case key == "dolt.shared-server" && !strings.EqualFold(value, "true"):
|
|
effects = append(effects, configSideEffect{
|
|
Message: "Shared server mode disabled. Stop any running server if no longer needed.",
|
|
Command: "bd dolt server stop",
|
|
})
|
|
|
|
case key == "dolt.debug" && strings.EqualFold(value, "true"):
|
|
effects = append(effects, configSideEffect{
|
|
Message: "Debug mode will apply on the next Dolt server start (loglevel=debug, --prof cpu).",
|
|
Command: "bd dolt stop && bd dolt start",
|
|
})
|
|
|
|
case key == "dolt.debug" && !strings.EqualFold(value, "true"):
|
|
effects = append(effects, configSideEffect{
|
|
Message: "Debug mode disabled. Restart the server to drop --prof and --loglevel=debug.",
|
|
Command: "bd dolt stop && bd dolt start",
|
|
})
|
|
|
|
case key == "routing.mode":
|
|
validModes := map[string]bool{"maintainer": true, "contributor": true, "auto": true, "explicit": true}
|
|
if !validModes[value] {
|
|
effects = append(effects, configSideEffect{
|
|
Message: fmt.Sprintf("Unknown routing mode %q. Valid values: auto, maintainer, contributor, explicit", value),
|
|
})
|
|
}
|
|
|
|
case key == "backup.enabled" && strings.EqualFold(value, "true"):
|
|
effects = append(effects, configSideEffect{
|
|
Message: "Backups enabled. Backups run automatically on issue writes.",
|
|
})
|
|
|
|
case key == "sync.git-remote":
|
|
effects = append(effects, configSideEffect{
|
|
Message: fmt.Sprintf("Git sync remote set to %q. Ensure this git remote exists.", value),
|
|
Command: fmt.Sprintf("git remote -v | grep %s", value),
|
|
})
|
|
}
|
|
|
|
return effects
|
|
}
|
|
|
|
// checkConfigUnsetSideEffects returns any hints/warnings for a config key being unset.
|
|
func checkConfigUnsetSideEffects(key string) []configSideEffect {
|
|
var effects []configSideEffect
|
|
|
|
switch key {
|
|
case "federation.remote":
|
|
effects = append(effects, configSideEffect{
|
|
Message: "Federation remote removed from config. The Dolt remote still exists and can be removed manually.",
|
|
Command: "bd dolt remote remove origin",
|
|
})
|
|
|
|
case "dolt.shared-server":
|
|
effects = append(effects, configSideEffect{
|
|
Message: "Shared server config removed. Stop any running server if no longer needed.",
|
|
Command: "bd dolt server stop",
|
|
})
|
|
|
|
case "dolt.debug":
|
|
effects = append(effects, configSideEffect{
|
|
Message: "Debug config removed. Restart the server to drop --prof and --loglevel=debug.",
|
|
Command: "bd dolt stop && bd dolt start",
|
|
})
|
|
|
|
case "backup.enabled":
|
|
effects = append(effects, configSideEffect{
|
|
Message: "Backup config removed. Automatic backups will no longer run.",
|
|
})
|
|
}
|
|
|
|
return effects
|
|
}
|
|
|
|
// printConfigSideEffects displays side-effect hints to stderr (so they don't
|
|
// interfere with --json stdout output).
|
|
func printConfigSideEffects(effects []configSideEffect) {
|
|
if len(effects) == 0 {
|
|
return
|
|
}
|
|
|
|
for _, e := range effects {
|
|
fmt.Fprintf(os.Stderr, "\nHint: %s\n", e.Message)
|
|
if e.Command != "" {
|
|
fmt.Fprintf(os.Stderr, " → %s\n", e.Command)
|
|
}
|
|
}
|
|
}
|