9p: drive SessionStore.Get from sessionStoreFiles map

Eliminates the explicit script name list — any entry in sessionStoreFiles
beyond "new" and "idx" is automatically served from disk.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Levi Neely 2026-04-18 11:33:11 +02:00
parent 5bb1783808
commit 723d586678
1 changed files with 4 additions and 2 deletions

View File

@ -65,8 +65,10 @@ func (s *SessionStore) Get(name string) ([]byte, error) {
return []byte("name=\ncwd=\nbackend=\nmodel=\nagent=\n"), nil
case "idx":
return s.index(), nil
case "ls", "kill", "sh", "job", "q", "sched":
return os.ReadFile(paths.CfgDir() + "/scripts/" + name)
default:
if _, ok := sessionStoreFiles[name]; ok {
return os.ReadFile(paths.CfgDir() + "/scripts/" + name)
}
}
return nil, fmt.Errorf("%s: not a readable file", name)
}