pluginParsers.ts ×5

Frontier kind: Code frontier

unlabeled · c_24f33e716ceb

5 tests · 45172 LOC · 206 files · introduces 0 tests · 57 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges57 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
4510 ranges45172 lines · 206 files · Browse complete extent
All tests (intent)
5 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

2 files ranked by introduced lines: 57 introduced LOC across 6 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentPlugins/common/pluginParsers.ts 47 introduced LOC · 5 ranges

Open complete file

178 pluginRootEnvVars: ['PLUGIN_ROOT', 'CLAUDE_PLUGIN_ROOT'],
179 parseHooks(hookUri, json, pluginUri, workspaceRoot, userHome) {
180 > return interpolateHookPluginRoot(hookUri, json, pluginUri, workspaceRoot, userHome, '${PLUGIN_ROOT}', 'PLUGIN_ROOT'); pluginParsers.ts
181 > },
182 };
183
783 */
784 export function interpolateHookPluginRoot(
785 > hookUri: URI, pluginParsers.ts
786 > json: unknown,
787 > pluginUri: URI,
788 > workspaceRoot: URI | undefined,
789 > userHome: URI,
790 > token: string,
791 > envVar: string,
792 > ): IParsedHookGroup[] {
793 > const fsPath = pluginUri.fsPath;
794 > const typedJson = json as { hooks?: Record<string, unknown[]> };
795 >
796 > const mutateHookCommand = (hook: Record<string, unknown>): void => {
797 > for (const field of ['command', 'windows', 'linux', 'osx'] as const) {
798 > if (typeof hook[field] === 'string') {
799 > hook[field] = shellQuotePluginRootInCommand(hook[field] as string, fsPath, token);
800 > }
801 > }
802 >
803 > if (!hook.env || typeof hook.env !== 'object') {
804 > hook.env = {};
805 > }
806 > (hook.env as Record<string, string>)[envVar] = fsPath;
807 > };
808 >
809 > for (const lifecycle of Object.values(typedJson.hooks ?? {})) {
810 > if (!Array.isArray(lifecycle)) {
811 continue;
812 }
813 > for (const lifecycleEntry of lifecycle) { pluginParsers.ts
814 > if (!lifecycleEntry || typeof lifecycleEntry !== 'object') {
815 continue;
816 }
817 > const entry = lifecycleEntry as { hooks?: Record<string, unknown>[] } & Record<string, unknown>; pluginParsers.ts
818 > if (Array.isArray(entry.hooks)) {
819 > for (const hook of entry.hooks) {
820 > mutateHookCommand(hook);
821 > }
822 > } else {
823 mutateHookCommand(entry);
824 }
826 > }
827 >
828 > const replacer = (v: unknown): unknown => {
829 > return typeof v === 'string'
830 > ? v.replaceAll(token, pluginUri.fsPath)
831 > : undefined;
832 > };
833 >
834 > return parseHooksJson(hookUri, cloneAndChange(json, replacer), workspaceRoot, userHome);
835 > }
836
837 // ---------------------------------------------------------------------------
src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.ts 10 introduced LOC · 1 range

Open complete file

66 * The canonical type strings from the platform layer map directly to {@link HookType} enum values.
67 */
68 > function toAgentPluginHooks(groups: readonly IParsedHookGroup[]): IAgentPluginHook[] { agentPluginServiceImpl.ts
69 > return groups
70 > .filter(g => Object.values(HookType).includes(g.type as HookType))
71 > .map(g => ({
72 > type: g.type as HookType,
73 > hooks: g.commands,
74 > uri: g.uri,
75 > originalId: g.originalId,
76 > }));
77 > }
78
79 /** File suffixes accepted for rule/instruction files (longest first for correct name stripping). */