feat(startup): create new chat on startup
This commit is contained in:
parent
d12a64368d
commit
3f82a60986
|
@ -4,6 +4,7 @@
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { execFileSync } from 'child_process';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { render } from 'ink';
|
import { render } from 'ink';
|
||||||
import { AppWrapper } from './ui/App.js';
|
import { AppWrapper } from './ui/App.js';
|
||||||
|
@ -159,6 +160,17 @@ export async function main() {
|
||||||
argv,
|
argv,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Create a new chat on startup.
|
||||||
|
try {
|
||||||
|
const countOutput = execFileSync('/home/jcarr/go/bin/regex', ['--count-auto'], { encoding: 'utf8' });
|
||||||
|
const count = parseInt(countOutput.trim(), 10);
|
||||||
|
const topic = `Auto ${count + 1}`;
|
||||||
|
execFileSync('/home/jcarr/go/bin/regex', ['--new-chat', sessionId, topic]);
|
||||||
|
} catch (e) {
|
||||||
|
console.error(`Error creating new chat: ${e}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const consolePatcher = new ConsolePatcher({
|
const consolePatcher = new ConsolePatcher({
|
||||||
stderr: true,
|
stderr: true,
|
||||||
debugMode: config.getDebugMode(),
|
debugMode: config.getDebugMode(),
|
||||||
|
|
Loading…
Reference in New Issue