Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/hooks-cmd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
scopedToolPaths,
} from './types.js';
import { getUserHome } from './utils/home.js';
import { pathExists } from './utils/fs.js';

type HookListStatus = HookStatus | 'not configured';

Expand Down Expand Up @@ -95,6 +96,19 @@ export async function hooksList(_options: GlobalOptions): Promise<void> {
: paths.settings
? path.join(baseDir, paths.settings)
: undefined;
// OMP has no settings/hooks file to parse: its hooks are a single
// generated extension under the user agent dir, so presence of the
// file (with our marker) is the whole status.
if (tool === 'omp') {
const { resolveOmpExtensionsDir, OMP_HOOK_FILE } = await import('./omp-hooks.js');
const extFile = path.join(resolveOmpExtensionsDir(), OMP_HOOK_FILE);
rows.push({
tool,
status: await pathExists(extFile) ? 'installed' : 'missing',
settingsPath: formatDisplayPath(extFile),
});
continue;
}
if (!hookPath) {
rows.push({ tool, status: 'not configured', settingsPath: 'no settings configured' });
continue;
Expand Down
2 changes: 1 addition & 1 deletion src/omp-hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import { log } from './utils/logger.js';
/** Filename of the teamai-managed OMP extension. */
export const OMP_HOOK_FILE = 'teamai-hooks.ts';

/** Marker so `teamai doctor` / `uninstall` can recognize our generated file. */
/** Marker so `teamai uninstall` / `teamai hooks list` can recognize our generated file. */
const TEAMAI_MARKER = '[teamai]';

/**
Expand Down
Loading