+// createAgent writes the config.json of a new agent in dir with the defaults
+// and a new ID.
+func createAgent(dir string) (*Agent, error) {
+ config, err := defaultAgentConfig()
+ if err != nil {
+ return nil, fmt.Errorf("prepare agent defaults: %w", err)
+ }
+
+ return writeAgent(dir, config)
+}
+
+// defaultAgentConfig returns the settings of a new agent, without an ID. The
+// commands run in the home directory of the user.
+func defaultAgentConfig() (AgentConfig, error) {
+ home, err := os.UserHomeDir()
+ if err != nil {
+ return AgentConfig{}, fmt.Errorf("find working directory: %w", err)
+ }
+
+ return AgentConfig{
+ Name: "OneChat",
+ Model: "gpt-6.1-sol",
+ Effort: "medium",
+ Workdir: home,
+ }, nil
+}
+