1
>
/*---------------------------------------------------------------------------------------------
claudeHookScan.ts
2
>
* Copyright (c) Microsoft Corporation. All rights reserved.
3
>
* Licensed under the MIT License. See License.txt in the project root for license information.
4
>
*--------------------------------------------------------------------------------------------*/
5
>
6
>
import { URI } from '../../../../../../base/common/uri.js';
7
>
import { ResourceSet } from '../../../../../../base/common/map.js';
8
>
import { IFileService } from '../../../../../files/common/files.js';
9
>
import { parseHooksJson, readJsonFile } from '../../../../../agentPlugins/common/pluginParsers.js';
10
>
import { type HookCustomization } from '../../../../common/state/protocol/channels-session/state.js';
11
>
12
>
/**
13
>
* The JSON files a Claude session reads hook declarations from, in
14
>
* precedence order (project before user). Mirrors the SDK's
15
>
* `settingSources: ['user', 'project', 'local']` scopes (the `managed`
16
>
* scope is intentionally excluded). `settings.local.json` is the
17
>
* gitignored project-local override; the SDK loads it alongside
18
>
* `settings.json`.
19
>
*/
20
function claudeHookFiles(workingDirectory: URI | undefined, userHome: URI): URI[] {
21
const files: URI[] = [];