always-on-paths.js 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. import path from 'path';
  2. import { resolvePilotHome, createProjectId } from '../utils/pilotPaths.js';
  3. export function getAlwaysOnRoot(projectRoot) {
  4. const pilotHome = resolvePilotHome();
  5. const projectId = createProjectId(path.resolve(projectRoot));
  6. return path.join(pilotHome, 'always-on', 'projects', projectId);
  7. }
  8. export function getAlwaysOnHeartbeatsDir(projectRoot) {
  9. return path.join(getAlwaysOnRoot(projectRoot), 'heartbeats');
  10. }
  11. export function getAlwaysOnHeartbeatPath(projectRoot, fileName) {
  12. return path.join(getAlwaysOnHeartbeatsDir(projectRoot), fileName);
  13. }
  14. export function getAlwaysOnDiscoveryLockPath(projectRoot) {
  15. return path.join(getAlwaysOnRoot(projectRoot), 'locks', 'discovery.lock');
  16. }
  17. export function getAlwaysOnDiscoveryStatePath(projectRoot) {
  18. return path.join(getAlwaysOnRoot(projectRoot), 'state.json');
  19. }
  20. export function getAlwaysOnRunHistoryPath(projectRoot) {
  21. return path.join(getAlwaysOnRoot(projectRoot), 'run-history.jsonl');
  22. }
  23. export function getAlwaysOnRunsDir(projectRoot) {
  24. return path.join(getAlwaysOnRoot(projectRoot), 'runs');
  25. }