Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ the open-source home for EverMe CLI and agent plugins.

### CLI

- Add a SeekMoon reader to `evercli import conversations`. SeekMoon keeps one
transcript per conversation inside the workspace it belongs to
(`<workspace>/.openseek/sessions/<session-id>/openseek_session-<session-id>.jsonl`),
so the scan roots come from SeekMoon's own `workspaces.json` rather than a
home directory. `user`, `assistant` (with its tool calls) and `tool_result`
records are imported; `runtime_notice`, `terminal` and the assistant's
`reasoning_content` are skipped as app bookkeeping. Uploading needs the
platform's agent token from SeekMoon's `host-mcp.json`, which
`plugin install seekmoon` writes.
- Derive the "Use one of: …" platform hint from the registry instead of
repeating the list at each call site.
- Sync the `cli/` Go tree to the `evercli` v0.32.0 release. Earlier public
snapshots trailed the published binaries; the tree now matches what
`npm install -g @everme/cli` and the release archives ship.
Expand Down
4 changes: 2 additions & 2 deletions cli/cmd/imports/conversations.go
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ Use --path to override the scan root for a specific platform.`,
} else {
ids, perr := conversation.ParsePlatforms(requested)
if perr != nil {
return deps.Out.Err(output.Invalid(perr.Error(), "Use one of: claude-code, codex, hermes, openclaw, markdown, kimicode, raven, workbuddy"))
return deps.Out.Err(output.Invalid(perr.Error(), "Use one of: "+conversation.PlatformList()))
}
platformIDs = ids
}
Expand Down Expand Up @@ -652,7 +652,7 @@ Flags:
} else {
ids, perr := conversation.ParsePlatforms(effectivePlatforms)
if perr != nil {
return deps.Out.Err(output.Invalid(perr.Error(), "Use one of: claude-code, codex, hermes, openclaw, markdown, kimicode, raven, workbuddy"))
return deps.Out.Err(output.Invalid(perr.Error(), "Use one of: "+conversation.PlatformList()))
}
platformIDs = ids
}
Expand Down
69 changes: 69 additions & 0 deletions cli/internal/importer/conversation/evt.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"os"
"path/filepath"
"runtime"
"strings"

"github.com/pelletier/go-toml/v2"
Expand Down Expand Up @@ -192,6 +193,72 @@ func resolveWorkBuddyEvt() (string, error) {
return tok, nil
}

// seekMoonRuntimeDir returns SeekMoon's runtime directory, where the desktop
// keeps both host-mcp.json and workspaces.json. Mirrors
// cli/internal/plugin/seekmoon.go seekMoonConfigDir, env override included.
func seekMoonRuntimeDir() (string, error) {
if dir := os.Getenv("EVERCLI_SEEKMOON_CONFIG_DIR"); dir != "" {
return dir, nil
}
home, err := os.UserHomeDir()
if err != nil {
return "", err
}
switch runtime.GOOS {
case "darwin":
return filepath.Join(home, "Library", "Application Support", "SeekMoon"), nil
case "windows":
if appdata, err := os.UserConfigDir(); err == nil && appdata != "" {
return filepath.Join(appdata, "SeekMoon"), nil
}
return filepath.Join(home, "AppData", "Roaming", "SeekMoon"), nil
default:
return filepath.Join(home, ".config", "SeekMoon"), nil
}
}

// seekMoonEvtHint is the actionable half of every seekmoon credential error.
// The usual source of the token is `plugin install`, which needs the EverMe
// backend to accept the platform, so say what to do when that is not available.
func seekMoonEvtHint(path string) string {
return "run `evercli plugin install seekmoon` (it needs the EverMe backend to accept the " +
"seekmoon platform), or add EVERME_AGENT_TOKEN to mcpServers[\"everme-memory\"].env in " + path
}

// resolveSeekMoonEvt reads EVERME_AGENT_TOKEN from SeekMoon's host-mcp.json at
// mcpServers["everme-memory"].env — the entry the seekmoon installer writes
// through the shared mcpWriter (cli/internal/plugin/seekmoon.go buildEntry).
// SeekMoon keeps its own `seekmoon` entry in that file too; only ours carries
// the EverMe credential.
func resolveSeekMoonEvt() (string, error) {
dir, err := seekMoonRuntimeDir()
if err != nil {
return "", fmt.Errorf("resolve seekmoon runtime dir: %w", err)
}
path := filepath.Join(dir, "host-mcp.json")
raw, err := os.ReadFile(path)
if err != nil {
return "", fmt.Errorf("read seekmoon config %s: %w; %s", path, err, seekMoonEvtHint(path))
}
var cfg struct {
McpServers map[string]struct {
Env map[string]string `json:"env"`
} `json:"mcpServers"`
}
if err := json.Unmarshal(raw, &cfg); err != nil {
return "", fmt.Errorf("parse seekmoon config %s: %w", path, err)
}
entry, ok := cfg.McpServers["everme-memory"]
if !ok {
return "", fmt.Errorf(`seekmoon config %s has no mcpServers["everme-memory"] entry; %s`, path, seekMoonEvtHint(path))
}
tok := strings.TrimSpace(entry.Env["EVERME_AGENT_TOKEN"])
if tok == "" {
return "", fmt.Errorf(`EVERME_AGENT_TOKEN is empty in mcpServers["everme-memory"].env of %s; %s`, path, seekMoonEvtHint(path))
}
return tok, nil
}

func envOr(key, def string) string {
if v := os.Getenv(key); v != "" {
return v
Expand Down Expand Up @@ -236,6 +303,8 @@ func ResolveEvt(p PlatformID) (string, error) {
return resolveRavenEvt()
case PlatformWorkBuddy:
return resolveWorkBuddyEvt()
case PlatformSeekMoon:
return resolveSeekMoonEvt()
}
path, ok := platformEnvFile(p)
if !ok {
Expand Down
16 changes: 15 additions & 1 deletion cli/internal/importer/conversation/platforms.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"os"
"path/filepath"
"sort"
"strings"
)

Expand All @@ -18,6 +19,19 @@ var knownPlatforms = map[PlatformID]struct{}{
PlatformKimicode: {},
PlatformRaven: {},
PlatformWorkBuddy: {},
PlatformSeekMoon: {},
}

// PlatformList renders the known platform names for CLI hints. Callers use it
// instead of repeating the list, so a new platform cannot be accepted by
// ParsePlatforms while the hint still tells the user it does not exist.
func PlatformList() string {
names := make([]string, 0, len(knownPlatforms))
for p := range knownPlatforms {
names = append(names, string(p))
}
sort.Strings(names)
return strings.Join(names, ", ")
}

// IsKnownPlatform reports whether p is one of the supported platform names.
Expand All @@ -34,7 +48,7 @@ func ParsePlatforms(names []string) ([]PlatformID, error) {
for _, n := range names {
p := PlatformID(strings.TrimSpace(n))
if !IsKnownPlatform(p) {
return nil, fmt.Errorf("unknown platform %q (known: claude-code, codex, hermes, openclaw, markdown, kimicode, raven, workbuddy)", n)
return nil, fmt.Errorf("unknown platform %q (known: %s)", n, PlatformList())
}
ids = append(ids, p)
}
Expand Down
5 changes: 5 additions & 0 deletions cli/internal/importer/conversation/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ func DefaultRegistry() *Registry {
NewKimicodeScanner(),
NewRavenScanner(),
NewWorkBuddyScanner(),
NewSeekMoonScanner(),
},
}
}
Expand Down Expand Up @@ -75,6 +76,10 @@ func DefaultRoots(p PlatformID) []string {
// env var name, so the two doors into ~/.workbuddy agree.
base := envOr("EVERCLI_WORKBUDDY_CONFIG_DIR", filepath.Join(home, ".workbuddy"))
return []string{filepath.Join(base, "projects")}
case PlatformSeekMoon:
// SeekMoon keeps sessions with their workspace, not in one home dir:
// the roots come from the desktop's own workspace registry.
return seekMoonSessionRoots()
case PlatformMarkdown:
// A markdown file's owning agent is the agent whose local folder
// contains it; scan the agent home dirs (not generic doc dirs) so md
Expand Down
Loading