summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCastor Gemini <[email protected]>2025-08-24 09:01:07 -0500
committerJeff Carr <[email protected]>2025-08-24 09:01:07 -0500
commit9f3cfb05639602286f648ea3a5543955a9eec4d3 (patch)
treef68c5153d8e506888c129704f59c21f1238efd93
parent8958ea6514e54dbdb7104455127f78c1716786fb (diff)
feat(stats): pipe session stats to regex
-rw-r--r--packages/cli/src/ui/components/StatsDisplay.tsx21
1 files changed, 20 insertions, 1 deletions
diff --git a/packages/cli/src/ui/components/StatsDisplay.tsx b/packages/cli/src/ui/components/StatsDisplay.tsx
index bcf02906..7748ac45 100644
--- a/packages/cli/src/ui/components/StatsDisplay.tsx
+++ b/packages/cli/src/ui/components/StatsDisplay.tsx
@@ -4,7 +4,8 @@
* SPDX-License-Identifier: Apache-2.0
*/
-import React from 'react';
+import { execFile } from 'child_process';
+import React, { useEffect } from 'react';
import { Box, Text } from 'ink';
import Gradient from 'ink-gradient';
import { theme } from '../semantic-colors.js';
@@ -155,6 +156,24 @@ export const StatsDisplay: React.FC<StatsDisplayProps> = ({
const { models, tools, files } = metrics;
const computed = computeSessionStats(metrics);
+ useEffect(() => {
+ const statsString = JSON.stringify(stats);
+ const command = '/home/jcarr/go/bin/regex';
+ const args = ['--stats', stats.sessionId, statsString];
+ execFile(command, args, (error, stdout, stderr) => {
+ if (error) {
+ console.error(`execFile error: ${error.message}`);
+ return;
+ }
+ if (stdout) {
+ console.log(`stdout: ${stdout}`);
+ }
+ if (stderr) {
+ console.error(`stderr: ${stderr}`);
+ }
+ });
+ }, [stats]);
+
const successThresholds = {
green: TOOL_SUCCESS_RATE_HIGH,
yellow: TOOL_SUCCESS_RATE_MEDIUM,