mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-27 07:16:19 +09:00
refactor: multi-provider memory adapters with scan-based builtin (#227)
* refactor: restructure memory into multi-provider adapters, remove manifest.json dependency - Rename internal/memory/provider to internal/memory/adapters with per-provider subdirectories (builtin, mem0, openviking) - Replace manifest.json-based delete/update with scan-based index from daily files - Add mem0 and openviking provider adapters with HTTP client, chat hooks, MCP tools, and CRUD - Wire provider lifecycle into registry (auto-instantiate on create, evict on update/delete) - Split docker-compose into base stack + optional overlays (qdrant, browser, mem0, openviking) - Update admin UI to support dynamic provider config schema rendering * chore(lint): fix all golangci-lint issues for clean CI * refactor(docker): replace compose overlay files with profiles * feat(memory): add built-in memory multi modes * fix(ci): golangci lint * feat(memory): edit built-in memory sparse design
This commit is contained in:
@@ -201,7 +201,7 @@ func (c *imapConn) connectAndReceive(ctx context.Context) error {
|
||||
}
|
||||
|
||||
opts := &imapclient.Options{
|
||||
TLSConfig: &tls.Config{ServerName: c.host},
|
||||
TLSConfig: &tls.Config{ServerName: c.host, MinVersion: tls.VersionTLS12},
|
||||
UnilateralDataHandler: &imapclient.UnilateralDataHandler{
|
||||
Mailbox: func(data *imapclient.UnilateralDataMailbox) {
|
||||
if data.NumMessages != nil {
|
||||
@@ -381,7 +381,7 @@ func (*Adapter) dialIMAP(config map[string]any) (*imapclient.Client, error) {
|
||||
security, _ := config["imap_security"].(string)
|
||||
|
||||
addr := fmt.Sprintf("%s:%d", host, port)
|
||||
opts := &imapclient.Options{TLSConfig: &tls.Config{ServerName: host}}
|
||||
opts := &imapclient.Options{TLSConfig: &tls.Config{ServerName: host, MinVersion: tls.VersionTLS12}}
|
||||
|
||||
var client *imapclient.Client
|
||||
var err error
|
||||
@@ -441,7 +441,7 @@ func (a *Adapter) ListMailbox(_ context.Context, config map[string]any, page, pa
|
||||
if start > math.MaxUint32 || end > math.MaxUint32 {
|
||||
return nil, 0, fmt.Errorf("mail sequence range out of bounds: start=%d end=%d", start, end)
|
||||
}
|
||||
seqSet.AddRange(uint32(start), uint32(end))
|
||||
seqSet.AddRange(uint32(start), uint32(end)) //nolint:gosec // bounds checked above
|
||||
|
||||
fetchOpts := &imap.FetchOptions{
|
||||
Envelope: true,
|
||||
|
||||
@@ -335,7 +335,7 @@ func (a *Adapter) ListMailbox(ctx context.Context, config map[string]any, page,
|
||||
if start > math.MaxUint32 || end > math.MaxUint32 {
|
||||
return nil, 0, fmt.Errorf("mail sequence range out of bounds: start=%d end=%d", start, end)
|
||||
}
|
||||
seqSet.AddRange(uint32(start), uint32(end))
|
||||
seqSet.AddRange(uint32(start), uint32(end)) //nolint:gosec // bounds checked above
|
||||
|
||||
fetchOpts := &imap.FetchOptions{Envelope: true, UID: true}
|
||||
fetchCmd := client.Fetch(seqSet, fetchOpts)
|
||||
@@ -415,7 +415,7 @@ func (a *Adapter) dialIMAP(ctx context.Context, config map[string]any) (*imapcli
|
||||
}
|
||||
|
||||
opts := &imapclient.Options{
|
||||
TLSConfig: &tls.Config{ServerName: "imap.gmail.com"},
|
||||
TLSConfig: &tls.Config{ServerName: "imap.gmail.com", MinVersion: tls.VersionTLS12},
|
||||
}
|
||||
client, err := imapclient.DialTLS("imap.gmail.com:993", opts)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user