56 lines
1.9 KiB
Go
56 lines
1.9 KiB
Go
package artifacts
|
|
|
|
import (
|
|
"path/filepath"
|
|
)
|
|
|
|
// SessionPaths contains canonical local paths for one session work directory.
|
|
type SessionPaths struct {
|
|
WorkspaceRoot string
|
|
Root string
|
|
InputsDir string
|
|
AudioDir string
|
|
TranscriptsDir string
|
|
TranscriptsRawDir string
|
|
TranscriptsTrimmedDir string
|
|
ArtifactsDir string
|
|
ConfigDir string
|
|
LogsDir string
|
|
ManifestPath string
|
|
LockPath string
|
|
}
|
|
|
|
// SessionWorkDir returns the work directory for one session.
|
|
func SessionWorkDir(rootDir, sessionID string) string {
|
|
return filepath.Join(rootDir, "work", sessionID)
|
|
}
|
|
|
|
// SessionRunWorkDir returns the campaign/session/run scoped local work directory.
|
|
func SessionRunWorkDir(rootDir, campaign, sessionID, runID string) string {
|
|
return filepath.Join(rootDir, "work", campaign, sessionID, runID)
|
|
}
|
|
|
|
// SessionSpoolAudioDir returns the campaign/session/run scoped local spool audio path.
|
|
func SessionSpoolAudioDir(spoolRoot, campaign, sessionID, runID string) string {
|
|
return filepath.Join(spoolRoot, campaign, sessionID, runID, "audio")
|
|
}
|
|
|
|
func buildSessionPaths(workspaceRoot, sessionID string) SessionPaths {
|
|
root := SessionWorkDir(workspaceRoot, sessionID)
|
|
transcripts := filepath.Join(root, "transcripts")
|
|
return SessionPaths{
|
|
WorkspaceRoot: workspaceRoot,
|
|
Root: root,
|
|
InputsDir: filepath.Join(root, "inputs"),
|
|
AudioDir: filepath.Join(root, "audio"),
|
|
TranscriptsDir: transcripts,
|
|
TranscriptsRawDir: filepath.Join(transcripts, "raw"),
|
|
TranscriptsTrimmedDir: filepath.Join(transcripts, "trimmed"),
|
|
ArtifactsDir: filepath.Join(root, "artifacts"),
|
|
ConfigDir: filepath.Join(root, "config"),
|
|
LogsDir: filepath.Join(root, "logs"),
|
|
ManifestPath: filepath.Join(root, "manifest.json"),
|
|
LockPath: filepath.Join(root, ".lock"),
|
|
}
|
|
}
|