orquesta-cli 0.2.6 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/constants.d.ts
CHANGED
|
@@ -4,5 +4,6 @@ export declare const CONFIG_FILE_PATH: string;
|
|
|
4
4
|
export declare const DOCS_DIR: string;
|
|
5
5
|
export declare const BACKUPS_DIR: string;
|
|
6
6
|
export declare const PROJECTS_DIR: string;
|
|
7
|
+
export declare function cwdToProjectSegment(cwd?: string): string;
|
|
7
8
|
export declare const APP_VERSION = "4.2.2";
|
|
8
9
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.js
CHANGED
|
@@ -6,5 +6,11 @@ export const CONFIG_FILE_PATH = path.join(LOCAL_HOME_DIR, 'config.json');
|
|
|
6
6
|
export const DOCS_DIR = path.join(LOCAL_HOME_DIR, 'docs');
|
|
7
7
|
export const BACKUPS_DIR = path.join(LOCAL_HOME_DIR, 'backups');
|
|
8
8
|
export const PROJECTS_DIR = path.join(LOCAL_HOME_DIR, 'projects');
|
|
9
|
+
export function cwdToProjectSegment(cwd = process.cwd()) {
|
|
10
|
+
return cwd
|
|
11
|
+
.replace(/[/\\]/g, '-')
|
|
12
|
+
.replace(/[:*?"<>|]/g, '')
|
|
13
|
+
.replace(/^-+/, '');
|
|
14
|
+
}
|
|
9
15
|
export const APP_VERSION = '4.2.2';
|
|
10
16
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from 'fs/promises';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import { configManager } from '../config/config-manager.js';
|
|
4
|
-
import { PROJECTS_DIR } from '../../constants.js';
|
|
4
|
+
import { PROJECTS_DIR, cwdToProjectSegment } from '../../constants.js';
|
|
5
5
|
import { initializeJsonStreamLogger } from '../../utils/json-stream-logger.js';
|
|
6
6
|
import { logger } from '../../utils/logger.js';
|
|
7
7
|
export class SessionManager {
|
|
@@ -13,8 +13,7 @@ export class SessionManager {
|
|
|
13
13
|
this.currentSessionCreatedAt = new Date().toISOString();
|
|
14
14
|
}
|
|
15
15
|
getSessionsDir() {
|
|
16
|
-
|
|
17
|
-
return path.join(PROJECTS_DIR, cwd);
|
|
16
|
+
return path.join(PROJECTS_DIR, cwdToProjectSegment());
|
|
18
17
|
}
|
|
19
18
|
normalizeMessages(messages) {
|
|
20
19
|
return messages.map(msg => {
|
|
@@ -2,7 +2,7 @@ import { createWriteStream } from 'fs';
|
|
|
2
2
|
import { mkdir, access, readFile, writeFile } from 'fs/promises';
|
|
3
3
|
import { dirname, join } from 'path';
|
|
4
4
|
import chalk from 'chalk';
|
|
5
|
-
import { PROJECTS_DIR } from '../constants.js';
|
|
5
|
+
import { PROJECTS_DIR, cwdToProjectSegment } from '../constants.js';
|
|
6
6
|
const FLUSH_INTERVAL_MS = 1000;
|
|
7
7
|
function getLogCategory(type) {
|
|
8
8
|
switch (type) {
|
|
@@ -787,7 +787,7 @@ export async function initializeJsonStreamLogger(sessionId, append = false, verb
|
|
|
787
787
|
if (globalJsonStreamLogger) {
|
|
788
788
|
await globalJsonStreamLogger.close();
|
|
789
789
|
}
|
|
790
|
-
const cwd =
|
|
790
|
+
const cwd = cwdToProjectSegment();
|
|
791
791
|
const projectLogDir = join(PROJECTS_DIR, cwd);
|
|
792
792
|
const logFile = join(projectLogDir, `${sessionId}_log.json`);
|
|
793
793
|
const errorLogFile = join(projectLogDir, `${sessionId}_error.json`);
|