diff --git a/allowance_service.go b/allowance_service.go index 2e9e1b0..05b6fc0 100644 --- a/allowance_service.go +++ b/allowance_service.go @@ -5,7 +5,7 @@ import ( "slices" "time" - "forge.lthn.ai/core/go/pkg/log" + "forge.lthn.ai/core/go-log" ) // AllowanceService enforces agent quota limits. It provides pre-dispatch checks, diff --git a/brain.go b/brain.go index 9716f5f..8aca7c6 100644 --- a/brain.go +++ b/brain.go @@ -8,7 +8,7 @@ import ( "net/http" "net/url" - "forge.lthn.ai/core/go/pkg/log" + "forge.lthn.ai/core/go-log" ) // MemoryType represents the classification of a brain memory. diff --git a/client.go b/client.go index 9c38f3c..c2d0218 100644 --- a/client.go +++ b/client.go @@ -12,7 +12,7 @@ import ( "strings" "time" - "forge.lthn.ai/core/go/pkg/log" + "forge.lthn.ai/core/go-log" ) // Client is the API client for the core-agentic service. diff --git a/cmd/tasks/cmd.go b/cmd/tasks/cmd.go index 31b9779..3edd150 100644 --- a/cmd/tasks/cmd.go +++ b/cmd/tasks/cmd.go @@ -12,7 +12,7 @@ import ( "forge.lthn.ai/core/cli/pkg/cli" "forge.lthn.ai/core/go-agentic" "forge.lthn.ai/core/go-ai/ai" - "forge.lthn.ai/core/go/pkg/i18n" + "forge.lthn.ai/core/go-i18n" ) // Style aliases from shared package diff --git a/cmd/tasks/updates.go b/cmd/tasks/updates.go index f8931e6..d699a0c 100644 --- a/cmd/tasks/updates.go +++ b/cmd/tasks/updates.go @@ -9,7 +9,7 @@ import ( "forge.lthn.ai/core/go-agentic" "forge.lthn.ai/core/go-ai/ai" "forge.lthn.ai/core/cli/pkg/cli" - "forge.lthn.ai/core/go/pkg/i18n" + "forge.lthn.ai/core/go-i18n" ) // task:update command flags diff --git a/cmd/workspace/cmd_agent.go b/cmd/workspace/cmd_agent.go index 8d0697e..b1589d0 100644 --- a/cmd/workspace/cmd_agent.go +++ b/cmd/workspace/cmd_agent.go @@ -30,7 +30,7 @@ import ( "time" "forge.lthn.ai/core/cli/pkg/cli" - coreio "forge.lthn.ai/core/go/pkg/io" + coreio "forge.lthn.ai/core/go-io" "github.com/spf13/cobra" ) diff --git a/cmd/workspace/cmd_task.go b/cmd/workspace/cmd_task.go index 5f29b32..908a7e6 100644 --- a/cmd/workspace/cmd_task.go +++ b/cmd/workspace/cmd_task.go @@ -18,7 +18,7 @@ import ( "strings" "forge.lthn.ai/core/cli/pkg/cli" - coreio "forge.lthn.ai/core/go/pkg/io" + coreio "forge.lthn.ai/core/go-io" "forge.lthn.ai/core/go/pkg/repos" "github.com/spf13/cobra" ) diff --git a/cmd/workspace/config.go b/cmd/workspace/config.go index b5ad997..3811353 100644 --- a/cmd/workspace/config.go +++ b/cmd/workspace/config.go @@ -6,7 +6,7 @@ import ( "os" "path/filepath" - coreio "forge.lthn.ai/core/go/pkg/io" + coreio "forge.lthn.ai/core/go-io" "gopkg.in/yaml.v3" ) diff --git a/completion.go b/completion.go index 5647add..661ffc4 100644 --- a/completion.go +++ b/completion.go @@ -8,7 +8,7 @@ import ( "os/exec" "strings" - "forge.lthn.ai/core/go/pkg/log" + "forge.lthn.ai/core/go-log" ) // PROptions contains options for creating a pull request. diff --git a/config.go b/config.go index 390937c..0dd9a2f 100644 --- a/config.go +++ b/config.go @@ -5,8 +5,8 @@ import ( "path/filepath" "strings" - errors "forge.lthn.ai/core/go/pkg/framework/core" - "forge.lthn.ai/core/go/pkg/io" + "forge.lthn.ai/core/go-io" + "forge.lthn.ai/core/go-log" "gopkg.in/yaml.v3" ) @@ -77,12 +77,12 @@ func LoadConfig(dir string) (*Config, error) { // Try loading from ~/.core/agentic.yaml homeDir, err := os.UserHomeDir() if err != nil { - return nil, errors.E("agentic.LoadConfig", "failed to get home directory", err) + return nil, log.E("agentic.LoadConfig", "failed to get home directory", err) } configPath := filepath.Join(homeDir, ".core", configFileName) if err := loadYAMLConfig(configPath, cfg); err != nil && !os.IsNotExist(err) { - return nil, errors.E("agentic.LoadConfig", "failed to load config", err) + return nil, log.E("agentic.LoadConfig", "failed to load config", err) } // Apply environment variable overrides @@ -90,7 +90,7 @@ func LoadConfig(dir string) (*Config, error) { // Validate configuration if cfg.Token == "" { - return nil, errors.E("agentic.LoadConfig", "no authentication token configured", nil) + return nil, log.E("agentic.LoadConfig", "no authentication token configured", nil) } return cfg, nil @@ -168,23 +168,23 @@ func applyEnvOverrides(cfg *Config) { func SaveConfig(cfg *Config) error { homeDir, err := os.UserHomeDir() if err != nil { - return errors.E("agentic.SaveConfig", "failed to get home directory", err) + return log.E("agentic.SaveConfig", "failed to get home directory", err) } configDir := filepath.Join(homeDir, ".core") if err := io.Local.EnsureDir(configDir); err != nil { - return errors.E("agentic.SaveConfig", "failed to create config directory", err) + return log.E("agentic.SaveConfig", "failed to create config directory", err) } configPath := filepath.Join(configDir, configFileName) data, err := yaml.Marshal(cfg) if err != nil { - return errors.E("agentic.SaveConfig", "failed to marshal config", err) + return log.E("agentic.SaveConfig", "failed to marshal config", err) } if err := io.Local.Write(configPath, string(data)); err != nil { - return errors.E("agentic.SaveConfig", "failed to write config file", err) + return log.E("agentic.SaveConfig", "failed to write config file", err) } return nil @@ -194,7 +194,7 @@ func SaveConfig(cfg *Config) error { func ConfigPath() (string, error) { homeDir, err := os.UserHomeDir() if err != nil { - return "", errors.E("agentic.ConfigPath", "failed to get home directory", err) + return "", log.E("agentic.ConfigPath", "failed to get home directory", err) } return filepath.Join(homeDir, ".core", configFileName), nil } @@ -214,7 +214,7 @@ type AllowanceConfig struct { func DefaultAllowanceStorePath() (string, error) { homeDir, err := os.UserHomeDir() if err != nil { - return "", errors.E("agentic.DefaultAllowanceStorePath", "failed to get home directory", err) + return "", log.E("agentic.DefaultAllowanceStorePath", "failed to get home directory", err) } return filepath.Join(homeDir, ".config", "agentic", "allowance.db"), nil } @@ -260,7 +260,7 @@ type RegistryConfig struct { func DefaultRegistryPath() (string, error) { homeDir, err := os.UserHomeDir() if err != nil { - return "", errors.E("agentic.DefaultRegistryPath", "failed to get home directory", err) + return "", log.E("agentic.DefaultRegistryPath", "failed to get home directory", err) } return filepath.Join(homeDir, ".config", "agentic", "registry.db"), nil } diff --git a/context.go b/context.go index 5545c0c..ac9eabe 100644 --- a/context.go +++ b/context.go @@ -9,8 +9,8 @@ import ( "regexp" "strings" - errors "forge.lthn.ai/core/go/pkg/framework/core" - "forge.lthn.ai/core/go/pkg/io" + "forge.lthn.ai/core/go-io" + "forge.lthn.ai/core/go-log" ) // FileContent represents the content of a file for AI context. @@ -42,13 +42,13 @@ func BuildTaskContext(task *Task, dir string) (*TaskContext, error) { const op = "agentic.BuildTaskContext" if task == nil { - return nil, errors.E(op, "task is required", nil) + return nil, log.E(op, "task is required", nil) } if dir == "" { cwd, err := os.Getwd() if err != nil { - return nil, errors.E(op, "failed to get working directory", err) + return nil, log.E(op, "failed to get working directory", err) } dir = cwd } @@ -88,7 +88,7 @@ func GatherRelatedFiles(task *Task, dir string) ([]FileContent, error) { const op = "agentic.GatherRelatedFiles" if task == nil { - return nil, errors.E(op, "task is required", nil) + return nil, log.E(op, "task is required", nil) } var files []FileContent @@ -118,7 +118,7 @@ func findRelatedCode(task *Task, dir string) ([]FileContent, error) { const op = "agentic.findRelatedCode" if task == nil { - return nil, errors.E(op, "task is required", nil) + return nil, log.E(op, "task is required", nil) } // Extract keywords from title and description diff --git a/dispatcher.go b/dispatcher.go index 3dbe1d6..e37ec68 100644 --- a/dispatcher.go +++ b/dispatcher.go @@ -6,7 +6,7 @@ import ( "slices" "time" - "forge.lthn.ai/core/go/pkg/log" + "forge.lthn.ai/core/go-log" ) const ( diff --git a/go.mod b/go.mod index 2b81316..9d065f9 100644 --- a/go.mod +++ b/go.mod @@ -6,6 +6,9 @@ require ( forge.lthn.ai/core/cli v0.1.0 forge.lthn.ai/core/go v0.1.0 forge.lthn.ai/core/go-ai v0.1.0 + forge.lthn.ai/core/go-i18n v0.1.0 + forge.lthn.ai/core/go-io v0.0.1 + forge.lthn.ai/core/go-log v0.0.1 forge.lthn.ai/core/go-store v0.1.3 github.com/redis/go-redis/v9 v9.18.0 github.com/spf13/cobra v1.10.2 @@ -16,6 +19,7 @@ require ( require ( forge.lthn.ai/core/go-crypt v0.1.0 // indirect + forge.lthn.ai/core/go-inference v0.0.2 // indirect forge.lthn.ai/core/go-rag v0.1.0 // indirect github.com/ProtonMail/go-crypto v1.3.0 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect diff --git a/go.sum b/go.sum index 0eb255b..43b6e5e 100644 --- a/go.sum +++ b/go.sum @@ -6,6 +6,14 @@ forge.lthn.ai/core/go-ai v0.1.0 h1:Z7Gbxsq4d8vnO35zZxJXvk8wEUGSazpxncN1voJkNT0= forge.lthn.ai/core/go-ai v0.1.0/go.mod h1:YUsCZmWereE2wZPDEmk46Xu+xxmfsNZktpY7H9jgNJI= forge.lthn.ai/core/go-crypt v0.1.0 h1:92gwdQi7iAwktpvZhL/8Cu+QS6xKCtGP4FJfyInPGnw= forge.lthn.ai/core/go-crypt v0.1.0/go.mod h1:zVAgx6ZiGtC+dbX4R/VKvEPqsEqjyuLl4gQZH9SXBUw= +forge.lthn.ai/core/go-i18n v0.1.0 h1:F7JVSoVkZtzx9JfhpntM9z3iQm1vnuMUi/Zklhz8PCI= +forge.lthn.ai/core/go-i18n v0.1.0/go.mod h1:Q4xsrxuNCl/6NfMv1daria7t1RSiyy8ml+6jiPtUcBs= +forge.lthn.ai/core/go-inference v0.0.2 h1:aHjBkYyLKxLr9tbO4AvzzV/lsZueGq/jeo33SLh113k= +forge.lthn.ai/core/go-inference v0.0.2/go.mod h1:jfWz+IJX55wAH98+ic6FEqqGB6/P31CHlg7VY7pxREw= +forge.lthn.ai/core/go-io v0.0.1 h1:N/GCl6Asusfr4gs53JZixJVtqcnerQ6GcxSN8F8iJXY= +forge.lthn.ai/core/go-io v0.0.1/go.mod h1:l+gG/G5TMIOTG8G7y0dg4fh1a7Suy8wCYVwsz4duV7M= +forge.lthn.ai/core/go-log v0.0.1 h1:x/E6EfF9vixzqiLHQOl2KT25HyBcMc9qiBkomqVlpPg= +forge.lthn.ai/core/go-log v0.0.1/go.mod h1:r14MXKOD3LF/sI8XUJQhRk/SZHBE7jAFVuCfgkXoZPw= forge.lthn.ai/core/go-rag v0.1.0 h1:H5umiRryuq6J6l889s0OsxWpmq5P5c3A9Bkj0cQyO7k= forge.lthn.ai/core/go-rag v0.1.0/go.mod h1:bB8Fy98G2zxVoe7k2B85gXvim6frJdbAMnDyW4peUVU= forge.lthn.ai/core/go-store v0.1.3 h1:CSVTRdsOXm2pl+FCs12fHOc9eM88DcZRY6HghN98w/I= diff --git a/logs.go b/logs.go index ff11411..bb72cb2 100644 --- a/logs.go +++ b/logs.go @@ -6,7 +6,7 @@ import ( "io" "time" - "forge.lthn.ai/core/go/pkg/log" + "forge.lthn.ai/core/go-log" ) // StreamLogs polls a task's status and writes updates to writer. It polls at diff --git a/plan_dispatcher.go b/plan_dispatcher.go index fd76e11..b91d356 100644 --- a/plan_dispatcher.go +++ b/plan_dispatcher.go @@ -4,7 +4,7 @@ import ( "context" "time" - "forge.lthn.ai/core/go/pkg/log" + "forge.lthn.ai/core/go-log" ) // PlanDispatcher orchestrates plan-based work by polling active plans, diff --git a/plans.go b/plans.go index a236a03..e7041ae 100644 --- a/plans.go +++ b/plans.go @@ -8,7 +8,7 @@ import ( "net/http" "net/url" - "forge.lthn.ai/core/go/pkg/log" + "forge.lthn.ai/core/go-log" ) // PlanStatus represents the state of a plan. diff --git a/score.go b/score.go index feb15a0..7de5932 100644 --- a/score.go +++ b/score.go @@ -6,7 +6,7 @@ import ( "encoding/json" "net/http" - "forge.lthn.ai/core/go/pkg/log" + "forge.lthn.ai/core/go-log" ) // ScoreContentRequest is the payload for content scoring. diff --git a/service.go b/service.go index 938563e..cc15078 100644 --- a/service.go +++ b/service.go @@ -7,7 +7,7 @@ import ( "strings" "forge.lthn.ai/core/go/pkg/framework" - "forge.lthn.ai/core/go/pkg/log" + "forge.lthn.ai/core/go-log" ) // Tasks for AI service diff --git a/sessions.go b/sessions.go index 7e74caa..5a4004a 100644 --- a/sessions.go +++ b/sessions.go @@ -9,7 +9,7 @@ import ( "net/url" "strconv" - "forge.lthn.ai/core/go/pkg/log" + "forge.lthn.ai/core/go-log" ) // SessionStatus represents the state of a session. diff --git a/status.go b/status.go index 7df00b6..66eea8b 100644 --- a/status.go +++ b/status.go @@ -7,7 +7,7 @@ import ( "slices" "strings" - "forge.lthn.ai/core/go/pkg/log" + "forge.lthn.ai/core/go-log" ) // StatusSummary aggregates status from the agent registry, task client, and diff --git a/submit.go b/submit.go index 517434c..0f371b9 100644 --- a/submit.go +++ b/submit.go @@ -4,7 +4,7 @@ import ( "context" "time" - "forge.lthn.ai/core/go/pkg/log" + "forge.lthn.ai/core/go-log" ) // SubmitTask creates a new task with the given parameters via the API client.