1- import { gte } from '@nx-console/nx-version' ;
21import { getPackageManagerCommand } from '@nx-console/shared-npm' ;
32import { nxLatestProvenanceCheck } from '@nx-console/shared-utils' ;
43import { WorkspaceConfigurationStore } from '@nx-console/vscode-configuration' ;
5- import { getNxVersion } from '@nx-console/vscode-nx-workspace' ;
64import { vscodeLogger } from '@nx-console/vscode-output-channels' ;
75import { getTelemetry } from '@nx-console/vscode-telemetry' ;
86import { getWorkspacePath } from '@nx-console/vscode-utils' ;
@@ -18,15 +16,14 @@ import {
1816 tasks ,
1917 window ,
2018} from 'vscode' ;
19+ import { rmSync } from 'fs' ;
20+ import { tmpdir } from 'os' ;
21+ import { join } from 'path' ;
2122
2223let checkTimer : NodeJS . Timeout | undefined ;
2324let intervalTimer : NodeJS . Timeout | undefined ;
2425
2526export function setupPeriodicAiCheck ( context : ExtensionContext ) {
26- if ( WorkspaceConfigurationStore . instance . get ( 'aiCheckDontAskAgain' , false ) ) {
27- return ;
28- }
29-
3027 // Run first check after 1 minute
3128 checkTimer = setTimeout ( ( ) => {
3229 runAiAgentCheck ( ) ;
@@ -109,10 +106,12 @@ async function runAiAgentCheck() {
109106 return ;
110107 }
111108
112- const checkCommand = `${ pkgManagerCommands . dlx } nx@latest configure-ai-agents --check` ;
113-
114109 try {
115110 getTelemetry ( ) . logUsage ( 'ai.configure-agents-check' ) ;
111+ // non a project install, so use NPX and don't pollute npx cache
112+ const tmpDir = join ( tmpdir ( ) , 'nx-console-tmp' ) ;
113+ rmSync ( tmpDir , { recursive : true , force : true } ) ;
114+ const checkCommand = `npx --cache=${ tmpDir } nx@latest configure-ai-agents --check` ;
116115 await promisify ( exec ) ( checkCommand , {
117116 cwd : workspacePath ,
118117 env : {
0 commit comments