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:
parent
98749c66f2
commit
906a535899
30 changed files with 63 additions and 39 deletions
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
mlx/build/
|
||||||
|
mlx/dist/
|
||||||
|
*.o
|
||||||
|
*.a
|
||||||
|
*.so
|
||||||
|
*.dylib
|
||||||
|
|
@ -3,7 +3,7 @@ package agentic
|
||||||
import (
|
import (
|
||||||
"slices"
|
"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,
|
// AllowanceService enforces agent quota limits. It provides pre-dispatch checks,
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"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.
|
// Client is the API client for the core-agentic service.
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"forge.lthn.ai/core/cli/pkg/log"
|
"forge.lthn.ai/core/go/pkg/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
// PROptions contains options for creating a pull request.
|
// PROptions contains options for creating a pull request.
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
errors "forge.lthn.ai/core/cli/pkg/framework/core"
|
errors "forge.lthn.ai/core/go/pkg/framework/core"
|
||||||
"forge.lthn.ai/core/cli/pkg/io"
|
"forge.lthn.ai/core/go/pkg/io"
|
||||||
"gopkg.in/yaml.v3"
|
"gopkg.in/yaml.v3"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@ import (
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
errors "forge.lthn.ai/core/cli/pkg/framework/core"
|
errors "forge.lthn.ai/core/go/pkg/framework/core"
|
||||||
"forge.lthn.ai/core/cli/pkg/io"
|
"forge.lthn.ai/core/go/pkg/io"
|
||||||
)
|
)
|
||||||
|
|
||||||
// FileContent represents the content of a file for AI context.
|
// FileContent represents the content of a file for AI context.
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@ import (
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"forge.lthn.ai/core/cli/pkg/framework"
|
"forge.lthn.ai/core/go/pkg/framework"
|
||||||
"forge.lthn.ai/core/cli/pkg/log"
|
"forge.lthn.ai/core/go/pkg/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Tasks for AI service
|
// Tasks for AI service
|
||||||
|
|
|
||||||
4
go.mod
4
go.mod
|
|
@ -3,7 +3,7 @@ module forge.lthn.ai/core/go-ai
|
||||||
go 1.25.5
|
go 1.25.5
|
||||||
|
|
||||||
require (
|
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/gorilla/websocket v1.5.3
|
||||||
github.com/marcboeker/go-duckdb v1.8.5
|
github.com/marcboeker/go-duckdb v1.8.5
|
||||||
github.com/modelcontextprotocol/go-sdk v1.3.0
|
github.com/modelcontextprotocol/go-sdk v1.3.0
|
||||||
|
|
@ -53,4 +53,4 @@ require (
|
||||||
google.golang.org/protobuf v1.36.11 // indirect
|
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
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"forge.lthn.ai/core/cli/pkg/ws"
|
"forge.lthn.ai/core/go/pkg/ws"
|
||||||
"github.com/gorilla/websocket"
|
"github.com/gorilla/websocket"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"forge.lthn.ai/core/cli/pkg/ws"
|
"forge.lthn.ai/core/go/pkg/ws"
|
||||||
"github.com/gorilla/websocket"
|
"github.com/gorilla/websocket"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ package ide
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"forge.lthn.ai/core/cli/pkg/ws"
|
"forge.lthn.ai/core/go/pkg/ws"
|
||||||
"github.com/modelcontextprotocol/go-sdk/mcp"
|
"github.com/modelcontextprotocol/go-sdk/mcp"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,10 +10,10 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"forge.lthn.ai/core/cli/pkg/io"
|
"forge.lthn.ai/core/go/pkg/io"
|
||||||
"forge.lthn.ai/core/cli/pkg/log"
|
"forge.lthn.ai/core/go/pkg/log"
|
||||||
"forge.lthn.ai/core/cli/pkg/process"
|
"forge.lthn.ai/core/go/pkg/process"
|
||||||
"forge.lthn.ai/core/cli/pkg/ws"
|
"forge.lthn.ai/core/go/pkg/ws"
|
||||||
"github.com/modelcontextprotocol/go-sdk/mcp"
|
"github.com/modelcontextprotocol/go-sdk/mcp"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"forge.lthn.ai/core/go-ai/ai"
|
"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"
|
"github.com/modelcontextprotocol/go-sdk/mcp"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"forge.lthn.ai/core/cli/pkg/log"
|
"forge.lthn.ai/core/go/pkg/log"
|
||||||
"forge.lthn.ai/core/go-ai/ml"
|
"forge.lthn.ai/core/go-ai/ml"
|
||||||
"github.com/modelcontextprotocol/go-sdk/mcp"
|
"github.com/modelcontextprotocol/go-sdk/mcp"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"forge.lthn.ai/core/cli/pkg/log"
|
"forge.lthn.ai/core/go/pkg/log"
|
||||||
"forge.lthn.ai/core/cli/pkg/process"
|
"forge.lthn.ai/core/go/pkg/process"
|
||||||
"github.com/modelcontextprotocol/go-sdk/mcp"
|
"github.com/modelcontextprotocol/go-sdk/mcp"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"forge.lthn.ai/core/cli/pkg/log"
|
"forge.lthn.ai/core/go/pkg/log"
|
||||||
"forge.lthn.ai/core/go-ai/rag"
|
"forge.lthn.ai/core/go-ai/rag"
|
||||||
"github.com/modelcontextprotocol/go-sdk/mcp"
|
"github.com/modelcontextprotocol/go-sdk/mcp"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"forge.lthn.ai/core/cli/pkg/log"
|
"forge.lthn.ai/core/go/pkg/log"
|
||||||
"forge.lthn.ai/core/cli/pkg/webview"
|
"forge.lthn.ai/core/go/pkg/webview"
|
||||||
"github.com/modelcontextprotocol/go-sdk/mcp"
|
"github.com/modelcontextprotocol/go-sdk/mcp"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"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.
|
// TestWebviewToolsRegistered_Good verifies that webview tools are registered with the MCP server.
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@ import (
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"forge.lthn.ai/core/cli/pkg/log"
|
"forge.lthn.ai/core/go/pkg/log"
|
||||||
"forge.lthn.ai/core/cli/pkg/ws"
|
"forge.lthn.ai/core/go/pkg/ws"
|
||||||
"github.com/modelcontextprotocol/go-sdk/mcp"
|
"github.com/modelcontextprotocol/go-sdk/mcp"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ package mcp
|
||||||
import (
|
import (
|
||||||
"testing"
|
"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.
|
// TestWSToolsRegistered_Good verifies that WebSocket tools are registered when hub is available.
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ package mcp
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"forge.lthn.ai/core/cli/pkg/log"
|
"forge.lthn.ai/core/go/pkg/log"
|
||||||
"github.com/modelcontextprotocol/go-sdk/mcp"
|
"github.com/modelcontextprotocol/go-sdk/mcp"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"net"
|
"net"
|
||||||
"os"
|
"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.
|
// ServeUnix starts a Unix domain socket server for the MCP service.
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"forge.lthn.ai/core/cli/pkg/log"
|
"forge.lthn.ai/core/go/pkg/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
// HTTPBackend talks to an OpenAI-compatible chat completions API.
|
// HTTPBackend talks to an OpenAI-compatible chat completions API.
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"forge.lthn.ai/core/cli/pkg/log"
|
"forge.lthn.ai/core/go/pkg/log"
|
||||||
"forge.lthn.ai/core/cli/pkg/process"
|
"forge.lthn.ai/core/go/pkg/process"
|
||||||
)
|
)
|
||||||
|
|
||||||
// LlamaBackend manages a llama-server process and delegates HTTP calls to it.
|
// LlamaBackend manages a llama-server process and delegates HTTP calls to it.
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,24 @@ type Message struct {
|
||||||
Content string `json:"content"`
|
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.
|
// DefaultGenOpts returns sensible defaults for generation.
|
||||||
func DefaultGenOpts() GenOpts {
|
func DefaultGenOpts() GenOpts {
|
||||||
return GenOpts{
|
return GenOpts{
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"sync"
|
"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.
|
// Service manages ML inference backends and scoring with Core lifecycle.
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"forge.lthn.ai/core/cli/pkg/log"
|
"forge.lthn.ai/core/go/pkg/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
// IngestConfig holds ingestion configuration.
|
// IngestConfig holds ingestion configuration.
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"net/url"
|
"net/url"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"forge.lthn.ai/core/cli/pkg/log"
|
"forge.lthn.ai/core/go/pkg/log"
|
||||||
"github.com/ollama/ollama/api"
|
"github.com/ollama/ollama/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"forge.lthn.ai/core/cli/pkg/log"
|
"forge.lthn.ai/core/go/pkg/log"
|
||||||
"github.com/qdrant/go-client/qdrant"
|
"github.com/qdrant/go-client/qdrant"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"html"
|
"html"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"forge.lthn.ai/core/cli/pkg/log"
|
"forge.lthn.ai/core/go/pkg/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
// QueryConfig holds query configuration.
|
// QueryConfig holds query configuration.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue