scai 0.1.146 → 0.1.147
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.js +5 -0
- package/dist/index.js +6 -0
- package/package.json +2 -2
package/dist/constants.js
CHANGED
|
@@ -36,6 +36,11 @@ export const LOG_PATH = path.join(SCAI_HOME, 'daemon.log');
|
|
|
36
36
|
* ~/.scai/prompt.log
|
|
37
37
|
*/
|
|
38
38
|
export const PROMPT_LOG_PATH = path.join(SCAI_HOME, 'prompt.log');
|
|
39
|
+
/**
|
|
40
|
+
* Path to the per-run agent input/output log:
|
|
41
|
+
* ~/.scai/input_output.log
|
|
42
|
+
*/
|
|
43
|
+
export const RUN_LOG_PATH = path.join(SCAI_HOME, 'input_output.log');
|
|
39
44
|
/**
|
|
40
45
|
* Default sleep time for the daemon loop in milliseconds.
|
|
41
46
|
* This is used when no value is configured in the config file or via environment variables.
|
package/dist/index.js
CHANGED
|
@@ -12,6 +12,7 @@ import { runAskCommand } from './commands/AskCmd.js';
|
|
|
12
12
|
import enquirer from 'enquirer';
|
|
13
13
|
import { getLockedRepo, isDaemonRunning, startDaemon, stopDaemon } from './commands/DaemonCmd.js';
|
|
14
14
|
import { Config } from './config.js';
|
|
15
|
+
import { RUN_LOG_PATH } from './constants.js';
|
|
15
16
|
const { prompt } = enquirer;
|
|
16
17
|
const program = cmdFactory();
|
|
17
18
|
const customCommands = {};
|
|
@@ -181,8 +182,13 @@ async function startShell() {
|
|
|
181
182
|
}
|
|
182
183
|
}
|
|
183
184
|
}
|
|
185
|
+
function initRunLog() {
|
|
186
|
+
fs.mkdirSync(path.dirname(RUN_LOG_PATH), { recursive: true });
|
|
187
|
+
fs.writeFileSync(RUN_LOG_PATH, '', { flag: 'w' });
|
|
188
|
+
}
|
|
184
189
|
// ---------------- Main ----------------
|
|
185
190
|
async function main() {
|
|
191
|
+
initRunLog();
|
|
186
192
|
// ---------------- Global Error Handlers ----------------
|
|
187
193
|
process.on('unhandledRejection', (reason) => console.error('Unhandled Rejection:', reason));
|
|
188
194
|
process.on('uncaughtException', (err) => {
|