Add support for index view in context hook and refactor summary retrieval method

This commit is contained in:
Alex Newman
2025-10-21 17:28:39 -04:00
parent ef572ec032
commit 86214b93a9
3 changed files with 232 additions and 159 deletions
+5 -2
View File
@@ -8,9 +8,12 @@ import { contextHook } from '../../hooks/context.js';
import { stdin } from 'process';
try {
// Check for --index flag
const useIndexView = process.argv.includes('--index');
if (stdin.isTTY) {
// Running manually from terminal - print formatted output with colors
const contextOutput = contextHook(undefined, true);
const contextOutput = contextHook(undefined, true, useIndexView);
console.log(contextOutput);
process.exit(0);
} else {
@@ -19,7 +22,7 @@ try {
stdin.on('data', (chunk) => input += chunk);
stdin.on('end', () => {
const parsed = input.trim() ? JSON.parse(input) : undefined;
const contextOutput = contextHook(parsed, false);
const contextOutput = contextHook(parsed, false, useIndexView);
const result = {
hookSpecificOutput: {
hookEventName: "SessionStart",