chore: update module paths and add gitignore

Sync module imports across agentic, mcp, ml, and rag packages.
Add .gitignore for mlx build artifacts.

Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
Snider 2026-02-17 19:19:38 +00:00
parent 98749c66f2
commit 906a535899
30 changed files with 63 additions and 39 deletions

6
.gitignore vendored Normal file
View file

@ -0,0 +1,6 @@
mlx/build/
mlx/dist/
*.o
*.a
*.so
*.dylib

View file

@ -3,7 +3,7 @@ package agentic
import (
"slices"
"forge.lthn.ai/core/cli/pkg/log"
"forge.lthn.ai/core/go/pkg/log"
)
// AllowanceService enforces agent quota limits. It provides pre-dispatch checks,

View file

@ -12,7 +12,7 @@ import (
"strings"
"time"
"forge.lthn.ai/core/cli/pkg/log"
"forge.lthn.ai/core/go/pkg/log"
)
// Client is the API client for the core-agentic service.

View file

@ -8,7 +8,7 @@ import (
"os/exec"
"strings"
"forge.lthn.ai/core/cli/pkg/log"
"forge.lthn.ai/core/go/pkg/log"
)
// PROptions contains options for creating a pull request.

View file

@ -5,8 +5,8 @@ import (
"path/filepath"
"strings"
errors "forge.lthn.ai/core/cli/pkg/framework/core"
"forge.lthn.ai/core/cli/pkg/io"
errors "forge.lthn.ai/core/go/pkg/framework/core"
"forge.lthn.ai/core/go/pkg/io"
"gopkg.in/yaml.v3"
)

View file

@ -9,8 +9,8 @@ import (
"regexp"
"strings"
errors "forge.lthn.ai/core/cli/pkg/framework/core"
"forge.lthn.ai/core/cli/pkg/io"
errors "forge.lthn.ai/core/go/pkg/framework/core"
"forge.lthn.ai/core/go/pkg/io"
)
// FileContent represents the content of a file for AI context.

View file

@ -6,8 +6,8 @@ import (
"os/exec"
"strings"
"forge.lthn.ai/core/cli/pkg/framework"
"forge.lthn.ai/core/cli/pkg/log"
"forge.lthn.ai/core/go/pkg/framework"
"forge.lthn.ai/core/go/pkg/log"
)
// Tasks for AI service

4
go.mod
View file

@ -3,7 +3,7 @@ module forge.lthn.ai/core/go-ai
go 1.25.5
require (
forge.lthn.ai/core/cli v0.0.0
forge.lthn.ai/core/go v0.0.0
github.com/gorilla/websocket v1.5.3
github.com/marcboeker/go-duckdb v1.8.5
github.com/modelcontextprotocol/go-sdk v1.3.0
@ -53,4 +53,4 @@ require (
google.golang.org/protobuf v1.36.11 // indirect
)
replace forge.lthn.ai/core/cli => /Users/claude/Code/host-uk/packages/core
replace forge.lthn.ai/core/go => ../core

View file

@ -8,7 +8,7 @@ import (
"sync"
"time"
"forge.lthn.ai/core/cli/pkg/ws"
"forge.lthn.ai/core/go/pkg/ws"
"github.com/gorilla/websocket"
)

View file

@ -9,7 +9,7 @@ import (
"testing"
"time"
"forge.lthn.ai/core/cli/pkg/ws"
"forge.lthn.ai/core/go/pkg/ws"
"github.com/gorilla/websocket"
)

View file

@ -3,7 +3,7 @@ package ide
import (
"context"
"forge.lthn.ai/core/cli/pkg/ws"
"forge.lthn.ai/core/go/pkg/ws"
"github.com/modelcontextprotocol/go-sdk/mcp"
)

View file

@ -10,10 +10,10 @@ import (
"path/filepath"
"strings"
"forge.lthn.ai/core/cli/pkg/io"
"forge.lthn.ai/core/cli/pkg/log"
"forge.lthn.ai/core/cli/pkg/process"
"forge.lthn.ai/core/cli/pkg/ws"
"forge.lthn.ai/core/go/pkg/io"
"forge.lthn.ai/core/go/pkg/log"
"forge.lthn.ai/core/go/pkg/process"
"forge.lthn.ai/core/go/pkg/ws"
"github.com/modelcontextprotocol/go-sdk/mcp"
)

View file

@ -8,7 +8,7 @@ import (
"time"
"forge.lthn.ai/core/go-ai/ai"
"forge.lthn.ai/core/cli/pkg/log"
"forge.lthn.ai/core/go/pkg/log"
"github.com/modelcontextprotocol/go-sdk/mcp"
)

View file

@ -5,7 +5,7 @@ import (
"fmt"
"strings"
"forge.lthn.ai/core/cli/pkg/log"
"forge.lthn.ai/core/go/pkg/log"
"forge.lthn.ai/core/go-ai/ml"
"github.com/modelcontextprotocol/go-sdk/mcp"
)

View file

@ -5,8 +5,8 @@ import (
"fmt"
"time"
"forge.lthn.ai/core/cli/pkg/log"
"forge.lthn.ai/core/cli/pkg/process"
"forge.lthn.ai/core/go/pkg/log"
"forge.lthn.ai/core/go/pkg/process"
"github.com/modelcontextprotocol/go-sdk/mcp"
)

View file

@ -4,7 +4,7 @@ import (
"context"
"fmt"
"forge.lthn.ai/core/cli/pkg/log"
"forge.lthn.ai/core/go/pkg/log"
"forge.lthn.ai/core/go-ai/rag"
"github.com/modelcontextprotocol/go-sdk/mcp"
)

View file

@ -6,8 +6,8 @@ import (
"fmt"
"time"
"forge.lthn.ai/core/cli/pkg/log"
"forge.lthn.ai/core/cli/pkg/webview"
"forge.lthn.ai/core/go/pkg/log"
"forge.lthn.ai/core/go/pkg/webview"
"github.com/modelcontextprotocol/go-sdk/mcp"
)

View file

@ -4,7 +4,7 @@ import (
"testing"
"time"
"forge.lthn.ai/core/cli/pkg/webview"
"forge.lthn.ai/core/go/pkg/webview"
)
// TestWebviewToolsRegistered_Good verifies that webview tools are registered with the MCP server.

View file

@ -6,8 +6,8 @@ import (
"net"
"net/http"
"forge.lthn.ai/core/cli/pkg/log"
"forge.lthn.ai/core/cli/pkg/ws"
"forge.lthn.ai/core/go/pkg/log"
"forge.lthn.ai/core/go/pkg/ws"
"github.com/modelcontextprotocol/go-sdk/mcp"
)

View file

@ -3,7 +3,7 @@ package mcp
import (
"testing"
"forge.lthn.ai/core/cli/pkg/ws"
"forge.lthn.ai/core/go/pkg/ws"
)
// TestWSToolsRegistered_Good verifies that WebSocket tools are registered when hub is available.

View file

@ -3,7 +3,7 @@ package mcp
import (
"context"
"forge.lthn.ai/core/cli/pkg/log"
"forge.lthn.ai/core/go/pkg/log"
"github.com/modelcontextprotocol/go-sdk/mcp"
)

View file

@ -5,7 +5,7 @@ import (
"net"
"os"
"forge.lthn.ai/core/cli/pkg/log"
"forge.lthn.ai/core/go/pkg/log"
)
// ServeUnix starts a Unix domain socket server for the MCP service.

View file

@ -10,7 +10,7 @@ import (
"net/http"
"time"
"forge.lthn.ai/core/cli/pkg/log"
"forge.lthn.ai/core/go/pkg/log"
)
// HTTPBackend talks to an OpenAI-compatible chat completions API.

View file

@ -6,8 +6,8 @@ import (
"net/http"
"time"
"forge.lthn.ai/core/cli/pkg/log"
"forge.lthn.ai/core/cli/pkg/process"
"forge.lthn.ai/core/go/pkg/log"
"forge.lthn.ai/core/go/pkg/process"
)
// LlamaBackend manages a llama-server process and delegates HTTP calls to it.

View file

@ -43,6 +43,24 @@ type Message struct {
Content string `json:"content"`
}
// TokenCallback receives each generated token as text. Return a non-nil
// error to stop generation early (e.g. client disconnect).
type TokenCallback func(token string) error
// StreamingBackend extends Backend with token-by-token streaming.
// Backends that generate tokens incrementally (e.g. MLX) should implement
// this interface. The serve handler uses SSE when the client sends
// "stream": true and the active backend satisfies StreamingBackend.
type StreamingBackend interface {
Backend
// GenerateStream streams tokens from a single prompt via the callback.
GenerateStream(ctx context.Context, prompt string, opts GenOpts, cb TokenCallback) error
// ChatStream streams tokens from a chat conversation via the callback.
ChatStream(ctx context.Context, messages []Message, opts GenOpts, cb TokenCallback) error
}
// DefaultGenOpts returns sensible defaults for generation.
func DefaultGenOpts() GenOpts {
return GenOpts{

View file

@ -5,7 +5,7 @@ import (
"fmt"
"sync"
"forge.lthn.ai/core/cli/pkg/framework"
"forge.lthn.ai/core/go/pkg/framework"
)
// Service manages ML inference backends and scoring with Core lifecycle.

View file

@ -8,7 +8,7 @@ import (
"path/filepath"
"strings"
"forge.lthn.ai/core/cli/pkg/log"
"forge.lthn.ai/core/go/pkg/log"
)
// IngestConfig holds ingestion configuration.

View file

@ -7,7 +7,7 @@ import (
"net/url"
"time"
"forge.lthn.ai/core/cli/pkg/log"
"forge.lthn.ai/core/go/pkg/log"
"github.com/ollama/ollama/api"
)

View file

@ -6,7 +6,7 @@ import (
"context"
"fmt"
"forge.lthn.ai/core/cli/pkg/log"
"forge.lthn.ai/core/go/pkg/log"
"github.com/qdrant/go-client/qdrant"
)

View file

@ -6,7 +6,7 @@ import (
"html"
"strings"
"forge.lthn.ai/core/cli/pkg/log"
"forge.lthn.ai/core/go/pkg/log"
)
// QueryConfig holds query configuration.