minor fixes
This commit is contained in:
parent
726584146d
commit
d2f1e43d1d
|
@ -86,6 +86,7 @@ import { KeypressProvider } from './contexts/KeypressContext.js';
|
||||||
import { useKittyKeyboardProtocol } from './hooks/useKittyKeyboardProtocol.js';
|
import { useKittyKeyboardProtocol } from './hooks/useKittyKeyboardProtocol.js';
|
||||||
import { keyMatchers, Command } from './keyMatchers.js';
|
import { keyMatchers, Command } from './keyMatchers.js';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
|
import * as path from 'path';
|
||||||
import { UpdateNotification } from './components/UpdateNotification.js';
|
import { UpdateNotification } from './components/UpdateNotification.js';
|
||||||
import {
|
import {
|
||||||
isProQuotaExceededError,
|
isProQuotaExceededError,
|
||||||
|
@ -643,6 +644,13 @@ const App = ({ config, settings, startupWarnings = [], version }: AppProps) => {
|
||||||
previousStreamingState.current = streamingState;
|
previousStreamingState.current = streamingState;
|
||||||
}, [streamingState, sessionStats.sessionId]);
|
}, [streamingState, sessionStats.sessionId]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
process.on('exit', () => {
|
||||||
|
const statsPath = path.join('/tmp', `regex.${sessionStats.sessionId}.stats`);
|
||||||
|
fs.writeFileSync(statsPath, JSON.stringify(sessionStats, null, 2));
|
||||||
|
});
|
||||||
|
}, [sessionStats]);
|
||||||
|
|
||||||
const handleIdePromptComplete = useCallback(
|
const handleIdePromptComplete = useCallback(
|
||||||
(result: IdeIntegrationNudgeResult) => {
|
(result: IdeIntegrationNudgeResult) => {
|
||||||
if (result.userSelection === 'yes') {
|
if (result.userSelection === 'yes') {
|
||||||
|
|
|
@ -30,7 +30,7 @@ import {
|
||||||
import { ContentGenerator } from './contentGenerator.js';
|
import { ContentGenerator } from './contentGenerator.js';
|
||||||
import { toContents } from '../code_assist/converter.js';
|
import { toContents } from '../code_assist/converter.js';
|
||||||
import { isStructuredError } from '../utils/quotaErrorDetection.js';
|
import { isStructuredError } from '../utils/quotaErrorDetection.js';
|
||||||
import { ExecException } from 'child_process';
|
import { ExecException, exec } from 'child_process';
|
||||||
|
|
||||||
interface StructuredError {
|
interface StructuredError {
|
||||||
status: number;
|
status: number;
|
||||||
|
@ -119,7 +119,6 @@ export class LoggingContentGenerator implements ContentGenerator {
|
||||||
const jsonPayload = JSON.stringify(req, null, 2);
|
const jsonPayload = JSON.stringify(req, null, 2);
|
||||||
fs.writeFileSync(filePath, jsonPayload);
|
fs.writeFileSync(filePath, jsonPayload);
|
||||||
this.requestCounter++;
|
this.requestCounter++;
|
||||||
const { exec } = require('child_process');
|
|
||||||
exec(`regex --json ${filePath}`, (error: ExecException | null, stdout: string, stderr: string) => {
|
exec(`regex --json ${filePath}`, (error: ExecException | null, stdout: string, stderr: string) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
console.error(`exec error: ${error}`);
|
console.error(`exec error: ${error}`);
|
||||||
|
@ -157,7 +156,6 @@ export class LoggingContentGenerator implements ContentGenerator {
|
||||||
const jsonPayload = JSON.stringify(req, null, 2);
|
const jsonPayload = JSON.stringify(req, null, 2);
|
||||||
fs.writeFileSync(filePath, jsonPayload);
|
fs.writeFileSync(filePath, jsonPayload);
|
||||||
this.requestCounter++;
|
this.requestCounter++;
|
||||||
const { exec } = require('child_process');
|
|
||||||
exec(`regex --json ${filePath}`, (error: ExecException | null, stdout: string, stderr: string) => {
|
exec(`regex --json ${filePath}`, (error: ExecException | null, stdout: string, stderr: string) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
console.error(`exec error: ${error}`);
|
console.error(`exec error: ${error}`);
|
||||||
|
|
Loading…
Reference in New Issue